summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-01-19 00:24:24 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-01-21 09:08:32 -0500
commited46df1fcb5869818f5f74e0c7a5b19c65102e83 (patch)
tree42cf9a30c8b216ccd0da8c2e86addaa1073dc2a1
parentaf63319fcdeea3f9b5018eab83ef5a9e64905446 (diff)
Fixed incorrect import of cell attributes from Excel documents.
When a cell with non-default formatting attribute starts with non-first row in a column, the filter would incorrectly apply the same format to all the cells above it if they didn't have any formats. This commit fixes it.
-rw-r--r--sc/source/filter/excel/xistyle.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 6693d6fe3..d9d394040 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1294,7 +1294,16 @@ void XclImpXF::ApplyPatternToAttrList(
if (pPat)
{
+ // Check for a gap between the last entry and this one.
+ bool bHasGap = false;
+ if (rAttrs.empty() && nRow1 > 0)
+ // First attribute range doesn't start at row 0.
+ bHasGap = true;
+
if (!rAttrs.empty() && rAttrs.back().nRow + 1 < nRow1)
+ bHasGap = true;
+
+ if (bHasGap)
{
// Fill this gap with the default pattern.
ScAttrEntry aEntry;