oox/source/export/shapes.cxx | 8 +++++++- sd/qa/unit/data/pptx/tdf164936.pptx |binary sd/qa/unit/export-tests.cxx | 19 +++++++++++++++++++ sd/qa/unit/import-tests.cxx | 18 ------------------ 4 files changed, 26 insertions(+), 19 deletions(-)
New commits: commit 5886300f42d40a8a7dfed6a6fe8890c579d36ff3 Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Mon Mar 10 15:14:22 2025 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Mar 17 14:19:03 2025 +0100 tdf#165636 - FILESAVE PPTX: fix extra table border lines shown Export correctly the transparency value of table borders. Change-Id: I22ee5e29d1846295645ce5934149cf864a178bb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182741 Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de> (cherry picked from commit d532407e12c41c508329b7926164926e2c59fde1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182825 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index e7dc5f4ef307..261bd5a24040 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -2517,7 +2517,13 @@ void ShapeExport::WriteBorderLine(const sal_Int32 xml_line_element, const Border if ( rBorderLine.Color == sal_Int32( COL_AUTO ) ) mpFS->singleElementNS(XML_a, XML_noFill); else - DrawingML::WriteSolidFill( ::Color(ColorTransparency, rBorderLine.Color) ); + { + ::Color nColor(ColorTransparency, rBorderLine.Color); + if (nColor.IsTransparent()) + DrawingML::WriteSolidFill( nColor, nColor.GetAlpha() ); + else + DrawingML::WriteSolidFill( nColor ); + } OUString sBorderStyle; sal_Int16 nStyle = rBorderLine.LineStyle; diff --git a/sd/qa/unit/data/pptx/tdf164936.pptx b/sd/qa/unit/data/pptx/tdf164936.pptx index 370ead21bbc5..e33b9fb499bc 100644 Binary files a/sd/qa/unit/data/pptx/tdf164936.pptx and b/sd/qa/unit/data/pptx/tdf164936.pptx differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 9015eca50e09..14c3c4a04232 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -2101,6 +2101,25 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testSvgImageSupport) } } +CPPUNIT_TEST_FIXTURE(SdExportTest, testTableBordersTransparancy) +{ + createSdImpressDoc("pptx/tdf164936.pptx"); + saveAndReload(u"Impress Office Open XML"_ustr); + + const SdrPage* pPage = GetPage(1); + sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0)); + CPPUNIT_ASSERT(pTableObj); + + uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xCellPropSet; + table::BorderLine2 aBorderLine; + + xCellPropSet.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); + xCellPropSet->getPropertyValue(u"LeftBorder"_ustr) >>= aBorderLine; + CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xff2670c9), + Color(ColorTransparency, aBorderLine.Color)); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index bde573807b78..41beb185e0c6 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -305,24 +305,6 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle) CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nFillColor); } -CPPUNIT_TEST_FIXTURE(SdImportTest, testTableBorderTransparent) -{ - createSdImpressDoc("pptx/tdf164936.pptx"); - const SdrPage* pPage = GetPage(1); - - sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0)); - CPPUNIT_ASSERT(pTableObj); - - uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); - uno::Reference<beans::XPropertySet> xCellPropSet; - table::BorderLine2 aBorderLine; - - xCellPropSet.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); - xCellPropSet->getPropertyValue(u"LeftBorder"_ustr) >>= aBorderLine; - CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xff2670c9), - Color(ColorTransparency, aBorderLine.Color)); -} - CPPUNIT_TEST_FIXTURE(SdImportTest, testFreeformShapeGluePoints) { createSdImpressDoc("pptx/tdf156829.pptx");