sw/qa/extras/ooxmlexport/data/bnc884615.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.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 2c163f8261fc7e66b83089db0a9db58246fc1f6d 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/10090 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.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/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ccb299d..bd8051a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2079,6 +2079,12 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") CPPUNIT_ASSERT(contents.match("15")); } +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 b7fdc9b..ff8428f 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3467,7 +3467,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType 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 44e4f4b..1ace46d 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 63e9207..d7106b1 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -41,6 +41,7 @@ namespace com{ namespace sun{ namespace star{ namespace writerfilter { namespace dmapper { +class DomainMapper; /** Handler for OLE objects */ class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties @@ -64,13 +65,14 @@ class WRITERFILTER_DLLPRIVATE 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); virtual void lcl_sprm(Sprm & sprm); 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