summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-05-18 23:09:41 +0000
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-07-07 19:28:43 +0200
commit4960acecc71a142ee25ee69cd842ac8cdaeb5b72 (patch)
tree3e172c3f527cab6ffd9d0b3f9295fd98661c5ceb
parent6da6e164f04b8110e9800378215d76ea4a51549c (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. Signed-off-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-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)