summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2016-08-25 12:47:26 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-31 14:45:21 +0000
commitd16070a30d421098faedd51c4333d1d42163268f (patch)
tree0165214de59a903fbbc6171b1d68a7d4dcacd942
parent9876ffe934a21df1df4a457aa88aa8441243dba9 (diff)
Related: tdf#100709 Fix two bugs in SheetDataBuffer::addColXfStyle
The addColXfStyle method is supposed to add a formatId to all the cells in a specified CellRange where there is no previously set formatId in the maStylesPerColumn member variable. There where two bugs in this function: - If there is overlap between the row ranges already in maStylesPerColumnBB and the given RowRange, it should be updated to only cover non-overlapping cells. - In the case when the given CellRange spans multiple columns, the RowRange should be applied to all these columns. When the row range given to this method is changed because of earlier set RowRanges in maStylesPerColumn[nCol], the RowRange was not reset to the given method argument for a new column. Change-Id: I4244c4303ca983801c5116cbd26971dd641411ab Reviewed-on: https://gerrit.libreoffice.org/28509 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sc/source/filter/oox/sheetdatabuffer.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 3182088fc7c2..d5f29afa04b5 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -371,6 +371,10 @@ void SheetDataBuffer::addColXfStyle( sal_Int32 nXfId, sal_Int32 nFormatId, const
else
{
RowStyles& rRowStyles = maStylesPerColumn[ nCol ];
+ // Reset row range for each column
+ aStyleRows.mnStartRow = rAddress.StartRow;
+ aStyleRows.mnEndRow = rAddress.EndRow;
+
// If the rowrange style includes rows already
// allocated to a style then we need to split
// the range style Rows into sections ( to
@@ -407,6 +411,8 @@ void SheetDataBuffer::addColXfStyle( sal_Int32 nXfId, sal_Int32 nFormatId, const
aRangeRowsSplits.push_back( aSplit );
}
}
+ if ( aStyleRows.mnStartRow <= r.mnEndRow && r.mnEndRow < aStyleRows.mnEndRow )
+ aStyleRows.mnStartRow = r.mnEndRow + 1;
}
std::vector< RowRangeStyle >::iterator splits_it = aRangeRowsSplits.begin();
std::vector< RowRangeStyle >::iterator splits_end = aRangeRowsSplits.end();