summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-05-18 19:09:41 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-05-19 01:21:58 -0400
commit6e1ff6d24f0c93af145a73b27918fe49b1960b71 (patch)
tree9ce3e7f814e517255491bc38a88527ae9725b980
parenta6c4db6a2ddb42564bd172f96366ea939a5c63a2 (diff)
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.
-rw-r--r--sc/source/filter/excel/xepage.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 47899eb15..5ac8493a0 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)