diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-08-18 17:43:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-08-18 21:51:22 +0200 |
commit | b2d834d6727626f070bb4dde3e1c65da1169f729 (patch) | |
tree | 7fdce9d90a25aef9530357aec30556a719a27235 /oox/qa | |
parent | 54691ea52a91491ae251473c83b61f9adaf0b581 (diff) |
tdf#132555 PPTX VML import: handle stroke properties of image shapes
ComplexShape::implConvertAndInsert() returns early in the graphic object
shape case, so stroke model is not applied at all.
Also fix a problem in ShapeBase::finalizeFragmentImport(), where the
shape type had no stroke, but the shape itself had, and the later should
win.
The warning in OleObjectGraphicDataContext::onCreateContext() now points
out that <mc:AlternateContent> is ignored as a child of <a:graphicData>,
which probably should be addressed at some stage, but it's not required
to fix the missing stroke.
Change-Id: I4ab43b4c6d40d9f43caad22b85f5b885fa8b4ef1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100952
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'oox/qa')
-rw-r--r-- | oox/qa/unit/data/graphic-stroke.pptx | bin | 0 -> 29396 bytes | |||
-rw-r--r-- | oox/qa/unit/vml.cxx | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/oox/qa/unit/data/graphic-stroke.pptx b/oox/qa/unit/data/graphic-stroke.pptx Binary files differnew file mode 100644 index 000000000000..f4465476fcc6 --- /dev/null +++ b/oox/qa/unit/data/graphic-stroke.pptx diff --git a/oox/qa/unit/vml.cxx b/oox/qa/unit/vml.cxx index 089d61085b74..d43d2d5645ae 100644 --- a/oox/qa/unit/vml.cxx +++ b/oox/qa/unit/vml.cxx @@ -11,8 +11,10 @@ #include <unotest/macros_test.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/frame/Desktop.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/text/WritingMode2.hpp> using namespace ::com::sun::star; @@ -109,6 +111,36 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testShapeNonAutosizeWithText) CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5398), xShape->getSize().Width); } +CPPUNIT_TEST_FIXTURE(OoxVmlTest, testGraphicStroke) +{ + load("graphic-stroke.pptx"); + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + + uno::Reference<beans::XPropertySet> xShape; + for (sal_Int32 i = 0; i < xDrawPage->getCount(); ++i) + { + uno::Reference<lang::XServiceInfo> xInfo(xDrawPage->getByIndex(i), uno::UNO_QUERY); + if (!xInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) + { + continue; + } + + xShape.set(xInfo, uno::UNO_QUERY); + break; + } + CPPUNIT_ASSERT(xShape.is()); + + drawing::LineStyle eLineStyle{}; + xShape->getPropertyValue("LineStyle") >>= eLineStyle; + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 0 + // i.e. line style was NONE, not SOLID. + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, eLineStyle); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |