summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-06-12 11:15:09 -0400
committerJustin Luth <jluth@mail.com>2023-06-27 02:27:58 +0200
commitb0f55a04f081ff7f566c3ba5b6d6d6be3675e0f7 (patch)
tree0d07b932e249fa7f50dc2ab15c714e278d31391a /sc/source/filter/oox
parent9951ffedd6941234447b9655fbc49ed6ca4cc64c (diff)
tdf#123026 sc xlsx: provide per-sheet optimal row height setting
This patch is a pre-requisite for a follow-up patch which will run SetOptimalRowHeight on all un-sized rows on FILEOPEN. XLSX sheets can provide a default height for all rows on that sheet. That imported/round-tripped well. However, if Calc optimizes these rows, the undefined rows likely will change height - since the default XLSX row height tends to be 300 twips, while Calc uses 256 (in ScGlobal::nStdRowHeight). This patch allows a sheet to define its optimal row height, so that running .uno:SetOptimalRowHeight doesn't change any row heights, and doesn't cause all kinds of new row definitions. make CppunitTest_sc_subsequent_filters_test2 \ CPPUNIT_TEST_NAME=testTdf123026_optimalRowHeight Change-Id: I35008107d71f66375c7e9469e559f3836cf14df5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152909 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index e34f5a47d190..495cc0ff7828 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -63,6 +63,7 @@
#include <scitems.hxx>
#include <editutil.hxx>
#include <tokenarray.hxx>
+#include <table.hxx>
#include <tablebuffer.hxx>
#include <documentimport.hxx>
#include <stlsheet.hxx>
@@ -956,6 +957,11 @@ void WorksheetGlobals::finalizeWorksheetImport()
ScDocument& rDoc = getScDocument();
std::vector<sc::ColRowSpan> aSpans;
SCTAB nTab = getSheetIndex();
+
+ ScTable* pTable = rDoc.FetchTable(nTab);
+ if (pTable)
+ pTable->SetOptimalMinRowHeight(maDefRowModel.mfHeight * 20); // in TWIPS
+
ScDBData* pDBData = rDoc.GetAnonymousDBData(nTab);
if (pDBData && pDBData->HasAutoFilter())
{