summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-04-27 16:10:17 +0200
committerKohei Yoshida <libreoffice@kohei.us>2018-05-02 23:12:39 +0200
commit391920065873b3f74efae8c84b8997d27bce49d7 (patch)
tree0fa5f6e580fb276290ee9e6917a8d60e54d49752 /sc/source/filter/oox
parentb7ef11a970b58624f0035af4b4f3bd77e11ff235 (diff)
Resolves: tdf#116939 cater for the last cols col incremented by Excel
Change-Id: I48c4b9afb4cf2cb826ae2bb52067256e7fcb2c83 (cherry picked from commit b78ab482911356ef282f7fd40a4509320608a203) Reviewed-on: https://gerrit.libreoffice.org/53566 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc/source/filter/oox')
-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 aade8b4e88d0..6af0e32a1e80 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,