summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xlsx/tdf41425.xlsxbin0 -> 5496 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx15
-rw-r--r--sc/source/filter/excel/xetable.cxx3
3 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf41425.xlsx b/sc/qa/unit/data/xlsx/tdf41425.xlsx
new file mode 100644
index 000000000000..f7d3ec9ed6ec
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf41425.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index c250ef8bb3eb..6816e86fd2a4 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -205,6 +205,7 @@ public:
void testHiddenRepeatedRowsODS();
void testHyperlinkTargetFrameODS();
void testOpenDocumentAsReadOnly();
+ void testKeepSettingsOfBlankRows();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
@@ -311,6 +312,7 @@ public:
CPPUNIT_TEST(testHiddenRepeatedRowsODS);
CPPUNIT_TEST(testHyperlinkTargetFrameODS);
CPPUNIT_TEST(testOpenDocumentAsReadOnly);
+ CPPUNIT_TEST(testKeepSettingsOfBlankRows);
CPPUNIT_TEST_SUITE_END();
@@ -4006,6 +4008,19 @@ void ScExportTest::testOpenDocumentAsReadOnly()
xDocSh2->DoClose();
}
+void ScExportTest::testKeepSettingsOfBlankRows()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf41425.", FORMAT_XLSX);
+ CPPUNIT_ASSERT(xDocSh.is());
+
+ std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
+ xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
+ CPPUNIT_ASSERT(pSheet);
+
+ // saved blank row with not default setting in A2
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row", 2);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 7ca907dff18f..875a7c531231 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -2455,6 +2455,9 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
if(nLastUsedScCol > nMaxScCol)
nLastUsedScCol = nMaxScCol;
+ // check extra blank rows to avoid of losing their not default settings (workaround for tdf#41425)
+ nLastUsedScRow += 1000;
+
if(nLastUsedScRow > nMaxScRow)
nLastUsedScRow = nMaxScRow;