Update SynEdit component to latest version from mh-nexus.de (September 28). Fixes issue #1122.

This commit is contained in:
Ansgar Becker
2009-12-31 15:39:08 +00:00
parent d82004c0cd
commit 6b11615e83
12 changed files with 244 additions and 104 deletions

View File

@ -1,7 +1,53 @@
This is version 1.2 of the SynEdit project.
Unicode SynEdit
===============
This is the Unicode version of SynEdit, a syntax highlighting editor that had
originally been designed for ANSI character sets.
For the available information check out the "Unicode SynEdit" Web-site at:
http://mh-nexus.de/en/unisynedit.php
The ANSI version of SynEdit is located at:
http://synedit.sourceforge.net
The SynEdit project has also a page at SourceForge
http://sourceforge.net/projects/synedit
where you may find additional information.
Installation note: The Unicode and ANSI version of SynEdit may not be used
together on the same system. If you used ANSI SynEdit before delete every DCU
and BPL it created. Also make sure your library/source path in the environment
options is set correctly.
To get started check out the different examples. If you have questions, please
subscribe to the SynEdit user list and ask there, if you want to hack SynEdit
you should subscribe to the SynEdit developer list. General feedback and
suggestions or fixes are welcome.
There is no documentation yet, help in this area is especially welcome!
CVS access
----------
CVSROOT is:
:pserver:anonymous@synedit.cvs.sourceforge.net:/cvsroot/synedit
To get Unicode SynEdit you have to choose the tag/branch:
Unicode_2004_08_31
Note that the date stamp included above was the date when the branch was made
and does not have any correlation with the latest release date, i.e. you will
always get the latest version using the branch above.
Historical Note
---------------
SynEdit has been started as an attempt to continue the no longer maintained
sources of the mwEdit project. The last public version 0.92a of mwEdit can be
sources of the mwEdit project.The last public version 0.92a of mwEdit can be
found at the SynEdit website in the download section.
The mwEdit project was started in 1998 by Martin Waldenburg, aim was to produce
a syntax highlighting editor component for an Open Source IDE. In the 15 months
@ -14,30 +60,4 @@ There would however be no such project if Martin had not started to develop
mwEdit, so we would like to thank Martin Waldenburg for his efforts, and of
course all the other developers of the mwEdit project.
The primary purpose of SynEdit is to be a syntax highlighting editor for
programming languages. There are already more than 30 highlighter components for
different languages, and writing a highlighter is not very difficult.
You should however keep some things in mind when using the SynEdit components:
- Support for real tabs is under construction.
To get started check out the different examples. If you have questions, please
subscribe to the SynEdit user list and ask there, if you want to hack SynEdit
you should subscribe to the SynEdit developer list. General feedback and
suggestions or fixes are very welcome.
There is no documentation yet, help in this area is especially welcome!
For the available information check out the SynEdit website
http://synedit.sourceforge.net
and the SynEdit project page at SourceForge
http://sourceforge.net/projects/synedit
where you will find the necessary links.
--
Michael Hieke
$Id: Readme.txt,v 1.3.2.1 2004/10/09 18:34:26 maelh Exp $
$Id: Readme.txt,v 1.3.2.2 2008/11/08 15:48:34 maelh Exp $

View File

@ -28,7 +28,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynDBEdit.pas,v 1.11.2.1 2004/08/31 12:55:16 maelh Exp $
$Id: SynDBEdit.pas,v 1.11.2.2 2009/06/14 13:33:38 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -363,7 +363,7 @@ begin
BlobStream := TBlobStream.Create(BlobField, bmRead);
{$ENDIF}
Lines.BeginUpdate;
Lines.LoadFromStream(BlobStream);
Lines.LoadFromStream(BlobStream{$IFDEF UNICODE}, TEncoding.Default{$ENDIF});
Lines.EndUpdate;
BlobStream.Free;
Modified := False;

View File

@ -28,7 +28,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynEdit.pas,v 1.386.2.75 2008/09/17 13:59:11 maelh Exp $
$Id: SynEdit.pas,v 1.386.2.76 2009/09/28 17:54:20 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -486,6 +486,9 @@ type
fChainUndoAdded: TNotifyEvent;
fChainRedoAdded: TNotifyEvent;
FAdditionalWordBreakChars: TSysCharSet;
FAdditionalIdentChars: TSysCharSet;
{$IFDEF SYN_COMPILER_6_UP}
fSearchNotFound: TCustomSynEditSearchNotFoundEvent;
OnFindBeforeSearch: TNotifyEvent;
@ -610,6 +613,8 @@ type
procedure UpdateScrollBars;
procedure WriteAddedKeystrokes(Writer: TWriter);
procedure WriteRemovedKeystrokes(Writer: TWriter);
procedure SetAdditionalIdentChars(const Value: TSysCharSet);
procedure SetAdditionalWordBreakChars(const Value: TSysCharSet);
{$IFDEF SYN_COMPILER_6_UP}
procedure DoSearchFindFirstExecute(Action: TSearchFindFirst);
@ -877,6 +882,8 @@ type
aUndo, aRedo: TSynEditUndoList);
procedure UnHookTextBuffer;
public
property AdditionalIdentChars: TSysCharSet read FAdditionalIdentChars write SetAdditionalIdentChars;
property AdditionalWordBreakChars: TSysCharSet read FAdditionalWordBreakChars write SetAdditionalWordBreakChars;
property BlockBegin: TBufferCoord read GetBlockBegin write SetBlockBegin;
property BlockEnd: TBufferCoord read GetBlockEnd write SetBlockEnd;
property CanPaste: Boolean read GetCanPaste;
@ -7435,10 +7442,13 @@ begin
if SpaceCount2 > 0 then
begin
SpaceBuffer := Copy(Lines[BackCounter], 1, SpaceCount2);
InternalCaretXY := BufferCoord(1, CaretY +1);
for i := 1 to Length(SpaceBuffer) do
if SpaceBuffer[i] = #9 then
CommandProcessor(ecTab, #0, nil)
else
CommandProcessor(ecChar, SpaceBuffer[i], nil);
end;
InternalCaretXY := BufferCoord(SpaceCount2 +1, CaretY +1);
end;
fUndoList.AddChange(crLineBreak, Caret, Caret, '', smNormal);
end;
@ -7965,6 +7975,16 @@ begin
end;
end;
procedure TCustomSynEdit.SetAdditionalIdentChars(const Value: TSysCharSet);
begin
FAdditionalIdentChars := Value;
end;
procedure TCustomSynEdit.SetAdditionalWordBreakChars(const Value: TSysCharSet);
begin
FAdditionalWordBreakChars := Value;
end;
procedure TCustomSynEdit.BeginUndoBlock;
begin
fUndoList.BeginBlock;
@ -10300,6 +10320,11 @@ begin
else
Result := AChar >= #33;
if Assigned(Highlighter) then
Result := Result or CharInSet(AChar, Highlighter.AdditionalIdentChars)
else
Result := Result or CharInSet(AChar, Self.AdditionalIdentChars);
Result := Result and not IsWordBreakChar(AChar);
end;
@ -10329,6 +10354,17 @@ begin
else
Result := False;
end;
if Assigned(Highlighter) then
begin
Result := Result or CharInSet(AChar, Highlighter.AdditionalWordBreakChars);
Result := Result and not CharInSet(AChar, Highlighter.AdditionalIdentChars);
end
else
begin
Result := Result or CharInSet(AChar, Self.AdditionalWordBreakChars);
Result := Result and not CharInSet(AChar, Self.AdditionalIdentChars);
end;
end;
procedure TCustomSynEdit.SetSearchEngine(Value: TSynEditSearchCustom);

View File

@ -18,7 +18,7 @@ All Rights Reserved.
Contributors to the SynEdit and mwEdit projects are listed in the
Contributors.txt file.
$Id: SynEditHighlighter.pas,v 1.36.2.18 2008/09/14 16:24:58 maelh Exp $
$Id: SynEditHighlighter.pas,v 1.36.2.19 2009/09/28 17:54:20 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -129,7 +129,13 @@ type
fAttrChangeHooks: TSynNotifyEventChain;
fUpdateCount: Integer;
fEnabled: Boolean;
FAdditionalWordBreakChars: TSysCharSet;
FAdditionalIdentChars: TSysCharSet;
FExportName: string;
function GetExportName: string;
procedure SetEnabled(const Value: Boolean);
procedure SetAdditionalIdentChars(const Value: TSysCharSet);
procedure SetAdditionalWordBreakChars(const Value: TSysCharSet);
protected
fCasedLine: PWideChar;
fCasedLineStr: UnicodeString;
@ -216,6 +222,8 @@ type
property FriendlyLanguageName: UnicodeString read GetFriendlyLanguageNameProp;
property LanguageName: string read GetLanguageNameProp;
public
property AdditionalIdentChars: TSysCharSet read FAdditionalIdentChars write SetAdditionalIdentChars;
property AdditionalWordBreakChars: TSysCharSet read FAdditionalWordBreakChars write SetAdditionalWordBreakChars;
property AttrCount: Integer read GetAttribCount;
property Attribute[Index: Integer]: TSynHighlighterAttributes
read GetAttribute;
@ -233,6 +241,7 @@ type
index SYN_ATTR_SYMBOL read GetDefaultAttribute;
property WhitespaceAttribute: TSynHighlighterAttributes
index SYN_ATTR_WHITESPACE read GetDefaultAttribute;
property ExportName: string read GetExportName;
published
property DefaultFilter: string read GetDefaultFilter write SetDefaultFilter
stored IsFilterStored;
@ -265,6 +274,7 @@ type
implementation
uses
SynEditMiscProcs,
{$IFDEF UNICODE}
WideStrUtils,
{$ENDIF}
@ -978,6 +988,13 @@ begin
Result := fExpandedTokenPos;
end;
function TSynCustomHighlighter.GetExportName: string;
begin
if FExportName = '' then
FExportName := SynEditMiscProcs.DeleteTypePrefixAndSynSuffix(ClassName);
Result := FExportName;
end;
function TSynCustomHighlighter.GetExpandedToken: UnicodeString;
var
Len: Integer;
@ -1154,6 +1171,18 @@ procedure TSynCustomHighlighter.ResetRange;
begin
end;
procedure TSynCustomHighlighter.SetAdditionalIdentChars(
const Value: TSysCharSet);
begin
FAdditionalIdentChars := Value;
end;
procedure TSynCustomHighlighter.SetAdditionalWordBreakChars(
const Value: TSysCharSet);
begin
FAdditionalWordBreakChars := Value;
end;
procedure TSynCustomHighlighter.SetAttributesOnChange(AEvent: TNotifyEvent);
var
i: Integer;

View File

@ -28,7 +28,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynEditMiscProcs.pas,v 1.35.2.7 2008/09/14 16:24:58 maelh Exp $
$Id: SynEditMiscProcs.pas,v 1.35.2.8 2009/09/28 17:54:20 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -173,6 +173,8 @@ function CalcFCS(const ABuf; ABufSize: Cardinal): Word;
procedure SynDrawGradient(const ACanvas: TCanvas; const AStartColor, AEndColor: TColor;
ASteps: Integer; const ARect: TRect; const AHorizontal: Boolean);
function DeleteTypePrefixAndSynSuffix(S: string): string;
implementation
uses
@ -844,7 +846,7 @@ begin
for i := 0 to Schemes.Count - 1 do
begin
UniqueAttriName := DeleteTypePrefixAndSynSuffix(Highlighter.ClassName) +
UniqueAttriName := Highlighter.ExportName +
IntToStr(GetHighlighterIndex(Highlighter, HighlighterList)) + '.' +
Schemes[i].MarkerAttri.Name + IntToStr(i + 1);
@ -860,7 +862,7 @@ begin
else if Assigned(Highlighter) then
for i := 0 to Highlighter.AttrCount - 1 do
begin
UniqueAttriName := DeleteTypePrefixAndSynSuffix(Highlighter.ClassName) +
UniqueAttriName := Highlighter.ExportName +
IntToStr(GetHighlighterIndex(Highlighter, HighlighterList)) + '.' +
Highlighter.Attribute[i].Name;

View File

@ -25,7 +25,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynEditStrConst.pas,v 1.41.2.4 2008/01/30 20:39:46 maelh Exp $
$Id: SynEditStrConst.pas,v 1.41.2.5 2009/01/06 16:26:01 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -433,7 +433,7 @@ resourcestring
SYNS_FilterCAClipper = 'CA-Clipper Files (*.prg;*.ch;*.inc)|*.prg;*.ch;*.inc';
SYNS_FilterCORBAIDL = 'CORBA IDL Files (*.idl)|*.idl';
SYNS_FilterCPM = 'CPM Reports (*.rdf;*.rif;*.rmf;*.rxf)|*.rdf;*.rif;*.rmf;*.rxf';
SYNS_FilterCPP = 'C/C++ Files (*.c;*.cpp;*.cc;*.h;*.hpp;*.hh;*.cxx;*.hxx)|*.c;*.cpp;*.cc;*.h;*.hpp;*.hh;*.cxx;*.hxx';
SYNS_FilterCPP = 'C/C++ Files (*.c;*.cpp;*.cc;*.h;*.hpp;*.hh;*.cxx;*.hxx;*.cu)|*.c;*.cpp;*.cc;*.h;*.hpp;*.hh;*.cxx;*.hxx;*.cu';
SYNS_FilterCS = 'C# Files (*.cs)|*.cs';
SYNS_FilterJava = 'Java Files (*.java)|*.java';
SYNS_FilterPerl = 'Perl Files (*.pl;*.pm;*.cgi)|*.pl;*.pm;*.cgi';

View File

@ -28,7 +28,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynEditTextBuffer.pas,v 1.63.2.13 2008/09/14 16:24:59 maelh Exp $
$Id: SynEditTextBuffer.pas,v 1.63.2.15 2009/06/14 13:41:44 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -601,16 +601,29 @@ begin
end;
function TSynEditStringList.GetTextStr: UnicodeString;
procedure RemoveTrailingUnicodeLineBreak;
begin // The Delphi 2009+ RTL forces a trailing line break when getting the text, so we remove it
{$IFDEF UNICODE}
if Copy(Result, Length(Result) - Length(LineBreak) + 1, Length(LineBreak)) = LineBreak then
SetLength(Result, Length(Result) - Length(LineBreak));
{$ENDIF}
end;
var
SLineBreak: UnicodeString;
begin
if not FStreaming then
Result := inherited GetTextStr
begin
Result := inherited GetTextStr;
RemoveTrailingUnicodeLineBreak;
end
else
begin
{$IFDEF UNICODE}
SLineBreak := LineBreak;
Result := inherited GetTextStr;
RemoveTrailingUnicodeLineBreak;
{$ELSE}
case FileFormat of
sffDos:

View File

@ -394,11 +394,8 @@ procedure TSynWordWrapPlugin.Reset;
begin
Assert(Editor.CharsInWindow >= 0);
if Editor.CharsInWindow > 255 then fMaxRowLength := 255
else fMaxRowLength := Editor.CharsInWindow;
if Editor.CharsInWindow > 382 then fMinRowLength := 255
else fMinRowLength := Editor.CharsInWindow - (Editor.CharsInWindow div 3);
fMaxRowLength := Editor.CharsInWindow;
fMinRowLength := Editor.CharsInWindow - (Editor.CharsInWindow div 3);
if fMinRowLength <= 0 then
fMinRowLength := 1;

View File

@ -29,7 +29,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynHighlighterPas.pas,v 1.27.2.9 2008/09/14 16:25:01 maelh Exp $
$Id: SynHighlighterPas.pas,v 1.27.2.10 2009/02/23 15:43:50 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -87,6 +87,7 @@ type
const
LastDelphiVersion = dvDelphi2005;
BDSVersionPrefix = 'BDS';
type
TSynPasSyn = class(TSynCustomHighlighter)
@ -1085,17 +1086,27 @@ begin
end;
procedure TSynPasSyn.EnumUserSettings(DelphiVersions: TStrings);
begin
{ returns the user settings that exist in the registry }
{$IFNDEF SYN_CLX}
procedure LoadKeyVersions(const Key, Prefix: string);
var
Versions: TStringList;
i: Integer;
begin
with TBetterRegistry.Create do
begin
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKeyReadOnly('\SOFTWARE\Borland\Delphi') then
if OpenKeyReadOnly(Key) then
begin
try
GetKeyNames(DelphiVersions);
Versions := TStringList.Create;
try
GetKeyNames(Versions);
for i := 0 to Versions.Count - 1 do
DelphiVersions.Add(Prefix + Versions[i]);
finally
FreeAndNil(Versions);
end;
finally
CloseKey;
end;
@ -1104,6 +1115,15 @@ begin
Free;
end;
end;
end;
begin
{ returns the user settings that exist in the registry }
{$IFNDEF SYN_CLX}
// See UseUserSettings below where these strings are used
LoadKeyVersions('\SOFTWARE\Borland\Delphi', '');
LoadKeyVersions('\SOFTWARE\Borland\BDS', BDSVersionPrefix);
LoadKeyVersions('\SOFTWARE\CodeGear\BDS', BDSVersionPrefix);
{$ENDIF}
end;
@ -1119,6 +1139,9 @@ function TSynPasSyn.UseUserSettings(VersionIndex: Integer): Boolean;
function ReadDelphiSettings(settingIndex: Integer): Boolean;
function ReadDelphiSetting(settingTag: string; attri: TSynHighlighterAttributes; key: string): Boolean;
var
Version: Currency;
VersionStr: string;
function ReadDelphi2Or3(settingTag: string; attri: TSynHighlighterAttributes; name: string): Boolean;
var
@ -1136,11 +1159,39 @@ function TSynPasSyn.UseUserSettings(VersionIndex: Integer): Boolean;
'\Software\Borland\Delphi\'+settingTag+'\Editor\Highlight',key,False);
end; { ReadDelphi4OrMore }
function ReadDelphi8To2007(settingTag: string; attri: TSynHighlighterAttributes; key: string): Boolean;
begin
Result := attri.LoadFromBorlandRegistry(HKEY_CURRENT_USER,
'\Software\Borland\BDS\'+settingTag+'\Editor\Highlight',key,False);
end; { ReadDelphi8OrMore }
function ReadDelphi2009OrMore(settingTag: string; attri: TSynHighlighterAttributes; key: string): Boolean;
begin
Result := attri.LoadFromBorlandRegistry(HKEY_CURRENT_USER,
'\Software\CodeGear\BDS\'+settingTag+'\Editor\Highlight',key,False);
end; { ReadDelphi2009OrMore }
begin { ReadDelphiSetting }
try
if Pos('BDS', settingTag) = 1 then // BDS product
begin
VersionStr := Copy(settingTag, Length(BDSVersionPrefix) + 1, 999);
Version := 0;
if not TryStrToCurr(StringReplace(VersionStr, '.', DecimalSeparator, []), Version) then
begin
Result := False;
Exit;
end;
if Version >= 6 then
Result := ReadDelphi2009OrMore(VersionStr, attri, key)
else
Result := ReadDelphi8To2007(VersionStr, attri, key);
end
else begin // Borland Delphi 7 or earlier
if (settingTag[1] = '2') or (settingTag[1] = '3')
then Result := ReadDelphi2Or3(settingTag, attri, key)
else Result := ReadDelphi4OrMore(settingTag, attri, key);
end;
except Result := False; end;
end; { ReadDelphiSetting }

View File

@ -27,7 +27,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynHighlighterProgress.pas,v 1.16.2.5 2008/09/14 16:25:02 maelh Exp $
$Id: SynHighlighterProgress.pas,v 1.16.2.7 2009/09/28 17:54:20 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -224,10 +224,10 @@ const
'last-key last-of lastkey ldbname leave ' +
'library like line-count line-counter line-number ' +
'listing locked long lookup machine-class ' +
'map member memptr message ' +
'map max-button member memptr message ' +
'message-lines mouse mpe new next ' +
'next-prompt no no-attr-space no-error no-fill ' +
'no-help no-hide no-label no-labels no-lock ' +
'no-help no-hide no-label no-labels no-lobs no-lock ' +
'no-map no-message no-pause no-prefetch no-undo ' +
'no-validate no-wait not null num-aliases ' +
'num-dbs num-entries of off old ' +
@ -250,7 +250,7 @@ const
'set setuserid share share-lock shared ' +
'short show-stats skip some space ' +
'status stream stream-io string-xref system-dialog ' +
'table term terminal text text-cursor ' +
'table tab-stop term terminal text text-cursor ' +
'text-height text-seg-growth then this-procedure ' +
'time title to top-only trans ' +
'transaction trigger triggers trim true ' +
@ -259,7 +259,7 @@ const
'update use-index use-revvideo use-underline user ' +
'userid using v6frame value values ' +
'view view-as vms wait-for web-context ' +
'when where while window window-maximized ' +
'when where while widget-id window window-maximized ' +
'window-minimized window-normal with work-table workfile ' +
'write xcode xref yes _actailog ' +
'_actbilog _actbuffer _actindex _actiofile _actiotype ' +
@ -275,7 +275,7 @@ const
DefaultNonReservedKeywords: UnicodeString =
'abs absolute accelerator across add-events-procedure ' +
'add-first add-last advise alert-box allow-replication ' +
'add-first add-interval add-last advise alert-box allow-replication ' +
'ansi-only anywhere append appl-alert appl-alert-boxes ' +
'application as-cursor ask-overwrite attachment auto-endkey ' +
'auto-end-key auto-go auto-indent auto-resize auto-zap ' +
@ -309,7 +309,7 @@ const
'default-extension defined delete-current-row delete-selected-row delete-selected-rows ' +
'deselect-focused-row deselect-rows deselect-selected-row design-mode dialog-box ' +
'dialog-help dir disabled display-message display-type ' +
'drag-enabled drop-down drop-down-list dump dynamic ' +
'drag-enabled drop-down drop-down-list dump dynamic dynamic-function ' +
'echo edge edge-chars edge-pixels edit-can-undo ' +
'editor edit-undo empty end-key entered ' +
'eq error error-col error-column error-row ' +
@ -336,7 +336,7 @@ const
'image image-down image-insensitive image-size image-size-chars ' +
'image-size-pixels image-up immediate-display indexed-reposition index-hint ' +
'info information init initial initial-dir ' +
'initial-filter initiate inner inner-chars inner-lines ' +
'initial-filter initiate inner inner-chars inner-lines input-value ' +
'insert-backtab insert-file insert-row insert-string insert-tab ' +
'internal-entries is-lead-byte is-row-selected is-selected item ' +
'items-per-row join-by-sqldb keep-frame-z-order keep-messages keep-tab-order ' +
@ -345,7 +345,7 @@ const
'label-pfcolor labels languages large large-to-small ' +
'last-child last-proc last-procedure last-server last-tab-item ' +
'lc le leading left-aligned left-trim ' +
'length line list-events list-items list-query-attrs ' +
'length line list-events list-items list-item-pairs list-query-attrs ' +
'list-set-attrs list-widgets load load-control loadcontrols ' +
'load-icon load-image load-image-down load-image-insensitive load-image-up ' +
'load-mouse-pointer load-small-icon log-id lookahead lower ' +
@ -377,11 +377,11 @@ const
'orientation os-drives os-error ' +
'os-getenv outer outer-join override owner ' +
'paged page-size page-width parent partial-key ' +
'pascal pathname pfc pfcolor pinnable ' +
'pascal password-field pathname pfc pfcolor pinnable ' +
'pixels-per-col pixels-per-column pixels-per-row popup-menu popup-only ' +
'position precision preselect prev prev-column ' +
'prev-sibling prev-tab-item primary printer-control-handle printer-name ' +
'printer-port printer-setup private-data prn procedure ' +
'printer-port printer-setup private private-data prn procedure ' +
'progress-source proxy put-double put-float put-long ' +
'put-short put-string put-unsigned-short query-off-end question ' +
'radio-buttons radio-set random raw-transfer read-file ' +
@ -476,9 +476,9 @@ const
'white window-close window-resized window-restored';
DefaultDataTypes: UnicodeString =
'char character com-handle date dec ' +
'char character com-handle component-handle date datetime datetime-tz dec ' +
'decimal double float handle int ' +
'integer log logical raw rowid ' +
'integer int64 log logical longchar raw rowid ' +
'widget widget-handle';
implementation

View File

@ -392,12 +392,8 @@ begin
begin
while FFontsInfo.Count > 0 do
begin
if (1 = PheSharedFontsInfo(FFontsInfo[FFontsInfo.Count - 1])^.RefCount) then begin
ASSERT(1 = PheSharedFontsInfo(FFontsInfo[FFontsInfo.Count - 1])^.RefCount);
ReleaseFontsInfo(PheSharedFontsInfo(FFontsInfo[FFontsInfo.Count - 1]));
end else begin
//ASSERT;
break;
end;
end;
FFontsInfo.Free;
end;

View File

@ -26,7 +26,7 @@ replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynUnicode.pas,v 1.1.2.43 2008/10/03 18:50:12 maelh Exp $
$Id: SynUnicode.pas,v 1.1.2.46 2009/09/28 17:54:20 maelh Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
@ -855,16 +855,12 @@ procedure TUnicodeStrings.LoadFromFile(const FileName: TFileName);
var
Stream: TStream;
begin
try
Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone);
try
LoadFromStream(Stream);
finally
Stream.Free;
end;
except
RaiseLastOSError;
end;
end;
procedure TUnicodeStrings.LoadFromStream(Stream: TStream);
@ -2571,7 +2567,7 @@ var
ErrorMessage: UnicodeString;
{$ENDIF}
begin
if Mode = fmCreate then
if ((Mode and fmCreate) = fmCreate) then
begin
inherited Create(WideFileCreate(FileName, Rights));
if Handle < 0 then
@ -3150,7 +3146,7 @@ begin
UnicodeStrings.Text := UTF8ToUnicodeString(UTF8Str);
{$ELSE}
UnicodeStrings.Text := UTF8Decode(UTF8Str);
UnicodeStrings.SaveUnicode := True;
UnicodeStrings.SaveFormat := sfUTF8;
{$ENDIF}
end;
seUTF16LE:
@ -3159,7 +3155,7 @@ begin
Stream.ReadBuffer(WideStr[1], Size);
UnicodeStrings.Text := WideStr;
{$IFNDEF UNICODE}
UnicodeStrings.SaveUnicode := True;
UnicodeStrings.SaveFormat := sfUTF16LSB;
{$ENDIF}
end;
seUTF16BE:
@ -3169,7 +3165,7 @@ begin
StrSwapByteOrder(PWideChar(WideStr));
UnicodeStrings.Text := WideStr;
{$IFNDEF UNICODE}
UnicodeStrings.SaveUnicode := True;
UnicodeStrings.SaveFormat := sfUTF16MSB;
{$ENDIF}
end;
seAnsi:
@ -3178,7 +3174,7 @@ begin
Stream.ReadBuffer(AnsiStr[1], Size);
UnicodeStrings.Text := UnicodeString(AnsiStr);
{$IFNDEF UNICODE}
UnicodeStrings.SaveUnicode := False;
UnicodeStrings.SaveFormat := sfAnsi;
{$ENDIF}
end;
end;