[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu Jul 7 19:30:26 CEST 2011


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

New commits:
commit 4960acecc71a142ee25ee69cd842ac8cdaeb5b72
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed May 18 23:09:41 2011 +0000

    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.
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

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