oox/source/drawingml/fillproperties.cxx | 4 +++- sd/qa/unit/data/pptx/tdf128596.pptx |binary sd/qa/unit/import-tests2.cxx | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)
New commits: commit 259a8e59107bb0a3d4f4f4bb7e056ce1e4231da2 Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Thu Feb 3 15:13:33 2022 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Mon Feb 28 14:15:22 2022 +0100 tdf#128596 PPTX import: fix default tiled bitmap fill OOXML bitmap fill element a:blipFill has got default tiled area setting without explicit a:tile in MSO. Previous import of bitmap fill as "BitmapMode_NO_REPEAT" instead of BitmapMode_REPEAT resulted missing or incomplete area fill of shapes and other objects. Change-Id: Idf94f4450980f67172a0126784b3e08cc5c178c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129483 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 2b682bcd1b99..49906cc9b10f 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -221,7 +221,9 @@ BitmapMode lclGetBitmapMode( sal_Int32 nToken ) case XML_tile: return BitmapMode_REPEAT; case XML_stretch: return BitmapMode_STRETCH; } - return BitmapMode_NO_REPEAT; + + // tdf#128596 Default value is XML_tile for MSO. + return BitmapMode_REPEAT; } RectanglePoint lclGetRectanglePoint( sal_Int32 nToken ) diff --git a/sd/qa/unit/data/pptx/tdf128596.pptx b/sd/qa/unit/data/pptx/tdf128596.pptx new file mode 100644 index 000000000000..62a166308dc2 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf128596.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 7c0844e354b9..2654e6f6290e 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -128,6 +128,7 @@ public: void testTdf103347(); void testHyperlinksOnShapes(); void testTdf112209(); + void testTdf128596(); CPPUNIT_TEST_SUITE(SdImportTest2); @@ -192,6 +193,7 @@ public: CPPUNIT_TEST(testTdf103347); CPPUNIT_TEST(testHyperlinksOnShapes); CPPUNIT_TEST(testTdf112209); + CPPUNIT_TEST(testTdf128596); CPPUNIT_TEST_SUITE_END(); }; @@ -1890,6 +1892,21 @@ void SdImportTest2::testTdf112209() xDocShRef->DoClose(); } +void SdImportTest2::testTdf128596() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf128596.pptx"), PPTX); + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef), + uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xShape.is()); + + css::drawing::BitmapMode bitmapmode; + xShape->getPropertyValue("FillBitmapMode") >>= bitmapmode; + CPPUNIT_ASSERT_EQUAL(css::drawing::BitmapMode_REPEAT, bitmapmode); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2); CPPUNIT_PLUGIN_IMPLEMENT();