oox/qa/unit/data/tdf163803_image_with_fill.pptx |binary oox/qa/unit/export.cxx | 16 ++++++++++++++++ oox/source/export/shapes.cxx | 1 + sc/qa/unit/data/ods/autofilter-colbutton.ods |binary sc/qa/unit/subsequent_export_test2.cxx | 13 +++++++++++++ sc/source/filter/excel/excrecds.cxx | 4 ++-- 6 files changed, 32 insertions(+), 2 deletions(-)
New commits: commit 25d3d5f99009aa4ae94b0bc9f31a9faf3e39b0fd Author: Gülşah Köse <[email protected]> AuthorDate: Thu Nov 14 10:44:47 2024 +0300 Commit: Andras Timar <[email protected]> CommitDate: Tue Nov 19 08:12:24 2024 +0100 Fix the wrong detection of hidden autofilter button Regression caused by 2942fdc8dbda375622d0add8c36df2d6679e321a OOXML <filterColumn colId="0"> Autofilter range colID is not absolute id. It starts always with 0 even if the autofiltered range doesn't start with col 0 in the document. So we are checking the flag from document (rDoc), not from the autofiltered range. So we should use absolute column id to get right flag. Signed-off-by: Gülşah Köse <[email protected]> Change-Id: I1f94058caa23686596d57dd6983ddf02cd8f5e71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176564 Reviewed-by: Szymon Kłos <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> (cherry picked from commit e43c2c640ec62864f79962cc345d206c2caafffb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176706 Tested-by: Andras Timar <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/sc/qa/unit/data/ods/autofilter-colbutton.ods b/sc/qa/unit/data/ods/autofilter-colbutton.ods new file mode 100644 index 000000000000..87d49ef2a4ec Binary files /dev/null and b/sc/qa/unit/data/ods/autofilter-colbutton.ods differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index c0b17e11aeb8..a423711d91fa 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -536,6 +536,19 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterTop10XLSX) assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:top10"_ostr, "val"_ostr, "4"); } +CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColButton) +{ + // Without fix it will fail + // - Expression: !xmlGetProp(pXmlNode, BAD_CAST(rAttribute.getStr())) + // - In <>, XPath '//x:autoFilter/x:filterColumn' unexpected 'hiddenButton' attribute + createScDoc("ods/autofilter-colbutton.ods"); + + save("Calc Office Open XML"); + xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml"); + CPPUNIT_ASSERT(pDoc); + assertXPathNoAttribute(pDoc, "//x:autoFilter/x:filterColumn"_ostr, "hiddenButton"_ostr); +} + CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf88657ODS) { createScDoc("ods/tdf88657.ods"); diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index f18e9f829bbe..2350e803a24d 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -993,10 +993,10 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab, const bContLoop = rEntry.bDoQuery; if( bContLoop ) { - SCCOL nCol = static_cast<SCCOL>( rEntry.nField ) - aRange.aStart.Col(); + SCCOL nCol = static_cast<SCCOL>(rEntry.nField); + XclExpAutofilter* pFilter = GetByCol( nCol - aRange.aStart.Col() ); auto nFlag = rDoc.GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG )->GetValue(); bool bIsButtonHidden = !( nFlag & ScMF::Auto ); - XclExpAutofilter* pFilter = GetByCol( nCol ); pFilter->SetButtonHidden( bIsButtonHidden ); if( nEntry > 0 ) commit d8d29c119bd80f81b68cd0f4d00d60b9908e280c Author: Jaume Pujantell <[email protected]> AuthorDate: Thu Nov 7 12:52:31 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Nov 19 08:12:24 2024 +0100 tdf#163803 oox: export fill on graphic object The fill contents of a graphic object are lost when saving a pptx. Change-Id: I055d778d4a92de18dfec59bd27c63a20c08b99f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176208 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit dfd8caa6c49bd33f549a37d6c0244e4cce8f16d8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176708 Tested-by: Andras Timar <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/oox/qa/unit/data/tdf163803_image_with_fill.pptx b/oox/qa/unit/data/tdf163803_image_with_fill.pptx new file mode 100644 index 000000000000..db45264fb304 Binary files /dev/null and b/oox/qa/unit/data/tdf163803_image_with_fill.pptx differ diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index bfee2e7ef8b3..8cf1ce0496bd 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -1420,6 +1420,22 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) assertXPathNoAttribute(pXmlDoc, "//p:sp[1]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr); assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr, "none"); } + +CPPUNIT_TEST_FIXTURE(Test, testTdf163803_ImageFill) +{ + loadFromFile(u"tdf163803_image_with_fill.pptx"); + save("Impress Office Open XML"); + + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + // Check that the fill color is saved: + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 0 + // - In <>, XPath '//p:pic/p:spPr/a:solidFill' number of nodes is incorrect + // i.e. the <a:solidFill> element was not written. + assertXPath(pXmlDoc, "//p:pic/p:spPr/a:solidFill"_ostr); + assertXPath(pXmlDoc, "//p:pic/p:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "000000"); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 5997728e316b..c14b6e872f1a 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1469,6 +1469,7 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape } WriteShapeTransformation( xShape, XML_a, bFlipH, false, false, false, true ); WritePresetShape( "rect"_ostr ); + WriteFill(xShapeProps); // graphic object can come with the frame (bnc#654525) WriteOutline( xShapeProps );
