Kaydet (Commit) 99b9ea63 authored tarafından László Németh's avatar László Németh

tdf#41425 XLS/XLSX export: workaround for style and validation loss

of cells of blank rows.

This workaround is probably a fix for problems of most users, but for
a full solution it needs to extend the workaround for all rows with not
default settings, also avoiding of the possible performance problems.

Note: the number 1000 of the extra rows came from a similar workaround used in
XLSX export of Google Spreadsheets, but instead of listing extra empty 1000
rows in OOXML, this fix writes only the cells with not default settings from
the extra 1000 blank rows.

Change-Id: Icac9441b7eb1520dcd20fc04337e070d070591c7
Reviewed-on: https://gerrit.libreoffice.org/58575
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst d0841a18
......@@ -209,6 +209,7 @@ public:
void testHiddenRepeatedRowsODS();
void testHyperlinkTargetFrameODS();
void testOpenDocumentAsReadOnly();
void testKeepSettingsOfBlankRows();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
......@@ -317,6 +318,7 @@ public:
CPPUNIT_TEST(testHiddenRepeatedRowsODS);
CPPUNIT_TEST(testHyperlinkTargetFrameODS);
CPPUNIT_TEST(testOpenDocumentAsReadOnly);
CPPUNIT_TEST(testKeepSettingsOfBlankRows);
CPPUNIT_TEST_SUITE_END();
......@@ -4048,6 +4050,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();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment