You've already forked lazarus-ccr
fpspreadsheet: CopyWorksheetFrom now copies also the DefaultRowHeight. Remove deprecated properties DefaultRowHeight and DefaultColWidth (the corresponding Read/Write procedures must be used instead).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7530 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -87,8 +87,8 @@ type
|
|||||||
FFirstColIndex: Cardinal;
|
FFirstColIndex: Cardinal;
|
||||||
FLastRowIndex: Cardinal;
|
FLastRowIndex: Cardinal;
|
||||||
FLastColIndex: Cardinal;
|
FLastColIndex: Cardinal;
|
||||||
FDefaultColWidth: Single; // in "characters". Excel uses the width of char "0" in 1st font
|
FDefaultColWidth: Single;
|
||||||
FDefaultRowHeight: Single; // in "character heights", i.e. line count
|
FDefaultRowHeight: Single;
|
||||||
FSortParams: TsSortParams; // Parameters of the current sorting operation
|
FSortParams: TsSortParams; // Parameters of the current sorting operation
|
||||||
FBiDiMode: TsBiDiMode;
|
FBiDiMode: TsBiDiMode;
|
||||||
FCryptoInfo: TsCryptoInfo;
|
FCryptoInfo: TsCryptoInfo;
|
||||||
@@ -108,13 +108,10 @@ type
|
|||||||
FOnWriteCellData: TsWorksheetWriteCellDataEvent;
|
FOnWriteCellData: TsWorksheetWriteCellDataEvent;
|
||||||
|
|
||||||
{ Setter/Getter }
|
{ Setter/Getter }
|
||||||
function GetDefaultColWidth: Single;
|
|
||||||
function GetDefaultRowHeight: Single;
|
|
||||||
function GetFormatSettings: TFormatSettings;
|
function GetFormatSettings: TFormatSettings;
|
||||||
function GetIndex: Integer;
|
function GetIndex: Integer;
|
||||||
procedure SetBiDiMode(AValue: TsBiDiMode);
|
procedure SetBiDiMode(AValue: TsBiDiMode);
|
||||||
procedure SetDefaultColWidth(AValue: Single);
|
|
||||||
procedure SetDefaultRowHeight(AValue: Single);
|
|
||||||
procedure SetIndex(AValue: Integer);
|
procedure SetIndex(AValue: Integer);
|
||||||
procedure SetTabColor(AValue: TsColor);
|
procedure SetTabColor(AValue: TsColor);
|
||||||
procedure SetVirtualColCount(AValue: Cardinal);
|
procedure SetVirtualColCount(AValue: Cardinal);
|
||||||
@@ -647,13 +644,6 @@ type
|
|||||||
property TabColor: TsColor read FTabColor write SetTabColor default scNotDefined;
|
property TabColor: TsColor read FTabColor write SetTabColor default scNotDefined;
|
||||||
{@@ Workbook to which the worksheet belongs }
|
{@@ Workbook to which the worksheet belongs }
|
||||||
property Workbook: TsWorkbook read FWorkbook;
|
property Workbook: TsWorkbook read FWorkbook;
|
||||||
{@@ The default column width given in "character units" (width of the
|
|
||||||
character "0" in the default font) }
|
|
||||||
property DefaultColWidth: Single read GetDefaultColWidth write SetDefaultColWidth;
|
|
||||||
deprecated 'Use Read/WriteDefaultColWidth';
|
|
||||||
{@@ The default row height is given in "line count" (height of the default font }
|
|
||||||
property DefaultRowHeight: Single read GetDefaultRowHeight write SetDefaultRowHeight;
|
|
||||||
deprecated 'Use Read/WriteDefaultColWidth';
|
|
||||||
{@@ In VirtualMode, the value of VirtualColCount signals how many colums
|
{@@ In VirtualMode, the value of VirtualColCount signals how many colums
|
||||||
will be transferred to the worksheet. }
|
will be transferred to the worksheet. }
|
||||||
property VirtualColCount: cardinal read FVirtualColCount write SetVirtualColCount;
|
property VirtualColCount: cardinal read FVirtualColCount write SetVirtualColCount;
|
||||||
@@ -7285,26 +7275,6 @@ begin
|
|||||||
ChangedCell(ACell^.Row, ACell^.Col);
|
ChangedCell(ACell^.Row, ACell^.Col);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TsWorksheet.GetDefaultColWidth: Single;
|
|
||||||
begin
|
|
||||||
Result := ReadDefaultColWidth(suChars);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TsWorksheet.SetDefaultColWidth(AValue: Single);
|
|
||||||
begin
|
|
||||||
WriteDefaultColWidth(AValue, suChars);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TsWorksheet.GetDefaultRowHeight: Single;
|
|
||||||
begin
|
|
||||||
Result := ReadDefaultRowHeight(suLines);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TsWorksheet.SetDefaultRowHeight(AValue: Single);
|
|
||||||
begin
|
|
||||||
WriteDefaultRowHeight(AValue, suLines);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TsWorksheet.GetFormatSettings: TFormatSettings;
|
function TsWorksheet.GetFormatSettings: TFormatSettings;
|
||||||
begin
|
begin
|
||||||
Result := FWorkbook.FormatSettings;
|
Result := FWorkbook.FormatSettings;
|
||||||
@@ -9267,7 +9237,7 @@ var
|
|||||||
col: PCol;
|
col: PCol;
|
||||||
row: PRow;
|
row: PRow;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
w: Single;
|
w, h: Single;
|
||||||
fnt: TsFont;
|
fnt: TsFont;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
@@ -9285,8 +9255,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// Copy DefaultColWidth
|
// Copy DefaultColWidth
|
||||||
w := AWorksheet.ReadDefaultColWidth(suMillimeters);
|
w := AWorksheet.ReadDefaultColWidth(Units);
|
||||||
Result.WriteDefaultColWidth(w, suMillimeters);
|
Result.WriteDefaultColWidth(w, Units);
|
||||||
|
|
||||||
|
// Copy DefaultRowHeight
|
||||||
|
h := AWorksheet.ReadDefaultRowHeight(Units);
|
||||||
|
Result.WriteDefaultRowHeight(h, Units);
|
||||||
|
|
||||||
// Copy cells (incl formulas, comments, hyperlinks etc).
|
// Copy cells (incl formulas, comments, hyperlinks etc).
|
||||||
for cell in AWorksheet.Cells do
|
for cell in AWorksheet.Cells do
|
||||||
|
@@ -429,7 +429,7 @@ begin
|
|||||||
if lCol^.ColWidthType = cwtCustom then
|
if lCol^.ColWidthType = cwtCustom then
|
||||||
w := lCol^.Width
|
w := lCol^.Width
|
||||||
else
|
else
|
||||||
w := sheet.DefaultColWidth;
|
w := sheet.ReadDefaultColWidth(sheet.Workbook.Units);
|
||||||
if not SameValue(w, w0) then
|
if not SameValue(w, w0) then
|
||||||
// if not SameValue(lCol^.Width, w, EPS) then
|
// if not SameValue(lCol^.Width, w, EPS) then
|
||||||
begin
|
begin
|
||||||
|
@@ -995,7 +995,7 @@ type
|
|||||||
FFormatID: TsSpreadFormatID;
|
FFormatID: TsSpreadFormatID;
|
||||||
FOptions: TsWorkbookOptions;
|
FOptions: TsWorkbookOptions;
|
||||||
FProtection: TsWorkbookProtections;
|
FProtection: TsWorkbookProtections;
|
||||||
FUnits: TsSizeUnits;
|
FUnits: TsSizeUnits; // Units for row heights and col widths
|
||||||
public
|
public
|
||||||
{@@ A copy of SysUtil's DefaultFormatSettings (converted to UTF8) to provide
|
{@@ A copy of SysUtil's DefaultFormatSettings (converted to UTF8) to provide
|
||||||
some kind of localization to some formatting strings.
|
some kind of localization to some formatting strings.
|
||||||
|
Reference in New Issue
Block a user