From b399c1a38cf7217bf530af3a78e8472d97890ac8 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 29 Apr 2013 15:41:37 +0200 Subject: n#592908: docx import, fixed handling of w10:wrap commit f837c4288cdae4921b3fb6747ba2e2cd5ce2dcd2 moved the handling of w10:wrap tag in oox, but thus no wrapping was imported any more. The fix consists in letting the w10:wrap element be handled by writerfilter's dmapper if the shape has already been retrieved from oox (which is the case for textboxes). In other cases, make sure that we don't set the Surround property once again in writerfilter as that would override what has been done in oox. (cherry picked from commit 51d5e90b7c09cb980bc72a2c6b1a65303ef15ea2) Conflicts: oox/inc/oox/vml/vmlshape.hxx sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I8ab158641afcf6b9945c52238e7f5adb9e8b3adf --- writerfilter/source/dmapper/OLEHandler.cxx | 12 +----------- writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 8 ++++---- writerfilter/source/ooxml/OOXMLFastContextHandler.hxx | 2 ++ 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index ae4490f30cc3..e2a333535ecb 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -113,17 +113,7 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal) { SAL_WARN("writerfilter", "Exception in OLE Handler: " << e.Message); } - - try - { - xShapeProps->setPropertyValue( - rNameSupplier.GetName( PROP_SURROUND ), - uno::makeAny( m_nWrapMode ) ); - } - catch( const uno::Exception& e ) - { - SAL_WARN("writerfilter", "Exception while setting wrap mode: " << e.Message); - } + // No need to set the wrapping here as it's either set in oox or will be set later } } break; diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index 8c02cca4bcbc..f4a7924432ea 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -2283,11 +2283,14 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext bool bInNamespaces = mMyNamespaces.find(nNameSpace) != mMyNamespaces.end(); bool bInTokens = mMyTokens.find( Element ) != mMyTokens.end( ); + OOXMLFastContextHandlerShape* pShapeCtx = (OOXMLFastContextHandlerShape*)mpParent; + // We have methods to _add_ individual tokens or whole namespaces to be // processed by writerfilter (instead of oox), but we have no method to // filter out a single token. Just hardwire the wrap token here till we // need a more generic solution. - if ( bInNamespaces && Element != static_cast(NS_vml_wordprocessingDrawing | OOXML_wrap) ) + bool bIsWrap = Element == static_cast(NS_vml_wordprocessingDrawing | OOXML_wrap); + if ( bInNamespaces && ((pShapeCtx->isShapeSent() && bIsWrap) || !bIsWrap) ) xResult.set(OOXMLFactory::getInstance()->createFastChildContextFromStart(this, Element)); else if (mxContext.is()) { @@ -2302,10 +2305,7 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext xResult.set(this); if ( bInTokens ) - { - OOXMLFastContextHandlerShape* pShapeCtx = (OOXMLFastContextHandlerShape*)mpParent; pShapeCtx->sendShape( Element ); - } return xResult; } diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx index b47f611046a8..b1941b65c179 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx @@ -531,6 +531,7 @@ public: virtual ResourceEnum_t getResource() const { return SHAPE; } void sendShape( Token_t Element ); + bool isShapeSent( ) { return m_bShapeSent; } protected: typedef uno::Reference ShapeContextRef; @@ -633,6 +634,7 @@ private: set mMyNamespaces; set mMyTokens; OOXMLPropertySet::Pointer_t mpPropertySet; + bool mbShapeSent; OOXMLFastContextHandler * getFastContextHandler() const; }; -- cgit ora/lov-5.0'>distro/collabora/lov-5.0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-10-14 16:51:32 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-10-14 16:51:32 +0200
commit72d4ce6f24383176d923b8d7088e3bbe58e3c623 (patch)
treea20edb5b004ab6b84c5d84ce18577d94c05e9b9d /xmloff/source/core/DomBuilderContext.cxx
parentbae3c4fc5c82496561d2b156765ebf2257973437 (diff)
CMIS: fixed regression for Checkin/out entries in Files menu