fpspreadsheet: Fix ods repeated rows/cols unit tests.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4506 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-02-16 10:28:14 +00:00
parent fdf0f89a66
commit e3d715a8a8
2 changed files with 7 additions and 3 deletions

View File

@ -4603,7 +4603,7 @@ begin
inc(k);
end
else
while (k <= lastCol) do
while (k <= lastCol) and (k < firstRepeatedPrintCol) do
begin
if ASheet.GetColWidth(k) = w then
inc(colsRepeated)
@ -4617,7 +4617,7 @@ begin
'<table:table-column table:style-name="%s"%s table:default-cell-style-name="Default" />',
[styleName, colsRepeatedStr]));
if headerCols and (k-1 = lastRepeatedPrintCol) then
if headerCols and (k >= lastRepeatedPrintCol) then
begin
AppendToStream(AStream, '</table:table-header-columns>');
headerCols := false;
@ -5007,7 +5007,7 @@ begin
r := rr;
// Header rows need a special tag
if headerRows and (r-1 = lastRepeatedPrintRow) then
if headerRows and (r >= lastRepeatedPrintRow) then
begin
AppendToStream(AStream, '</table:table-header-rows>');
headerRows := false;

View File

@ -766,6 +766,7 @@ var
MyWorksheet: TsWorksheet;
rng: TsCellRange;
sheetname: String;
r, c: Cardinal;
begin
TempFile := GetTempFileName;
@ -773,6 +774,9 @@ begin
try
sheetname := PageLayoutSheet;
MyWorksheet := MyWorkbook.AddWorksheet(sheetname);
for r := 0 to 10 do
for c := 0 to 10 do
MyWorksheet.WriteNumber(r, c, r*100+c);
MyWorksheet.SetRepeatedPrintRows(AFirstRow, ALastRow);
MyWorksheet.SetRepeatedPrintCols(AFirstCol, ALastCol);
MyWorkBook.WriteToFile(TempFile, AFormat, true);