Skip to content

Commit

Permalink
Fix: Version info and removed some more Hints & Warnings.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.xananews.techtips.com.br/trunk@329 b371b8be-f639-0410-b043-d2e712c17c34
  • Loading branch information
pzijlstra committed Sep 30, 2011
1 parent 5e64320 commit 7f71531
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 143 deletions.
82 changes: 48 additions & 34 deletions components/LowLevel/Source/XnClasses.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ TXnThread = class(TThread)
{$endif}
end;

// MessageString = type RawByteString;

TAnsiStrings = class(TPersistent)
private
FDefined: TStringsDefined;
Expand Down Expand Up @@ -126,12 +124,12 @@ TAnsiStringItem = record
end;

PAnsiStringItemList = ^TAnsiStringItemList;
TAnsiStringItemList = array[0..MaxListSize] of TAnsiStringItem;
TAnsiStringItemList = array of TAnsiStringItem;
TAnsiStringListSortCompare = function(List: TAnsiStringList; Index1, Index2: Integer): Integer;

TAnsiStringList = class(TAnsiStrings)
private
FList: PAnsiStringItemList;
FList: TAnsiStringItemList;
FCount: Integer;
FCapacity: Integer;
FSorted: Boolean;
Expand Down Expand Up @@ -930,7 +928,6 @@ destructor TAnsiStringList.Destroy;
end;

inherited Destroy;
if FCount <> 0 then Finalize(FList^[0], FCount);
FCount := 0;
SetCapacity(0);
end;
Expand Down Expand Up @@ -984,25 +981,38 @@ procedure TAnsiStringList.Clear;
end;
end;

Finalize(FList^[0], FCount);
FCount := 0;
SetCapacity(0);
Changed;
end;
end;

procedure TAnsiStringList.Delete(Index: Integer);
var
Obj: TObject;
begin
if (Index < 0) or (Index >= FCount) then Error(@SListIndexError, Index);
Changing;
// If this list owns its objects then free the associated TObject with this index
if OwnsObjects then
GetObject(Index).Free;
Finalize(FList^[Index]);
Obj := FList[Index].FObject
else
Obj := nil;

// Direct memory writing to managed array follows
// see http://dn.embarcadero.com/article/33423
// Explicitly finalize the element we about to stomp on with move
Finalize(FList[Index]);
Dec(FCount);
if Index < FCount then
System.Move(FList^[Index + 1], FList^[Index],
begin
System.Move(FList[Index + 1], FList[Index],
(FCount - Index) * SizeOf(TAnsiStringItem));
// Make sure there is no danglng pointer in the last (now unused) element
PPointer(@FList[FCount])^ := nil;
end;
if Obj <> nil then
Obj.Free;
Changed;
end;

Expand All @@ -1017,17 +1027,17 @@ procedure TAnsiStringList.Exchange(Index1, Index2: Integer);

procedure TAnsiStringList.ExchangeItems(Index1, Index2: Integer);
var
Temp: Integer;
Temp: Pointer;
Item1, Item2: PAnsiStringItem;
begin
Item1 := @FList^[Index1];
Item2 := @FList^[Index2];
Temp := Integer(Item1^.FAnsiString);
Integer(Item1^.FAnsiString) := Integer(Item2^.FAnsiString);
Integer(Item2^.FAnsiString) := Temp;
Temp := Integer(Item1^.FObject);
Integer(Item1^.FObject) := Integer(Item2^.FObject);
Integer(Item2^.FObject) := Temp;
Item1 := @FList[Index1];
Item2 := @FList[Index2];
Temp := Pointer(Item1^.FAnsiString);
Pointer(Item1^.FAnsiString) := Pointer(Item2^.FAnsiString);
Pointer(Item2^.FAnsiString) := Temp;
Temp := Item1^.FObject;
Item1^.FObject := Item2^.FObject;
Item2^.FObject := Temp;
end;

function TAnsiStringList.Find(const S: AnsiString; var Index: Integer): Boolean;
Expand All @@ -1040,7 +1050,7 @@ function TAnsiStringList.Find(const S: AnsiString; var Index: Integer): Boolean;
while L <= H do
begin
I := (L + H) shr 1;
C := CompareAnsiStrings(FList^[I].FAnsiString, S);
C := CompareAnsiStrings(FList[I].FAnsiString, S);
if C < 0 then L := I + 1 else
begin
H := I - 1;
Expand All @@ -1056,8 +1066,9 @@ function TAnsiStringList.Find(const S: AnsiString; var Index: Integer): Boolean;

function TAnsiStringList.Get(Index: Integer): AnsiString;
begin
if (Index < 0) or (Index >= FCount) then Error(@SListIndexError, Index);
Result := FList^[Index].FAnsiString;
if Cardinal(Index) >= Cardinal(FCount) then
Error(@SListIndexError, Index);
Result := FList[Index].FAnsiString;
end;

function TAnsiStringList.GetCapacity: Integer;
Expand All @@ -1072,8 +1083,9 @@ function TAnsiStringList.GetCount: Integer;

function TAnsiStringList.GetObject(Index: Integer): TObject;
begin
if (Index < 0) or (Index >= FCount) then Error(@SListIndexError, Index);
Result := FList^[Index].FObject;
if Cardinal(Index) >= Cardinal(FCount) then
Error(@SListIndexError, Index);
Result := FList[Index].FObject;
end;

procedure TAnsiStringList.Grow;
Expand Down Expand Up @@ -1110,9 +1122,9 @@ procedure TAnsiStringList.InsertItem(Index: Integer; const S: AnsiString; AObjec
Changing;
if FCount = FCapacity then Grow;
if Index < FCount then
System.Move(FList^[Index], FList^[Index + 1],
System.Move(FList[Index], FList[Index + 1],
(FCount - Index) * SizeOf(TAnsiStringItem));
with FList^[Index] do
with FList[Index] do
begin
Pointer(FAnsiString) := nil;
FObject := AObject;
Expand All @@ -1125,17 +1137,19 @@ procedure TAnsiStringList.InsertItem(Index: Integer; const S: AnsiString; AObjec
procedure TAnsiStringList.Put(Index: Integer; const S: AnsiString);
begin
if Sorted then Error(@SSortedListError, 0);
if (Index < 0) or (Index >= FCount) then Error(@SListIndexError, Index);
if Cardinal(Index) >= Cardinal(FCount) then
Error(@SListIndexError, Index);
Changing;
FList^[Index].FAnsiString := S;
FList[Index].FAnsiString := S;
Changed;
end;

procedure TAnsiStringList.PutObject(Index: Integer; AObject: TObject);
begin
if (Index < 0) or (Index >= FCount) then Error(@SListIndexError, Index);
if Cardinal(Index) >= Cardinal(FCount) then
Error(@SListIndexError, Index);
Changing;
FList^[Index].FObject := AObject;
FList[Index].FObject := AObject;
Changed;
end;

Expand Down Expand Up @@ -1169,11 +1183,11 @@ procedure TAnsiStringList.QuickSort(L, R: Integer; SCompare: TAnsiStringListSort

procedure TAnsiStringList.SetCapacity(NewCapacity: Integer);
begin
if (NewCapacity < FCount) or (NewCapacity > MaxListSize) then
if NewCapacity < FCount then
Error(@SListCapacityError, NewCapacity);
if NewCapacity <> FCapacity then
begin
ReallocMem(FList, NewCapacity * SizeOf(TAnsiStringItem));
SetLength(FList, NewCapacity);
FCapacity := NewCapacity;
end;
end;
Expand All @@ -1194,8 +1208,8 @@ procedure TAnsiStringList.SetUpdateState(Updating: Boolean);

function AnsiStringListCompareAnsiStrings(List: TAnsiStringList; Index1, Index2: Integer): Integer;
begin
Result := List.CompareAnsiStrings(List.FList^[Index1].FAnsiString,
List.FList^[Index2].FAnsiString);
Result := List.CompareAnsiStrings(List.FList[Index1].FAnsiString,
List.FList[Index2].FAnsiString);
end;

procedure TAnsiStringList.Sort;
Expand Down Expand Up @@ -1223,7 +1237,7 @@ function TAnsiStringList.CompareAnsiStrings(const S1, S2: AnsiString): Integer;

constructor TAnsiStringList.Create;
begin
inherited;
inherited Create;
end;

constructor TAnsiStringList.Create(OwnsObjects: Boolean);
Expand Down
2 changes: 1 addition & 1 deletion components/MiscUnits/Source/cmpExSplitter.pas
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
interface

uses
Windows, Messages, SysUtils, Forms, Classes, Controls, ExtCtrls, Graphics;
Windows, Messages, SysUtils, Forms, Classes, Controls, ExtCtrls, Graphics, Types;

type
TExSplitterArrow = (arLeft, arRight, arUp, arDown);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
interface

uses
Windows, Messages, Classes, SysUtils, Controls, Graphics, Forms,
Windows, Messages, Classes, SysUtils, Controls, Graphics, Forms, Types,
cmpMessageDisplay, cmpNewsRichEdit, Dialogs, SyncObjs, ComCtrls, StrUtils, XnClasses;

type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@
<Icon_MainIcon>VirtualTreesDXE2_Icon.ico</Icon_MainIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM>
<DCC_UNIT_PLATFORM>false</DCC_UNIT_PLATFORM>
<DCC_SYMBOL_DEPRECATED>false</DCC_SYMBOL_DEPRECATED>
<Icon_MainIcon>VirtualTreesDXE2_Icon.ico</Icon_MainIcon>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<Version>7.0</Version>
Expand Down Expand Up @@ -152,6 +153,12 @@
<Source>
<Source Name="MainSource">VirtualTreesDXE2.dpk</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k160.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp160.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win64">False</Platform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@
<Icon_MainIcon>VirtualTreesDXE2D_Icon.ico</Icon_MainIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_SYMBOL_DEPRECATED>false</DCC_SYMBOL_DEPRECATED>
<Icon_MainIcon>VirtualTreesDXE2D_Icon.ico</Icon_MainIcon>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>VirtualTreesDXE2;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<Version>7.0</Version>
Expand Down Expand Up @@ -150,6 +149,12 @@
<Source>
<Source Name="MainSource">VirtualTreesDXE2D.dpk</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k160.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp160.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win64">False</Platform>
Expand Down
6 changes: 3 additions & 3 deletions source/MainForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ToolWin, ActnList,
Dialogs, ToolWin, ActnList, Types,
cmpPersistentPosition, cmpStandardSystemMenu, ImgList, StdActns,
cmpNTAboutBox, ComCtrls, ExtCtrls, VirtualTrees, ConTnrs, unitNNTPServices,
Menus, AppEvnts, ExtDlgs, cmpMessageScrollBox, cmpExSplitter,
Expand Down Expand Up @@ -658,7 +658,7 @@ TfmMain = class(TForm)
procedure ApplicationEvents1Activate(Sender: TObject);
procedure ApplicationEvents1Deactivate(Sender: TObject);
procedure ApplicationEvents1Exception(Sender: TObject; E: Exception);
function ApplicationEvents1Help(Command: Word; Data: Integer; var CallHelp: Boolean): Boolean;
function ApplicationEvents1Help(Command: Word; Data: NativeInt; var CallHelp: Boolean): Boolean;
procedure ApplicationEvents1Hint(Sender: TObject);
procedure FindDialog1Close(Sender: TObject);
procedure FindDialog1Find(Sender: TObject);
Expand Down Expand Up @@ -3008,7 +3008,7 @@ procedure TfmMain.ApplicationEvents1Exception(Sender: TObject; E: Exception);
Application.ShowException(E);
end;

function TfmMain.ApplicationEvents1Help(Command: Word; Data: Integer;
function TfmMain.ApplicationEvents1Help(Command: Word; Data: NativeInt;
var CallHelp: Boolean): Boolean;
begin
// Work round bug in help system |
Expand Down
1 change: 0 additions & 1 deletion source/PropertyBaseForm.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ object fmPropertyBase: TfmPropertyBase
Height = 323
Align = alLeft
Header.AutoSizeIndex = 0
Header.DefaultHeight = 17
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Expand Down
2 changes: 1 addition & 1 deletion source/PropertyBaseForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, VirtualTrees, PropertyPageForm, ConTnrs, StdCtrls,
Dialogs, ExtCtrls, VirtualTrees, PropertyPageForm, Contnrs, StdCtrls, Types,
cmpPersistentPosition, Menus, unitExSettings;

const
Expand Down
3 changes: 3 additions & 0 deletions source/PropertyPageShortcutsForm.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ inherited fmPropertyPageShortcuts: TfmPropertyPageShortcuts
TextHeight = 13
inherited Panel1: TPanel
Width = 414
ExplicitWidth = 414
inherited Bevel1: TBevel
Width = 414
ExplicitWidth = 414
end
inherited stSectionDetails: TLabel
Width = 402
Caption =
'Use this section to configure the keyboard shortcuts that XanaNe' +
'ws uses. Note that items in red have been modified from the ori' +
'ginal default settings.'
ExplicitWidth = 402
end
end
object vstActions: TVirtualStringTree
Expand Down
6 changes: 5 additions & 1 deletion source/PropertyPageShortcutsForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, PropertyPageForm, StdCtrls, Menus, VirtualTrees, ExtCtrls, ConTnrs, ActnList;
Dialogs, PropertyPageForm, StdCtrls, Menus, VirtualTrees, ExtCtrls, ConTnrs, ActnList
{$if CompilerVersion >= 23}
, System.UITypes
{$ifend}
;

type
TActionCategories = class;
Expand Down
Loading

0 comments on commit 7f71531

Please sign in to comment.