summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-05-14 14:38:36 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-05-16 17:21:42 +0200
commita49200d976b8dc0a33d5d1f3a3e52bf2e97828f2 (patch)
treee474c6599965b6e8dba1ec1a67617774323baeb0
parent96bb95e64240ddeb59d623d62fa30b2a7191bfc4 (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> (cherry picked from commit f72bd4f02b70e1c4855795b4237e2965556c4689) Reviewed-on: https://gerrit.libreoffice.org/54332 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 6af0e32a1e80..24df7a71a83d 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;