[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Jan 18 21:46:49 PST 2011


 sc/source/filter/excel/xistyle.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 1459e2ba9e441d55c57345130a7c6f3353fa967a
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Jan 19 00:24:24 2011 -0500

    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.

diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 1d02144..7da454f 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;


More information about the Libreoffice-commits mailing list