From ada9698d918ffd6859680acbd361599d8f8dbd19 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 19 Jan 2011 00:24:24 -0500 Subject: 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. --- sc/source/filter/excel/xistyle.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sc/source/filter/excel/xistyle.cxx') diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 1d02144d3793..7da454fca531 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1313,7 +1313,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; -- cgit