diff options
-rw-r--r-- | sc/qa/unit/data/xlsx/tdf139167.xlsx | bin | 0 -> 10743 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 21 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 9 | ||||
-rw-r--r-- | sc/source/filter/excel/xltools.cxx | 4 |
4 files changed, 31 insertions, 3 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf139167.xlsx b/sc/qa/unit/data/xlsx/tdf139167.xlsx Binary files differnew file mode 100644 index 000000000000..b1c7aa201713 --- /dev/null +++ b/sc/qa/unit/data/xlsx/tdf139167.xlsx diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index a64a14ec96a9..99d64543bb91 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -89,6 +89,7 @@ public: virtual void tearDown() override; void test(); + void testTdf139167(); void testTdf139394(); void testExtCondFormatXLSX(); void testTdf90104(); @@ -283,6 +284,7 @@ public: CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); + CPPUNIT_TEST(testTdf139167); CPPUNIT_TEST(testTdf139394); CPPUNIT_TEST(testExtCondFormatXLSX); CPPUNIT_TEST(testTdf90104); @@ -525,6 +527,25 @@ void ScExportTest::test() xDocSh->DoClose(); } +void ScExportTest::testTdf139167() +{ + ScDocShellRef xShell = loadDoc(u"tdf139167.", FORMAT_XLSX); + CPPUNIT_ASSERT(xShell.is()); + + ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX); + CPPUNIT_ASSERT(xDocSh.is()); + + std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX); + xmlDocUniquePtr pDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/styles.xml"); + CPPUNIT_ASSERT(pDoc); + + assertXPath(pDoc, "/x:styleSheet/x:cellStyles", "count", "6"); + assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:fill/x:patternFill/x:bgColor", "rgb", + "FFFFFF00"); + + xDocSh->DoClose(); +} + void ScExportTest::testTdf139394() { ScDocShellRef xShell = loadDoc(u"tdf139394.", FORMAT_XLSX); diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 48bc5df23dc9..01811930d28b 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3026,12 +3026,15 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot ) for (size_t nFormatEntry = 0; nFormatEntry < nEntryCount; ++nFormatEntry) { const ScFormatEntry* pFormatEntry = rxItem->GetEntry(nFormatEntry); - if (!pFormatEntry || (pFormatEntry->GetType() != ScFormatEntry::Type::Condition && - pFormatEntry->GetType() != ScFormatEntry::Type::Date)) + if (!pFormatEntry + || (pFormatEntry->GetType() != ScFormatEntry::Type::Condition + && pFormatEntry->GetType() != ScFormatEntry::Type::Date + && pFormatEntry->GetType() != ScFormatEntry::Type::ExtCondition)) continue; OUString aStyleName; - if(pFormatEntry->GetType() == ScFormatEntry::Type::Condition) + if (pFormatEntry->GetType() == ScFormatEntry::Type::Condition + || pFormatEntry->GetType() == ScFormatEntry::Type::ExtCondition) { const ScCondFormatEntry* pEntry = static_cast<const ScCondFormatEntry*>(pFormatEntry); aStyleName= pEntry->GetStyle(); diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index ca0aeb278e1b..24b6cdc6d413 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -659,6 +659,7 @@ bool XclTools::GetBuiltInStyleId( sal_uInt8& rnStyleId, sal_uInt8& rnLevel, cons const char maCFStyleNamePrefix1[] = "Excel_CondFormat_"; /// Prefix for cond. formatting style names. const char maCFStyleNamePrefix2[] = "ConditionalStyle_"; /// Prefix for cond. formatting style names from OOX filter. +const char maCFStyleNamePrefix3[] = "ExtConditionalStyle_"; OUString XclTools::GetCondFormatStyleName( SCTAB nScTab, sal_Int32 nFormat, sal_uInt16 nCondition ) { @@ -678,6 +679,9 @@ bool XclTools::IsCondFormatStyleName( const OUString& rStyleName ) if( rStyleName.startsWithIgnoreAsciiCase( maCFStyleNamePrefix2 ) ) return true; + if (rStyleName.startsWithIgnoreAsciiCase(maCFStyleNamePrefix3)) + return true; + return false; } |