From 7032be2e9edd82dad2d67f1582aaa57676bda4a1 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 20 Nov 2020 12:03:21 +0100 Subject: [PATCH] tdf#127086 PPT export: fix lost bitmap fill for OOXML custom shapes PPT can't store an OOXML custom shape with fill bitmap, PowerPoint generates a fallback bitmap when saving to PPT. We used to keep the bitmap and loose the custom shape geometry, but that was changed with commit f4ba484183a1e7b9824f10580d633466c266828f (ooxml import: supprt cropping to shape, 2019-05-13). Fix the regression by going back to keeping the bitmap, a full fallback bitmap (ala PowerPoint), would be more work, taking e.g. blurry shadows (changing the shape position and size) into account. Change-Id: I7192f912077f2de026573855dbebbdf576e39ebc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106219 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sd/CppunitTest_sd_filter_eppt.mk | 45 ++++++++++ sd/Module_sd.mk | 1 + .../eppt/data/custom-shape-bitmap-fill.pptx | Bin 0 -> 24802 bytes sd/qa/filter/eppt/eppt.cxx | 83 ++++++++++++++++++ sd/source/filter/eppt/epptso.cxx | 18 +++- 5 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 sd/CppunitTest_sd_filter_eppt.mk create mode 100644 sd/qa/filter/eppt/data/custom-shape-bitmap-fill.pptx create mode 100644 sd/qa/filter/eppt/eppt.cxx diff --git a/sd/CppunitTest_sd_filter_eppt.mk b/sd/CppunitTest_sd_filter_eppt.mk new file mode 100644 index 000000000000..1a58e113643e --- /dev/null +++ b/sd/CppunitTest_sd_filter_eppt.mk @@ -0,0 +1,45 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sd_filter_eppt)) + +$(eval $(call gb_CppunitTest_use_externals,sd_filter_eppt,\ + boost_headers \ +)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sd_filter_eppt, \ + sd/qa/filter/eppt/eppt \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sd_filter_eppt, \ + comphelper \ + cppu \ + sdfilt \ + sal \ + test \ + unotest \ + utl \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,sd_filter_eppt)) + +$(eval $(call gb_CppunitTest_use_ure,sd_filter_eppt)) +$(eval $(call gb_CppunitTest_use_vcl,sd_filter_eppt)) + +$(eval $(call gb_CppunitTest_use_rdb,sd_filter_eppt,services)) + +$(eval $(call gb_CppunitTest_use_custom_headers,sd_filter_eppt,\ + officecfg/registry \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sd_filter_eppt)) + +# vim: set noet sw=4 ts=4: diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk index 7ded538d3be0..2aa512f0fa29 100644 --- a/sd/Module_sd.mk +++ b/sd/Module_sd.mk @@ -41,6 +41,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sd,\ CppunitTest_sd_html_export_tests \ CppunitTest_sd_activex_controls_tests \ CppunitTest_sd_pdf_import_test \ + CppunitTest_sd_filter_eppt \ )) endif diff --git a/sd/qa/filter/eppt/data/custom-shape-bitmap-fill.pptx b/sd/qa/filter/eppt/data/custom-shape-bitmap-fill.pptx new file mode 100644 index 0000000000000000000000000000000000000000..b37d7b6a8853a434700988b7e43c2e6f3334d89c GIT binary patch literal 24802 zcmeFXWmsfe(k7a?ySuwX;SPnnyE_!_?(XhZSmEyOQn(cE?oQzh=XCe<>Hd1|bMKvh z^UcbPv>j{big@-L@kXpIF9iaM3IGQ{0ssIaKt7w(VI&X$Pz4SEpa39&wS;YLoJ?$- z^pxH0OdNIS-K@V6eg_4n%mV;_>i^&I-`E2UDx)@ijEJ3TC;VT#RKxQ_%gP{e+p^jS zlYRU$r318V>)^IwPGpW7GiOv3LZ;~BEmD*Bn+pKThs(B(8Qm~> zLfc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p|cUduD>k8#3}C?#8OA`bQ1U$}IDU`Qd{uLgV529sj7O>Wlq zV3S!=ilGvXexO%=xxDcH*v5E2ayVbaT3Uqu8dj1aR)R)r!$E&#IB<|5GQ3Kz2viiD zd_jAoBCx`2PG|$8KbOdXSLshXoZDIAA72{0=C2-UdDmM0MNq;av;)yRWJD+}o?$$cLUtm8ec(1?yILR+7=Yw$tNlONQBpBd$mFh^ z36Ki8Ek=r*+*aVG*alMmj?f4BA+ViRm>psXFbVcFZZEHoa);MPvd$*094WnQw{n?` zd!&Ejy7s^fNLgm2%B1M8UFGM%?Cw{ke=3uLz)0mtK`Fa(qdNRTp-N60JTT%hiMdPkOy7rF1z9l57Iq5oK z*Zh;tj`_Y-1F8A`+3T(`2$Z0=r+5FJ%aU5}AC&i6uN&;K{y9Wzou>qDKOhh@@Z<%i K%LPW;-~JD@jpzLU literal 0 HcmV?d00001 diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx new file mode 100644 index 000000000000..d1d7cdd029c3 --- /dev/null +++ b/sd/qa/filter/eppt/eppt.cxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include + +#include +#include +#include + +#include +#include + +using namespace ::com::sun::star; + +namespace +{ +/// Covers sd/source/filter/eppt/ fixes. +class Test : public test::BootstrapFixture, public unotest::MacrosTest +{ +private: + uno::Reference mxComponent; + +public: + void setUp() override; + void tearDown() override; + uno::Reference& getComponent() { return mxComponent; } +}; + +void Test::setUp() +{ + test::BootstrapFixture::setUp(); + + mxDesktop.set(frame::Desktop::create(mxComponentContext)); +} + +void Test::tearDown() +{ + if (mxComponent.is()) + mxComponent->dispose(); + + test::BootstrapFixture::tearDown(); +} + +char const DATA_DIRECTORY[] = "/sd/qa/filter/eppt/data/"; + +CPPUNIT_TEST_FIXTURE(Test, testOOXMLCustomShapeBitmapFill) +{ + // Save the bugdoc to PPT. + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "custom-shape-bitmap-fill.pptx"; + getComponent() = loadFromDesktop(aURL); + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + uno::Reference xStorable(getComponent(), uno::UNO_QUERY); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("MS PowerPoint 97"); + xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + getComponent()->dispose(); + getComponent() = loadFromDesktop(aTempFile.GetURL()); + + // Check if the bitmap shape was lost. + uno::Reference xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference xDrawPages = xDrawPagesSupplier->getDrawPages(); + uno::Reference xDrawPage(xDrawPages->getByIndex(0), uno::UNO_QUERY); + uno::Reference xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: com.sun.star.drawing.GraphicObjectShape + // - Actual : com.sun.star.drawing.CustomShape + // i.e. the custom shape geometry was kept, but the actual bitmap was lost. + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GraphicObjectShape"), + xShape->getShapeType()); +} +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 92ee21a6f5c6..b17dc66364e9 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1666,6 +1666,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a bool bClosedBezier = mType == "drawing.ClosedBezier"; bool bPolyPolygon = mType == "drawing.PolyPolygon"; bool bPolyLine = mType == "drawing.PolyLine"; + OUString aGraphicPropertyName("Graphic"); const css::awt::Size aSize100thmm( mXShape->getSize() ); const css::awt::Point aPoint100thmm( mXShape->getPosition() ); @@ -1700,6 +1701,20 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a css::drawing::FillStyle eFS; aAny >>= eFS; bIsHatching = eFS == css::drawing::FillStyle_HATCH; + if (mType == "drawing.Custom" && eFS == drawing::FillStyle_BITMAP) + { + ShapeFlag nMirrorFlags; + OUString sCustomShapeType; + MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( + mXShape, nMirrorFlags, sCustomShapeType); + if (eShapeType == mso_sptMax) + { + // We can't map this custom shape to a PPT preset and it has a bitmap + // fill. Make sure that at least the bitmap fill is not lost. + mType = "drawing.GraphicObject"; + aGraphicPropertyName = "FillBitmap"; + } + } } if ( bIsHatching || bIsFontwork || ( mType == "drawing.Measure" ) || ( mType == "drawing.Caption" ) ) { @@ -2216,7 +2231,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty, aSolverContainer ); - if ( aPropOpt.CreateGraphicProperties( mXPropSet, "Graphic", false, true ) ) + if (aPropOpt.CreateGraphicProperties(mXPropSet, aGraphicPropertyName, false, + true)) { aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); }