mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Lazarus 2.3 compatibility
This commit is contained in:
parent
2aeda2741c
commit
f058e835f8
9 changed files with 45 additions and 39 deletions
|
|
@ -57,6 +57,8 @@ type
|
|||
{ TStringListEx }
|
||||
|
||||
TStringListEx = class(TStringList)
|
||||
protected
|
||||
function DoCompareText(const S1, S2: String): PtrInt; override;
|
||||
public
|
||||
function IndexOfValue(const Value: String): Integer;
|
||||
procedure LoadFromFile(const FileName: String); override;
|
||||
|
|
@ -79,7 +81,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
DCOSUtils;
|
||||
DCOSUtils, LazUTF8;
|
||||
|
||||
{ TFileStreamEx }
|
||||
|
||||
|
|
@ -209,6 +211,14 @@ end;
|
|||
|
||||
{ TStringListEx }
|
||||
|
||||
function TStringListEx.DoCompareText(const S1, S2: String): PtrInt;
|
||||
begin
|
||||
if CaseSensitive then
|
||||
Result:= UTF8CompareStr(S1, S2)
|
||||
else
|
||||
Result:= UTF8CompareText(S1, S2);
|
||||
end;
|
||||
|
||||
function TStringListEx.IndexOfValue(const Value: String): Integer;
|
||||
var
|
||||
iStart: LongInt;
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
LazUTF8Classes, Laz2_XMLRead;
|
||||
Laz2_XMLRead;
|
||||
|
||||
//==== TSynUniSyn ============================================================
|
||||
constructor TSynUniSyn.Create(AOwner: TComponent);
|
||||
|
|
@ -716,7 +716,7 @@ end;
|
|||
procedure TSynUniSyn.LoadFromFile(FileName: string);
|
||||
begin
|
||||
FFileName:= FileName;
|
||||
LoadFromStream(TFileStreamUTF8.Create(FileName, fmOpenRead or fmShareDenyNone));
|
||||
LoadFromStream(TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone));
|
||||
end;
|
||||
|
||||
procedure TSynUniSyn.SaveToStream(Stream: TStream; Rule: TSynRule);
|
||||
|
|
@ -1149,11 +1149,11 @@ end;
|
|||
procedure TSynUniSyn.LoadHglFromFile(FileName: string);
|
||||
//: Load Highlighter'a from file
|
||||
var
|
||||
F: TFileStreamUTF8;
|
||||
F: TFileStream;
|
||||
begin
|
||||
if not FileExists(FileName) then
|
||||
raise Exception.Create(ClassName + '.LoadHglFromFile - "'+FileName+'" does not exists.');
|
||||
F := TFileStreamUTF8.Create(FileName, fmOpenRead or fmShareDenyWrite);
|
||||
F := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
|
||||
try
|
||||
LoadHglFromStream( F );
|
||||
finally
|
||||
|
|
@ -1164,11 +1164,11 @@ end;
|
|||
procedure TSynUniSyn.SaveHglToFile(FileName: string);
|
||||
//: Save Highlighter to file
|
||||
var
|
||||
F: TFileStreamUTF8;
|
||||
F: TFileStream;
|
||||
begin
|
||||
if FileName = '' then
|
||||
raise exception.Create(ClassName + '.SaveHglToFile - FileName is empty');
|
||||
F := TFileStreamUTF8.Create(FileName, fmCreate);
|
||||
F := TFileStream.Create(FileName, fmCreate);
|
||||
try
|
||||
SaveHglToStream( F );
|
||||
finally
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ unit DCJclAlternative;
|
|||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fgl, Windows, LazUTF8Classes;
|
||||
Classes, SysUtils, fgl, Windows;
|
||||
|
||||
// JclBase.pas -----------------------------------------------------------------
|
||||
type
|
||||
|
|
@ -152,10 +152,6 @@ type
|
|||
property Strings[Index: Integer]: WideString read Get write Put; default;
|
||||
end;
|
||||
|
||||
// Classes.pas -----------------------------------------------------------------
|
||||
type
|
||||
TFileStream = TFileStreamUTF8;
|
||||
|
||||
// SysUtils.pas -----------------------------------------------------------------
|
||||
function FileExists(const FileName: String): Boolean; inline;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,20 +52,20 @@ type
|
|||
implementation
|
||||
|
||||
uses
|
||||
ActiveX, JwaWinError, LazUTF8Classes;
|
||||
ActiveX, JwaWinError;
|
||||
|
||||
{ TSfxSevenzipOutStream }
|
||||
|
||||
constructor TSfxSevenzipOutStream.Create(AStream: TStream; const ASfxModule: String);
|
||||
var
|
||||
SfxModule: TFileStreamUTF8;
|
||||
SfxModule: TFileStream;
|
||||
begin
|
||||
inherited Create;
|
||||
|
||||
FStream := AStream;
|
||||
FSfxModule := ASfxModule;
|
||||
|
||||
SfxModule:= TFileStreamUTF8.Create(FSfxModule, fmOpenRead or fmShareDenyNone);
|
||||
SfxModule:= TFileStream.Create(FSfxModule, fmOpenRead or fmShareDenyNone);
|
||||
try
|
||||
FStream.Seek(0, soBeginning);
|
||||
FSfxLength := FStream.CopyFrom(SfxModule, SfxModule.Size);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ implementation
|
|||
|
||||
uses
|
||||
Graphics, SynEditTypes, SynUniClasses, FileUtil, uHighlighterProcs, DCXmlConfig,
|
||||
LCLType, DCJsonConfig, uGlobsPaths, LazUTF8Classes, DCOSUtils, DCStrUtils, uLng,
|
||||
LCLType, DCJsonConfig, uGlobsPaths, DCClassesUtf8, DCOSUtils, DCStrUtils, uLng,
|
||||
uGlobs, uSysFolders, SynUniRules;
|
||||
|
||||
const
|
||||
|
|
@ -414,10 +414,10 @@ var
|
|||
I, Index: Integer;
|
||||
AList: TStringList;
|
||||
AFileName: String = '';
|
||||
ACache: TStringListUtf8;
|
||||
ACache: TStringListEx;
|
||||
HighLighter: TSynCustomHighlighter;
|
||||
begin
|
||||
ACache:= TStringListUtf8.Create;
|
||||
ACache:= TStringListEx.Create;
|
||||
ACache.CaseSensitive:= FileNameCaseSensitive;
|
||||
if not gUseConfigInProgramDir then begin
|
||||
AFileName:= IncludeTrailingBackslash(GetAppDataDir) + 'highlighters' + ';';
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ implementation
|
|||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
fOptions, LazUTF8Classes, uDebug, uFindEx, uGlobs, uGlobsPaths, uLng;
|
||||
fOptions, DCClassesUtf8, uDebug, uFindEx, uGlobs, uGlobsPaths, uLng;
|
||||
|
||||
{ TfrmOptionsLanguage }
|
||||
|
||||
|
|
@ -60,9 +60,9 @@ var
|
|||
iIndex: Integer;
|
||||
fr: TSearchRecEx;
|
||||
sLangName: String;
|
||||
LanguageFileList: TStringListUtf8;
|
||||
LanguageFileList: TStringListEx;
|
||||
begin
|
||||
LanguageFileList:= TStringListUtf8.Create;
|
||||
LanguageFileList:= TStringListEx.Create;
|
||||
LanguageFileList.Sorted:= True;
|
||||
LanguageFileList.Duplicates:= dupAccept;
|
||||
try
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
ExtCtrls, Buttons, ComCtrls, Grids, Menus, ActnList, EditBtn, LazUTF8Classes,
|
||||
ExtCtrls, Buttons, ComCtrls, Grids, Menus, ActnList, EditBtn, DCClassesUtf8,
|
||||
uFileView, uFileSource, uFileSourceCopyOperation, uFile, uFileSourceOperation,
|
||||
uFileSourceOperationMessageBoxesUI, uFormCommands, uHotkeyManager, uClassesEx,
|
||||
uFileSourceDeleteOperation, KASProgressBar;
|
||||
|
|
@ -153,13 +153,13 @@ type
|
|||
{ private declarations }
|
||||
FCancel: Boolean;
|
||||
FScanning: Boolean;
|
||||
FFoundItems: TStringListUtf8;
|
||||
FVisibleItems: TStringListUtf8;
|
||||
FFoundItems: TStringListEx;
|
||||
FVisibleItems: TStringListEx;
|
||||
FSortIndex: Integer;
|
||||
FSortDesc: Boolean;
|
||||
FNtfsShift: Boolean;
|
||||
FFileExists: TSyncRecState;
|
||||
FSelectedItems: TStringListUtf8;
|
||||
FSelectedItems: TStringListEx;
|
||||
FFileSourceL, FFileSourceR: IFileSource;
|
||||
FCmpFileSourceL, FCmpFileSourceR: IFileSource;
|
||||
FCmpFilePathL, FCmpFilePathR: string;
|
||||
|
|
@ -234,7 +234,7 @@ implementation
|
|||
|
||||
uses
|
||||
fMain, uDebug, fDiffer, fSyncDirsPerformDlg, uGlobs, LCLType, LazUTF8, LazFileUtils,
|
||||
DCClassesUtf8, uFileSystemFileSource, uFileSourceOperationOptions, DCDateTimeUtils,
|
||||
uFileSystemFileSource, uFileSourceOperationOptions, DCDateTimeUtils,
|
||||
uDCUtils, uFileSourceUtil, uFileSourceOperationTypes, uShowForm, uAdministrator,
|
||||
uOSUtils, uLng, uMasks, Math, uClipboard, IntegerList, fMaskInputDlg, uSearchTemplate,
|
||||
StrUtils, uTypes, uFileSystemDeleteOperation;
|
||||
|
|
@ -1164,7 +1164,7 @@ begin
|
|||
if Assigned(FVisibleItems) then
|
||||
FVisibleItems.Clear
|
||||
else begin
|
||||
FVisibleItems := TStringListUtf8.Create;
|
||||
FVisibleItems := TStringListEx.Create;
|
||||
FVisibleItems.CaseSensitive := FileNameCaseSensitive;
|
||||
end;
|
||||
{ init filter }
|
||||
|
|
@ -1297,23 +1297,23 @@ var
|
|||
var
|
||||
i, j, tot: Integer;
|
||||
it: TStringList;
|
||||
dirsLeft, dirsRight: TStringListUtf8;
|
||||
dirsLeft, dirsRight: TStringListEx;
|
||||
d: string;
|
||||
begin
|
||||
i := FFoundItems.IndexOf(dir);
|
||||
if i < 0 then
|
||||
begin
|
||||
it := TStringListUtf8.Create;
|
||||
it := TStringListEx.Create;
|
||||
it.CaseSensitive := FileNameCaseSensitive;
|
||||
it.Sorted := True;
|
||||
FFoundItems.AddObject(dir, it);
|
||||
end else
|
||||
it := TStringList(FFoundItems.Objects[i]);
|
||||
if dir <> '' then dir := AppendPathDelim(dir);
|
||||
dirsLeft := TStringListUtf8.Create;
|
||||
dirsLeft := TStringListEx.Create;
|
||||
dirsLeft.CaseSensitive := FileNameCaseSensitive;
|
||||
dirsLeft.Sorted := True;
|
||||
dirsRight := TStringListUtf8.Create;
|
||||
dirsRight := TStringListEx.Create;
|
||||
dirsRight.CaseSensitive := FileNameCaseSensitive;
|
||||
dirsRight.Sorted := True;
|
||||
try
|
||||
|
|
@ -1880,7 +1880,7 @@ var
|
|||
AFiles: TFiles;
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FFoundItems := TStringListUtf8.Create;
|
||||
FFoundItems := TStringListEx.Create;
|
||||
FFoundItems.CaseSensitive := FileNameCaseSensitive;
|
||||
FFoundItems.Sorted := True;
|
||||
FFileSourceL := FileView1.FileSource;
|
||||
|
|
@ -1900,7 +1900,7 @@ begin
|
|||
FSortDesc := False;
|
||||
MainDrawGrid.RowCount := 0;
|
||||
// ---------------------------------------------------------------------------
|
||||
FSelectedItems := TStringListUtf8.Create;
|
||||
FSelectedItems := TStringListEx.Create;
|
||||
FSelectedItems.Sorted := True;
|
||||
FSelectedItems.Duplicates := dupIgnore;
|
||||
FSelectedItems.CaseSensitive := FileNameCaseSensitive;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ unit uWCXmodule;
|
|||
interface
|
||||
|
||||
uses
|
||||
LCLType, Classes, Dialogs, LazUTF8Classes, dynlibs, SysUtils, uExtension,
|
||||
LCLType, Classes, Dialogs, DCClassesUtf8, dynlibs, SysUtils, uExtension,
|
||||
uWCXprototypes, WcxPlugin, Extension, DCBasicTypes, DCXmlConfig, uClassesEx;
|
||||
|
||||
Type
|
||||
|
|
@ -153,7 +153,7 @@ Type
|
|||
|
||||
TWCXModuleList = class(TStringList)
|
||||
private
|
||||
FModuleList: TStringListUTF8;
|
||||
FModuleList: TStringListEx;
|
||||
private
|
||||
function GetAEnabled(Index: Integer): Boolean;
|
||||
function GetAExt(Index: Integer): String;
|
||||
|
|
@ -672,7 +672,7 @@ end;
|
|||
|
||||
constructor TWCXModuleList.Create;
|
||||
begin
|
||||
FModuleList:= TStringListUTF8.Create;
|
||||
FModuleList:= TStringListEx.Create;
|
||||
FModuleList.Sorted:= True;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ unit uWFXmodule;
|
|||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, WfxPlugin, uWFXprototypes, LazUTF8Classes,
|
||||
SysUtils, Classes, WfxPlugin, uWFXprototypes,
|
||||
dynlibs, DCClassesUtf8, Extension, DCBasicTypes, DCXmlConfig,
|
||||
uWdxPrototypes, uWdxModule, uFileSource;
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ type
|
|||
|
||||
TWFXModuleList = class(TStringList)
|
||||
private
|
||||
FModuleList: TStringListUTF8;
|
||||
FModuleList: TStringListEx;
|
||||
private
|
||||
function GetAEnabled(Index: Integer): Boolean;
|
||||
function GetAFileName(Index: Integer): String;
|
||||
|
|
@ -931,7 +931,7 @@ end;
|
|||
|
||||
constructor TWFXModuleList.Create;
|
||||
begin
|
||||
FModuleList:= TStringListUTF8.Create;
|
||||
FModuleList:= TStringListEx.Create;
|
||||
FModuleList.Sorted:= True;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue