You've already forked lazarus-ccr
fpspreadsheet: Replace usage of AVL_Tree by avglvltree to avoid conflicts of fpc and laz AVL_Tree versions in Laz trunk after r54524
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5831 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -5,7 +5,7 @@ unit fpsclasses;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, AVL_Tree, //avglvltree,
|
||||
Classes, SysUtils, avglvltree,
|
||||
fpstypes;
|
||||
|
||||
type
|
||||
@@ -22,7 +22,7 @@ type
|
||||
TsRowColEnumerator = class
|
||||
private
|
||||
protected
|
||||
FCurrentNode: TAVLTreeNode;
|
||||
FCurrentNode: TAvgLvlTreeNode;
|
||||
FTree: TsRowColAVLTree;
|
||||
FStartRow, FEndRow, FStartCol, FEndCol: LongInt;
|
||||
FDone: Boolean;
|
||||
@@ -41,7 +41,7 @@ type
|
||||
end;
|
||||
|
||||
{ TsRowColAVLTree }
|
||||
TsRowColAVLTree = class(TAVLTree)
|
||||
TsRowColAVLTree = class(TAvgLvlTree)
|
||||
private
|
||||
FOwnsData: Boolean;
|
||||
protected
|
||||
@@ -52,12 +52,12 @@ type
|
||||
destructor Destroy; override;
|
||||
function Add(ARow, ACol: Cardinal): PsRowCol; overload;
|
||||
procedure Clear;
|
||||
procedure Delete(ANode: TAVLTreeNode); overload;
|
||||
procedure Delete(ANode: TAvgLvlTreeNode); overload;
|
||||
procedure Delete(ARow, ACol: Cardinal); overload;
|
||||
procedure DeleteRowOrCol(AIndex: Cardinal; IsRow: Boolean); virtual;
|
||||
procedure Exchange(ARow1, ACol1, ARow2, ACol2: Cardinal); virtual;
|
||||
function FindByRowCol(ARow, ACol: Cardinal): PsRowCol; overload;
|
||||
function GetData(ANode: TAVLTreeNode): PsRowCol;
|
||||
function GetData(ANode: TAvgLvlTreeNode): PsRowCol;
|
||||
function GetFirst: PsRowCol;
|
||||
function GetLast: PsRowCol;
|
||||
procedure InsertRowOrCol(AIndex: Cardinal; IsRow: Boolean);
|
||||
@@ -232,7 +232,7 @@ end;
|
||||
constructor TsRowColEnumerator.Create(ATree: TsRowColAVLTree;
|
||||
AStartRow, AStartCol, AEndRow, AEndCol: LongInt; AReverse: Boolean);
|
||||
var
|
||||
node: TAVLTreeNode;
|
||||
node: TAvgLvlTreeNode;
|
||||
begin
|
||||
FTree := ATree;
|
||||
FReverse := AReverse;
|
||||
@@ -420,7 +420,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsRowColAVLTree.Clear;
|
||||
var
|
||||
node, nextnode: TAVLTreeNode;
|
||||
node, nextnode: TAvgLvlTreeNode;
|
||||
begin
|
||||
node := FindLowest;
|
||||
while node <> nil do begin
|
||||
@@ -434,7 +434,7 @@ end;
|
||||
Removes the specified node from the tree. If the tree has been created with
|
||||
AOwnsData = true then the data record is destroyed as well
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsRowColAVLTree.Delete(ANode: TAVLTreeNode);
|
||||
procedure TsRowColAVLTree.Delete(ANode: TAvgLvlTreeNode);
|
||||
begin
|
||||
if FOwnsData and Assigned(ANode) then
|
||||
DisposeData(PsRowCol(ANode.Data));
|
||||
@@ -443,7 +443,7 @@ end;
|
||||
|
||||
procedure TsRowColAVLTree.Delete(ARow, ACol: Cardinal);
|
||||
var
|
||||
node: TAVLTreeNode;
|
||||
node: TAvgLvlTreeNode;
|
||||
cell: TCell;
|
||||
begin
|
||||
cell.Row := ARow;
|
||||
@@ -463,7 +463,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsRowColAVLTree.DeleteRowOrCol(AIndex: Cardinal; IsRow: Boolean);
|
||||
var
|
||||
node, nextnode: TAVLTreeNode;
|
||||
node, nextnode: TAvgLvlTreeNode;
|
||||
item: PsRowCol;
|
||||
begin
|
||||
node := FindLowest;
|
||||
@@ -543,7 +543,7 @@ end;
|
||||
function TsRowColAVLTree.FindByRowCol(ARow, ACol: Cardinal): PsRowCol;
|
||||
var
|
||||
data: TsRowCol;
|
||||
node: TAVLTreeNode;
|
||||
node: TAvgLvlTreeNode;
|
||||
begin
|
||||
Result := nil;
|
||||
if (Count = 0) then
|
||||
@@ -559,7 +559,7 @@ end;
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Extracts the pointer to the data record from a tree node
|
||||
-------------------------------------------------------------------------------}
|
||||
function TsRowColAVLTree.GetData(ANode: TAVLTreeNode): PsRowCol;
|
||||
function TsRowColAVLTree.GetData(ANode: TAvgLvlTreeNode): PsRowCol;
|
||||
begin
|
||||
if ANode <> nil then
|
||||
Result := PsRowCol(ANode.Data)
|
||||
@@ -591,7 +591,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsRowColAVLTree.InsertRowOrCol(AIndex: Cardinal; IsRow: Boolean);
|
||||
var
|
||||
node: TAVLTreeNode;
|
||||
node: TAvgLvlTreeNode;
|
||||
item: PsRowCol;
|
||||
begin
|
||||
node := FindLowest;
|
||||
@@ -615,7 +615,7 @@ end;
|
||||
procedure TsRowColAVLTree.MoveAlongRow(ARow, AFromCol, AToCol: Cardinal);
|
||||
var
|
||||
c: Cardinal;
|
||||
node: TAVLTreeNode;
|
||||
node: TAvgLvlTreeNode;
|
||||
item: PsRowCol;
|
||||
begin
|
||||
if AFromCol = AToCol then
|
||||
@@ -659,7 +659,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsRowColAVLTree.Remove(ARow, ACol: Cardinal);
|
||||
var
|
||||
node: TAVLTreeNode;
|
||||
node: TAvgLvlTreeNode;
|
||||
item: TsRowCol;
|
||||
begin
|
||||
item.Row := ARow;
|
||||
@@ -1056,7 +1056,7 @@ procedure TsMergedCells.DeleteRowOrCol(AIndex: Cardinal; IsRow: Boolean);
|
||||
var
|
||||
rng: PsCellRange;
|
||||
R: TsCellRange;
|
||||
node, nextnode: TAVLTreeNode;
|
||||
node, nextnode: TAvgLvlTreeNode;
|
||||
begin
|
||||
node := FindLowest;
|
||||
while Assigned(node) do begin
|
||||
@@ -1153,7 +1153,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
function TsMergedCells.FindRangeWithCell(ARow, ACol: Cardinal): PsCellRange;
|
||||
var
|
||||
node: TAVLTreeNode;
|
||||
node: TAvgLvlTreeNode;
|
||||
begin
|
||||
node := FindLowest;
|
||||
while Assigned(node) do
|
||||
|
@@ -19,7 +19,8 @@ function PasswordHash(const APassword: String; Algorithm: TsAlgorithm): String;
|
||||
implementation
|
||||
|
||||
uses
|
||||
sha1, LazUTF8;
|
||||
//sha1,
|
||||
LazUTF8;
|
||||
|
||||
function AlgorithmToStr(Algorithm: TsCryptoAlgorithm; AUsage: TsAlgorithmUsage): String;
|
||||
begin
|
||||
|
@@ -189,7 +189,7 @@ var
|
||||
s: String;
|
||||
encoding: String;
|
||||
begin
|
||||
Unused(AParams);
|
||||
Unused(AParams, APassword);
|
||||
|
||||
// Try to determine encoding of the input file
|
||||
SetLength(s, Min(1000, AStream.Size));
|
||||
|
@@ -35,7 +35,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
laz2_xmlread, laz2_DOM,
|
||||
AVL_Tree, math, dateutils, contnrs,
|
||||
avglvltree, math, dateutils, contnrs,
|
||||
{$IF FPC_FULLVERSION >= 20701}
|
||||
zipper,
|
||||
{$ELSE}
|
||||
@@ -2068,7 +2068,6 @@ end;
|
||||
|
||||
procedure TsSpreadOpenDocReader.ReadDocumentProtection(ANode: TDOMNode);
|
||||
var
|
||||
s: String;
|
||||
cinfo: TsCryptoInfo;
|
||||
begin
|
||||
if ANode = nil then
|
||||
@@ -5011,7 +5010,6 @@ end;
|
||||
procedure TsSpreadOpenDocWriter.WriteContent;
|
||||
var
|
||||
i: Integer;
|
||||
s: String;
|
||||
begin
|
||||
AppendToStream(FSContent,
|
||||
XML_HEADER);
|
||||
|
@@ -22,7 +22,7 @@ uses
|
||||
{$ifdef UNIX}{$ifndef DARWIN}{$ifndef FPS_DONT_USE_CLOCALE}
|
||||
clocale,
|
||||
{$endif}{$endif}{$endif}
|
||||
Classes, SysUtils, fpimage, AVL_Tree, avglvltree, lconvencoding,
|
||||
Classes, SysUtils, fpimage, avglvltree, lconvencoding,
|
||||
fpsTypes, fpsClasses, fpsNumFormat, fpsPageLayout, fpsImages;
|
||||
|
||||
type
|
||||
@@ -5029,8 +5029,6 @@ end;
|
||||
as a number, a date/time or a text.
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsWorksheet.WriteCellValueAsString(ACell: PCell; AValue: String);
|
||||
var
|
||||
fs: TFormatSettings;
|
||||
begin
|
||||
WriteCellValueAsString(ACell, AValue, FWorkbook.FormatSettings);
|
||||
end;
|
||||
@@ -7555,7 +7553,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsWorksheet.MoveCol(AFromCol, AToCol: Cardinal);
|
||||
var
|
||||
r, c: Integer;
|
||||
r: Integer;
|
||||
begin
|
||||
if AFromCol = AToCol then
|
||||
// Nothing to do
|
||||
|
@@ -22,7 +22,7 @@ unit fpsReaderWriter;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Sysutils, AVL_Tree,
|
||||
Classes, Sysutils,
|
||||
fpsTypes, fpsClasses, fpSpreadsheet;
|
||||
|
||||
type
|
||||
|
@@ -410,8 +410,8 @@ var
|
||||
lColWidthStr: String;
|
||||
lRowHeightStr: String;
|
||||
lCell: PCell;
|
||||
lCol: PCol;
|
||||
lRow: PRow;
|
||||
// lCol: PCol;
|
||||
// lRow: PRow;
|
||||
lFont: TsFont;
|
||||
horalign: TsHorAlignment;
|
||||
vertalign: TsVertAlignment;
|
||||
@@ -457,12 +457,12 @@ begin
|
||||
for i := 0 to FWorksheet.GetLastRowIndex() do
|
||||
begin
|
||||
AStrings.Add('|-');
|
||||
lRow := FWorksheet.FindRow(i);
|
||||
//lRow := FWorksheet.FindRow(i);
|
||||
|
||||
for j := 0 to FWorksheet.GetLastColIndex do
|
||||
begin
|
||||
lCell := FWorksheet.FindCell(i, j);
|
||||
lCol := FWorksheet.FindCol(j);
|
||||
//lCol := FWorksheet.FindCol(j);
|
||||
lCurStr := FWorksheet.ReadAsText(lCell, fs);
|
||||
|
||||
// Check for invalid characters
|
||||
|
@@ -659,7 +659,7 @@ procedure AddBuiltinBiffFormats(AList: TStringList;
|
||||
implementation
|
||||
|
||||
uses
|
||||
AVL_Tree, Math, Variants,
|
||||
Math, Variants,
|
||||
{%H-}fpspatches, fpsStrings, fpsClasses, xlsConst,
|
||||
fpsExprParser, fpsPageLayout;
|
||||
|
||||
@@ -2267,8 +2267,6 @@ end;
|
||||
Returns false if the structure is too complex for fps.
|
||||
-------------------------------------------------------------------------------}
|
||||
function TsSpreadBIFFReader.ReadRPNAttr(AStream: TStream; AIdentifier: Byte): Boolean;
|
||||
var
|
||||
w: Word;
|
||||
begin
|
||||
Result := false;
|
||||
case AIdentifier of
|
||||
|
@@ -29,22 +29,20 @@ unit xlsxooxml;
|
||||
|
||||
{$ifdef fpc}
|
||||
{$mode objfpc}{$H+}
|
||||
// {$mode delphi}
|
||||
{$endif}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
laz2_xmlread, laz2_DOM,
|
||||
AVL_Tree,
|
||||
laz2_xmlread, laz2_DOM, avglvltree,
|
||||
{$IF FPC_FULLVERSION >= 20701}
|
||||
zipper,
|
||||
{$ELSE}
|
||||
fpszipper,
|
||||
{$ENDIF}
|
||||
fpsTypes, fpSpreadsheet, fpsUtils, fpsReaderWriter, fpsNumFormat, fpsPalette,
|
||||
fpsxmlcommon, xlsCommon; //, xlsxdecrypter;
|
||||
fpsxmlcommon, xlsCommon;
|
||||
|
||||
type
|
||||
|
||||
@@ -1274,6 +1272,8 @@ var
|
||||
ref: String;
|
||||
r1, c1: Cardinal;
|
||||
begin
|
||||
Unused(AWorksheet);
|
||||
|
||||
FLastRow := MaxInt;
|
||||
FLastCol := MaxInt;
|
||||
|
||||
@@ -3087,7 +3087,7 @@ var
|
||||
target, bookmark: String;
|
||||
s: String;
|
||||
txt: String;
|
||||
AVLNode: TAVLTreeNode;
|
||||
AVLNode: TAvgLvlTreeNode;
|
||||
begin
|
||||
if AWorksheet.Hyperlinks.Count = 0 then
|
||||
exit;
|
||||
@@ -4280,7 +4280,7 @@ end;
|
||||
|
||||
procedure TsSpreadOOXMLWriter.WriteWorksheetRels(AWorksheet: TsWorksheet);
|
||||
var
|
||||
AVLNode: TAVLTreeNode;
|
||||
AVLNode: TAvgLvlTreeNode;
|
||||
hyperlink: PsHyperlink;
|
||||
s: String;
|
||||
target, bookmark: String;
|
||||
|
@@ -42,3 +42,4 @@
|
||||
This is not yet available in fpc 2.6.0 }
|
||||
{.$DEFINE FPS_PTRINT}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user