summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-04-24 13:10:08 +0200
committerEike Rathke <erack@redhat.com>2018-04-24 17:26:43 +0200
commiteeb8ce7d4e008fdc99032e21be655e522bd55c77 (patch)
tree636c52c0896548ff50d3c3adf075cdea8c9a5905
parenta3ea83896f2d3aefa8cd67b3aa54884450999481 (diff)
Related: tdf#116274 ignore the one excess cols definition's last column
<cols> ... <col min="5" max="16384" width="31.75" style="3"/> </cols> may be present even if there isn't any content. Apparently used with pageBreakPreview to grey out the area. Change-Id: I6a79f9ec692ec07b02f4b4205ccd0cf3cf9f363f (cherry picked from commit 16265dcdb21d7cf69c65c2a84f1d21a5d8574dd4) Reviewed-on: https://gerrit.libreoffice.org/53377 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
-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 c1cdae73e4b1..aade8b4e88d0 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;
+ // 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,
+ // so check for the last possible column. If there really is content in
+ // the range that should be caught anyway.
+ else if (nLastCol == getAddressConverter().getMaxXlsAddress().Col())
+ nLastCol = mrMaxApiPos.Col();
else if( !getAddressConverter().checkCol( nLastCol, true ) )
nLastCol = mrMaxApiPos.Col();
// try to find entry in column model map that is able to merge with the passed model