summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-04-27 16:10:17 +0200
committerEike Rathke <erack@redhat.com>2018-04-27 16:15:57 +0200
commitb78ab482911356ef282f7fd40a4509320608a203 (patch)
tree2718790167cc96811ad7cd229b25dbafa437ab1f
parent99ac4ee05b039166eedfe361fb985682fd92dd13 (diff)
Resolves: tdf#116939 cater for the last cols col incremented by Excel
Change-Id: I48c4b9afb4cf2cb826ae2bb52067256e7fcb2c83
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 02566cba911c..1b09c27855dc 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -770,6 +770,13 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& rModel )
// checkCol(). Cater for this oddity.
if (nLastCol == mrMaxApiPos.Col() + 1)
--nLastCol;
+ // This is totally fouled up. If we saved 1025 and the file is saved
+ // with Excel again, it increments the value to 1026.
+ /* TODO: we may have to completely ignore the very last
+ * <cols><col ... max=...></cols> value and use checkCol(...,false) on
+ * that, if it turns out that Excel stores arbitrary columns. */
+ else if (nLastCol == mrMaxApiPos.Col() + 2)
+ nLastCol -= 2;
// Excel may add a column range for the remaining columns (with
// <cols><col .../></cols>), even if not used or only used to grey out
// columns in page break view. Don't let that trigger overflow warning,