summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-05-14 14:38:36 +0200
committerEike Rathke <erack@redhat.com>2018-05-14 17:14:57 +0200
commitf72bd4f02b70e1c4855795b4237e2965556c4689 (patch)
tree8552dfb07f52955b4a67f4d8b046565f7894f454
parent7ebb57228f27a95eb1648500b5becb3febb9d316 (diff)
Related: tdf#116939 Disable <cols><col> overflow detection due to excess ...
... custom column widths. It's probably just confusing to users, even if technically correct. Live with truncation of a "layout form" if no content is present. Change-Id: I43d77c3e019badd053cb21d92aacd64c7bbcf0e6 Reviewed-on: https://gerrit.libreoffice.org/54319 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 1b09c27855dc..907e7b399753 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -772,9 +772,6 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& rModel )
--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
@@ -784,7 +781,12 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& rModel )
// the range that should be caught anyway.
else if (nLastCol == getAddressConverter().getMaxXlsAddress().Col())
nLastCol = mrMaxApiPos.Col();
- else if( !getAddressConverter().checkCol( nLastCol, true ) )
+ // User may have applied custom column widths to arbitrary excess
+ // columns. Ignore those and don't track as overflow columns (false).
+ // Effectively this does the same as the above cases, just keep them
+ // for explanation.
+ // Actual data present should trigger the overflow detection later.
+ else if( !getAddressConverter().checkCol( nLastCol, false ) )
nLastCol = mrMaxApiPos.Col();
// try to find entry in column model map that is able to merge with the passed model
bool bInsertModel = true;