LazReport, formalize the hyphenation support exception and make the editor sample ignore it

git-svn-id: trunk@40652 -
This commit is contained in:
jesus 2013-03-27 21:28:59 +00:00
parent 2d47913308
commit 04a1a5d3f9
3 changed files with 13 additions and 3 deletions

View File

@ -121,4 +121,11 @@
</Other> </Other>
<CompileReasons Run="False"/> <CompileReasons Run="False"/>
</CompilerOptions> </CompilerOptions>
<Debugging>
<Exceptions Count="1">
<Item1>
<Name Value="EHyphenationException"/>
</Item1>
</Exceptions>
</Debugging>
</CONFIG> </CONFIG>

View File

@ -1764,7 +1764,7 @@ begin
try try
FHyp.BreakWord('lazreport'); FHyp.BreakWord('lazreport');
except except
on E:Exception do on E:EHyphenationException do
DebugLn('Error: ', e.message,'. Hyphenation support will be disabled'); DebugLn('Error: ', e.message,'. Hyphenation support will be disabled');
end; end;
end; end;

View File

@ -42,6 +42,9 @@ const
MAX_CHARS = 100; MAX_CHARS = 100;
type type
EHyphenationException = class(Exception);
PHyphenTrans = ^HyphenTrans; PHyphenTrans = ^HyphenTrans;
HyphenTrans = record HyphenTrans = record
ch: char; ch: char;
@ -220,10 +223,10 @@ begin
result := ''; result := '';
if not CheckLibrary then if not CheckLibrary then
raise Exception.Create('hyphen libarary not loaded'); raise EHyphenationException.Create('hyphen libarary not loaded');
if not CheckDictionary then if not CheckDictionary then
raise Exception.Create('hyphen dictionary not loaded'); raise EHyphenationException.Create('hyphen dictionary not loaded');
len := Length(word); len := Length(word);
hyphens := StrAlloc(Len + 5); hyphens := StrAlloc(Len + 5);