diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2023-05-16 20:46:28 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2023-05-16 21:57:28 +0200 |
commit | 04ae198019cf2c6593023f9ef630e4e99f65defe (patch) | |
tree | 88e0b379d842277355fc67609c862e9df5d91d6f /oox/qa | |
parent | 325fe7ab507fd8f2ca17a3db32181edf30169525 (diff) |
tdf#155327 Detect default color in WordArt
It is possible to not set the character color explicitely in a WordArt
shape. In such case MS Office uses the scheme color 'tx1' from current
active scheme. The import of the character properties does not set this
color in the fill properties. The patch adds it, when the character fill
properties are converted to shape fill properties.
Change-Id: Ic72fd9f55bac1e2874cbf701ffa692ca4fbc9435
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151851
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'oox/qa')
-rw-r--r-- | oox/qa/unit/data/tdf155327_WordArtDefaultColor.pptx | bin | 0 -> 19757 bytes | |||
-rw-r--r-- | oox/qa/unit/shape.cxx | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/oox/qa/unit/data/tdf155327_WordArtDefaultColor.pptx b/oox/qa/unit/data/tdf155327_WordArtDefaultColor.pptx Binary files differnew file mode 100644 index 000000000000..a813f4a329a6 --- /dev/null +++ b/oox/qa/unit/data/tdf155327_WordArtDefaultColor.pptx diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx index 722d7d6d644b..68ce372335df 100644 --- a/oox/qa/unit/shape.cxx +++ b/oox/qa/unit/shape.cxx @@ -795,6 +795,23 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWordArtBitmapFill) CPPUNIT_ASSERT_EQUAL(sal_Int32(1592), aSize100thMM.Width); CPPUNIT_ASSERT_EQUAL(sal_Int32(1592), aSize100thMM.Height); } + +CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWordArtDefaultColor) +{ + // The document has a WordArt shape for which the text color is not explicitly set. In such cases + // MS Office uses the scheme color 'tx1'. Without fix it was imported as 'fill none'. The shape + // existed but was not visible on screen. + loadFromURL(u"tdf155327_WordArtDefaultColor.pptx"); + + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xShapeProps(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(uno::Any(drawing::FillStyle_SOLID), + xShapeProps->getPropertyValue(u"FillStyle")); + + CPPUNIT_ASSERT_EQUAL(uno::Any(Color(3, 74, 144)), xShapeProps->getPropertyValue(u"FillColor")); +} CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |