From 04a1a5d3f917fef12aece7fbc5e31cfab6c2561d Mon Sep 17 00:00:00 2001 From: jesus Date: Wed, 27 Mar 2013 21:28:59 +0000 Subject: [PATCH] LazReport, formalize the hyphenation support exception and make the editor sample ignore it git-svn-id: trunk@40652 - --- components/lazreport/samples/editor/calleditorwithpkg.lpi | 7 +++++++ components/lazreport/source/lr_class.pas | 2 +- components/lazreport/source/lr_hyphen.pas | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/components/lazreport/samples/editor/calleditorwithpkg.lpi b/components/lazreport/samples/editor/calleditorwithpkg.lpi index dc159d6036..17eeeaf5f1 100644 --- a/components/lazreport/samples/editor/calleditorwithpkg.lpi +++ b/components/lazreport/samples/editor/calleditorwithpkg.lpi @@ -121,4 +121,11 @@ + + + + + + + diff --git a/components/lazreport/source/lr_class.pas b/components/lazreport/source/lr_class.pas index 6a55d9eb51..7581d380b2 100644 --- a/components/lazreport/source/lr_class.pas +++ b/components/lazreport/source/lr_class.pas @@ -1764,7 +1764,7 @@ begin try FHyp.BreakWord('lazreport'); except - on E:Exception do + on E:EHyphenationException do DebugLn('Error: ', e.message,'. Hyphenation support will be disabled'); end; end; diff --git a/components/lazreport/source/lr_hyphen.pas b/components/lazreport/source/lr_hyphen.pas index a0d7f530d4..dc7e5308fd 100644 --- a/components/lazreport/source/lr_hyphen.pas +++ b/components/lazreport/source/lr_hyphen.pas @@ -42,6 +42,9 @@ const MAX_CHARS = 100; type + + EHyphenationException = class(Exception); + PHyphenTrans = ^HyphenTrans; HyphenTrans = record ch: char; @@ -220,10 +223,10 @@ begin result := ''; if not CheckLibrary then - raise Exception.Create('hyphen libarary not loaded'); + raise EHyphenationException.Create('hyphen libarary not loaded'); if not CheckDictionary then - raise Exception.Create('hyphen dictionary not loaded'); + raise EHyphenationException.Create('hyphen dictionary not loaded'); len := Length(word); hyphens := StrAlloc(Len + 5);