[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed May 18 22:24:25 PDT 2011


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

New commits:
commit 6e1ff6d24f0c93af145a73b27918fe49b1960b71
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed May 18 19:09:41 2011 -0400

    Make sure to only export up to 1026 manual page breaks to XLS.
    
    If you export even one excess page break than 1026, Excel refuses
    to load the whole document.

diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 47899eb..5ac8493 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -330,6 +330,14 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
         maData.maHorPageBreaks.push_back(nRow);
     }
 
+    if (maData.maHorPageBreaks.size() > 1026)
+    {
+        // Excel allows only up to 1026 page breaks.  Trim any excess page breaks.
+        ScfUInt16Vec::iterator itr = maData.maHorPageBreaks.begin();
+        ::std::advance(itr, 1026);
+        maData.maHorPageBreaks.erase(itr, maData.maHorPageBreaks.end());
+    }
+
     set<SCCOL> aColBreaks;
     rDoc.GetAllColBreaks(aColBreaks, nScTab, false, true);
     for (set<SCCOL>::const_iterator itr = aColBreaks.begin(), itrEnd = aColBreaks.end(); itr != itrEnd; ++itr)


More information about the Libreoffice-commits mailing list