fpspreadsheet: Fixes a bug in the last fix

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1655 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-05-29 17:33:46 +00:00
parent 948839a79a
commit b4d8b8a10e
4 changed files with 14 additions and 4 deletions

View File

@ -13,7 +13,6 @@
<Title Value="test_write_formatting"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>

View File

@ -170,8 +170,8 @@ begin
WriteSecondWorksheet();
// Save the spreadsheet to a file
//MyWorkbook.WriteToFile(MyDir + 'test3.xls', sfExcel8, False);
MyWorkbook.WriteToFile(MyDir + 'test3.odt', sfOpenDocument, False);
MyWorkbook.WriteToFile(MyDir + 'test3.xls', sfExcel8, False);
// MyWorkbook.WriteToFile(MyDir + 'test3.odt', sfOpenDocument, False);
MyWorkbook.Free;
end.

View File

@ -14,7 +14,15 @@
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<GenerateDebugInfo Value="True"/>
</Debugging>
</Linking>
<Other>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>

View File

@ -71,7 +71,8 @@ type
TsSpreadBIFFWriter = class(TsCustomSpreadWriter)
protected
FLastRow, FLastCol: Integer;
FLastRow: Integer;
FLastCol: Word;
function FPSColorToEXCELPallete(AColor: TsColor): Word;
procedure GetLastRowCallback(ACell: PCell; AStream: TStream);
function GetLastRowIndex(AWorksheet: TsWorksheet): Integer;
@ -115,6 +116,7 @@ function TsSpreadBIFFWriter.GetLastRowIndex(AWorksheet: TsWorksheet): Integer;
begin
FLastRow := 0;
IterateThroughCells(nil, AWorksheet.Cells, GetLastRowCallback);
Result := FLastRow;
end;
procedure TsSpreadBIFFWriter.GetLastColCallback(ACell: PCell; AStream: TStream);
@ -126,6 +128,7 @@ function TsSpreadBIFFWriter.GetLastColIndex(AWorksheet: TsWorksheet): Word;
begin
FLastCol := 0;
IterateThroughCells(nil, AWorksheet.Cells, GetLastColCallback);
Result := FLastCol;
end;
end.