sw/qa/extras/ooxmlexport/data/bnc884615.docx |binary sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 6 ++++++ writerfilter/source/dmapper/DomainMapper.cxx | 2 +- writerfilter/source/dmapper/OLEHandler.cxx | 10 ++++++++-- writerfilter/source/dmapper/OLEHandler.hxx | 4 +++- 5 files changed, 18 insertions(+), 4 deletions(-)
New commits: commit 5360af296a67d40d9172a877a674f454eed8fa98 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Jul 4 16:38:40 2014 +0200 bnc#884615 VML import: import OLE objects in header with background wrapping We already do this for drawingML shapes since commit 500343105707a9905f5198a4af6ad58fe307b7c2 (DOCX drawingML shape import: always set Opaque, 2013-12-04), make the VML / OLE case behave the same as well. (cherry picked from commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5) Conflicts: sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx Change-Id: Ic22f1f3cfd325ccbbb9bd6fe9814553683e4de55 Reviewed-on: https://gerrit.libreoffice.org/10088 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615.docx b/sw/qa/extras/ooxmlexport/data/bnc884615.docx new file mode 100755 index 0000000..51ee5ca Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc884615.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index f3ebd43..142d087 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1513,6 +1513,12 @@ DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(21600), aSubViewSize[0].Height); } +DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") +{ + // The problem was that the shape in the header wasn't in the background. + CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(getShape(1), "Opaque"))); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 98286c3..b854738 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2211,7 +2211,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { - OLEHandlerPtr pOLEHandler( new OLEHandler ); + OLEHandlerPtr pOLEHandler( new OLEHandler(*this) ); pProperties->resolve(*pOLEHandler); if ( pOLEHandler->isOLEObject( ) ) { diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 1976a13..a07b443 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <OLEHandler.hxx> +#include <dmapper/DomainMapper.hxx> #include <PropertyMap.hxx> #include "GraphicHelpers.hxx" @@ -45,11 +46,12 @@ namespace dmapper { using namespace ::com::sun::star; -OLEHandler::OLEHandler() : +OLEHandler::OLEHandler(DomainMapper& rDomainMapper) : LoggedProperties(dmapper_logger, "OLEHandler"), m_nDxaOrig(0), m_nDyaOrig(0), - m_nWrapMode(1) + m_nWrapMode(1), + m_rDomainMapper(rDomainMapper) { } @@ -104,6 +106,10 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal) try { + // Shapes in the header or footer should be in the background. + if (m_rDomainMapper.IsInHeaderFooter()) + xShapeProps->setPropertyValue("Opaque", uno::makeAny(false)); + m_aShapeSize = xTempShape->getSize(); m_aShapePosition = xTempShape->getPosition(); diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx index 00b4d8a..9e22fc1 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -40,6 +40,7 @@ namespace com{ namespace sun{ namespace star{ namespace writerfilter { namespace dmapper { +class DomainMapper; /** Handler for OLE objects */ class OLEHandler : public LoggedProperties @@ -63,6 +64,7 @@ class OLEHandler : public LoggedProperties ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; + DomainMapper& m_rDomainMapper; // Properties virtual void lcl_attribute(Id Name, Value & val) SAL_OVERRIDE; @@ -73,7 +75,7 @@ class OLEHandler : public LoggedProperties const OUString& sObjectName ); public: - OLEHandler(); + OLEHandler(DomainMapper& rDomainMapper); virtual ~OLEHandler(); inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; };
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits