diff options
author | Justin Luth <justin_luth@sil.org> | 2017-02-09 21:10:56 +0300 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-02-10 08:36:11 +0000 |
commit | 3e67dc9dbbd802dd82b92304098aaa44e70c014c (patch) | |
tree | 8ff5c6bc3eef2ff6f6b39603af670f0b841b8004 | |
parent | 38f0a87ba8d840f7a79f6d466d833518470d337c (diff) |
revert tdf#98106 Preserving hidden and empty rows after xlsx export
That patch has caused massive file bloat and and import hanging
in xls and xlsx files (bug 105840). That patch was backported to 5.2.5.
Just revert from the stable 5.2 branch and work on fixing 5.3
since the proper fix needs to be well tested.
Since bug 98106 is just an enhancement, it is an obvious candidate for
a simple revert of commit 7dd19273530730478b5ed24b79f42ac480c7ae43
Change-Id: I339694a86bab489ba0905b4d1090245bcb07fe86
Reviewed-on: https://gerrit.libreoffice.org/34104
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 18 | ||||
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 9 |
2 files changed, 4 insertions, 23 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index efcb38f73797..0941a0b0adb0 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -115,7 +115,6 @@ public: void testColumnWidthResaveXLSX(); void testColumnWidthExportFromODStoXLSX(); void testOutlineExportXLSX(); - void testHiddenEmptyRowsXLSX(); void testLandscapeOrientationXLSX(); void testInlineArrayXLS(); @@ -205,7 +204,6 @@ public: CPPUNIT_TEST(testColumnWidthResaveXLSX); CPPUNIT_TEST(testColumnWidthExportFromODStoXLSX); CPPUNIT_TEST(testOutlineExportXLSX); - CPPUNIT_TEST(testHiddenEmptyRowsXLSX); CPPUNIT_TEST(testLandscapeOrientationXLSX); CPPUNIT_TEST(testInlineArrayXLS); CPPUNIT_TEST(testEmbeddedChartXLS); @@ -859,22 +857,6 @@ void ScExportTest::testOutlineExportXLSX() } -void ScExportTest::testHiddenEmptyRowsXLSX() -{ - //tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX - ScDocShellRef xShell = loadDoc("hidden-empty-rows.", FORMAT_ODS); - CPPUNIT_ASSERT(xShell.Is()); - - std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX); - xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml"); - CPPUNIT_ASSERT(pSheet); - - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "hidden", "true"); - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "hidden", "true"); - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]", "hidden", "true"); - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "hidden", "false"); -} - void ScExportTest::testLandscapeOrientationXLSX() { //tdf#48767 - Landscape page orientation is not loaded from .xlsx format with MS Excel, after export with Libre Office diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 30a3da417462..c9593400bdfa 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2045,7 +2045,7 @@ sal_uInt16 XclExpRow::GetFirstFreeXclCol() const bool XclExpRow::IsDefaultable() const { - const sal_uInt16 nFlagsAlwaysMarkedAsDefault = EXC_ROW_DEFAULTFLAGS | EXC_ROW_UNSYNCED; + const sal_uInt16 nFlagsAlwaysMarkedAsDefault = EXC_ROW_DEFAULTFLAGS | EXC_ROW_HIDDEN | EXC_ROW_UNSYNCED; return !::get_flag( mnFlags, static_cast< sal_uInt16 >( ~nFlagsAlwaysMarkedAsDefault ) ) && IsEmpty(); } @@ -2054,6 +2054,7 @@ void XclExpRow::DisableIfDefault( const XclExpDefaultRowData& rDefRowData ) { mbEnabled = !IsDefaultable() || (mnHeight != rDefRowData.mnHeight) || + (IsHidden() != rDefRowData.IsHidden()) || (IsUnsynced() != rDefRowData.IsUnsynced()); } @@ -2225,7 +2226,6 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt XclExpDefaultRowData aMaxDefData; size_t nMaxDefCount = 0; // only look for default format in existing rows, if there are more than unused - // if the row is hidden, then row xml must be created even if it not contain cells XclExpRow* pPrev = nullptr; typedef std::vector< XclExpRow* > XclRepeatedRows; XclRepeatedRows aRepeated; @@ -2380,12 +2380,11 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE { // only create RowMap entries if it is first row in spreadsheet, // if it is the desired row, for rows that height differ from previous, - // if row is collapsed, has outline level (tdf#100347), or row is hidden (tdf#98106). + // if row is collapsed, or has outline level (tdf#100347). if ( !nFrom || ( nFrom == nXclRow ) || ( rDoc.GetRowHeight(nFrom, nScTab, false) != rDoc.GetRowHeight(nFrom - 1, nScTab, false) ) || ( maOutlineBfr.IsCollapsed() ) || - ( maOutlineBfr.GetLevel() != 0 ) || - ( rDoc.RowHidden(nFrom, nScTab) ) ) + ( maOutlineBfr.GetLevel() != 0 ) ) { if( maOutlineBfr.GetLevel() > maHighestOutlineLevel ) { |