From cbf66ec3e60d07efb7c3cceed9b4f0fb4f0510c8 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Thu, 10 Mar 2022 08:42:12 +0100 Subject: [PATCH] tdf#89449 PPTX import: fix line connectors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Line connectors were imported as plain shapes, losing their functionality during editing, i.e. keeping connections of boxes and other shapes. Change-Id: I0f1562be2dbcce0e45eb209c6ca4e035731039e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131303 Tested-by: László Németh Reviewed-by: László Németh --- .../oox/drawingml/connectorshapecontext.hxx | 15 +- include/oox/drawingml/shape.hxx | 11 + include/oox/ppt/slidepersist.hxx | 4 + oox/inc/drawingml/customshapeproperties.hxx | 1 - .../drawingml/chart/chartdrawingfragment.cxx | 3 +- .../drawingml/connectorshapecontext.cxx | 84 ++++- .../drawingml/customshapeproperties.cxx | 36 +-- oox/source/drawingml/shape.cxx | 37 ++- oox/source/drawingml/shapegroupcontext.cxx | 3 +- .../drawingml/shapepropertiescontext.cxx | 8 +- oox/source/export/shapes.cxx | 3 +- oox/source/ppt/pptshapegroupcontext.cxx | 6 +- oox/source/ppt/slidepersist.cxx | 70 ++++ oox/source/shape/LockedCanvasContext.cxx | 7 +- sc/source/filter/oox/drawingfragment.cxx | 3 +- sd/qa/unit/data/pptx/tdf89449.pptx | Bin 0 -> 14939 bytes sd/qa/unit/data/xml/fdo47434_0.xml | 188 +---------- sd/qa/unit/data/xml/tdf100491_0.xml | 304 +----------------- sd/qa/unit/export-tests-ooxml2.cxx | 8 +- sd/qa/unit/import-tests.cxx | 39 +++ 20 files changed, 288 insertions(+), 542 deletions(-) create mode 100644 sd/qa/unit/data/pptx/tdf89449.pptx diff --git a/include/oox/drawingml/connectorshapecontext.hxx b/include/oox/drawingml/connectorshapecontext.hxx index 1efdd2e40611..c9819ae85137 100644 --- a/include/oox/drawingml/connectorshapecontext.hxx +++ b/include/oox/drawingml/connectorshapecontext.hxx @@ -25,16 +25,29 @@ #include #include #include +#include namespace oox { class AttributeList; } namespace oox::core { class ContextHandler2Helper; } namespace oox::drawingml { + struct ConnectorShapeProperties + { + bool mbStartShape; + OUString maDestShapeId; + sal_Int32 mnDestGlueId; + }; + class OOX_DLLPUBLIC ConnectorShapeContext final : public ShapeContext { + std::vector& mrConnectorShapePropertiesList; + ShapePtr mpConnectorShapePtr; + public: - ConnectorShapeContext( ::oox::core::ContextHandler2Helper const & rParent, const ShapePtr& pMasterShapePtr, const ShapePtr& pGroupShapePtr ); + ConnectorShapeContext(::oox::core::ContextHandler2Helper const& rParent, + const ShapePtr& pMasterShapePtr, const ShapePtr& pGroupShapePtr, + std::vector& rConnectorShapePropertiesList); virtual ~ConnectorShapeContext() override; virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; }; diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index 734e805ccac5..a16e65a71ef1 100644 --- a/include/oox/drawingml/shape.hxx +++ b/include/oox/drawingml/shape.hxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,8 @@ typedef std::shared_ptr< CustomShapeProperties > CustomShapePropertiesPtr; typedef ::std::map< OUString, ShapePtr > ShapeIdMap; +typedef std::vector ConnectorShapePropertiesList; + struct ShapeStyleRef { Color maPhClr; @@ -128,6 +131,10 @@ public: CustomShapePropertiesPtr& getCustomShapeProperties(){ return mpCustomShapePropertiesPtr; } + ConnectorShapePropertiesList& getConnectorShapeProperties() { return maConnectorShapePropertiesList; } + void setConnectorShape(bool bConnector) { mbConnector = bConnector; } + bool isConnectorShape() const { return mbConnector; } + Shape3DProperties& get3DProperties() { return *mp3DPropertiesPtr; } const Shape3DProperties& get3DProperties() const { return *mp3DPropertiesPtr; } @@ -332,6 +339,7 @@ protected: PropertyMap maDefaultShapeProperties; TextListStylePtr mpMasterTextListStyle; css::uno::Reference< css::drawing::XShape > mxShape; + ConnectorShapePropertiesList maConnectorShapePropertiesList; OUString msServiceName; OUString msName; @@ -394,6 +402,9 @@ private: /// The shape fill should be set to that of the slide background surface. bool mbUseBgFill = false; + // Is this a connector shape? + bool mbConnector = false; + // temporary space for DiagramHelper in preparation for collecting data // Note: I tried to use a unique_ptr here, but existing constructor func does not allow that IDiagramHelper* mpDiagramHelper; diff --git a/include/oox/ppt/slidepersist.hxx b/include/oox/ppt/slidepersist.hxx index c09e5f0b0da0..1b0a92c70783 100644 --- a/include/oox/ppt/slidepersist.hxx +++ b/include/oox/ppt/slidepersist.hxx @@ -125,6 +125,8 @@ public: CommentList& getCommentsList() { return maCommentsList; } CommentAuthorList& getCommentAuthors() { return maCommentAuthors; } + void createConnectorShapeConnection(); + private: OUString maPath; OUString maLayoutPath; @@ -156,6 +158,8 @@ private: // slide comments CommentList maCommentsList; CommentAuthorList maCommentAuthors; + + std::vector maConnectorShapeId; }; } diff --git a/oox/inc/drawingml/customshapeproperties.hxx b/oox/inc/drawingml/customshapeproperties.hxx index 779003412fbb..ea9b9e9d53af 100644 --- a/oox/inc/drawingml/customshapeproperties.hxx +++ b/oox/inc/drawingml/customshapeproperties.hxx @@ -98,7 +98,6 @@ public: CustomShapeProperties(); void pushToPropSet( const css::uno::Reference < css::beans::XPropertySet > & xPropSet, - const css::uno::Reference < css::drawing::XShape > & xShape, const css::awt::Size &aSize ); sal_Int32 getShapePresetType() const { return mnShapePresetType; } diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index c41e2db49821..9509ad4ea01e 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -157,7 +157,8 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con return new ShapeContext( *this, ShapePtr(), mxShape ); case CDR_TOKEN( cxnSp ): mxShape = std::make_shared( "com.sun.star.drawing.ConnectorShape" ); - return new ConnectorShapeContext( *this, ShapePtr(), mxShape ); + return new ConnectorShapeContext(*this, ShapePtr(), mxShape, + mxShape->getConnectorShapeProperties()); case CDR_TOKEN( pic ): mxShape = std::make_shared( "com.sun.star.drawing.GraphicObjectShape" ); return new GraphicShapeContext( *this, ShapePtr(), mxShape ); diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx index e815d56994d9..b1ea90c357af 100644 --- a/oox/source/drawingml/connectorshapecontext.cxx +++ b/oox/source/drawingml/connectorshapecontext.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -35,30 +36,93 @@ using namespace ::com::sun::star::xml::sax; namespace oox::drawingml { -ConnectorShapeContext::ConnectorShapeContext( ContextHandler2Helper const & rParent, - const ShapePtr& pMasterShapePtr, const ShapePtr& pGroupShapePtr ) -: ShapeContext( rParent, pMasterShapePtr, pGroupShapePtr ) +namespace { +class ConnectorShapePropertiesContext : public ::oox::core::ContextHandler2 +{ + std::vector& mrConnectorShapePropertiesList; + ShapePtr mpConnectorShapePtr; + +public: + ConnectorShapePropertiesContext( + ::oox::core::ContextHandler2Helper const& rParent, ShapePtr& pShapePtr, + std::vector& rConnectorShapePropertiesList); + + virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 aElementToken, + const AttributeList& rAttribs) override; +}; } -ConnectorShapeContext::~ConnectorShapeContext() +ConnectorShapePropertiesContext::ConnectorShapePropertiesContext( + ContextHandler2Helper const& rParent, ShapePtr& pShapePtr, + std::vector& rConnectorShapePropertiesList) + : ContextHandler2(rParent) + , mrConnectorShapePropertiesList(rConnectorShapePropertiesList) + , mpConnectorShapePtr(pShapePtr) { + mpConnectorShapePtr->setConnectorShape(true); } -ContextHandlerRef ConnectorShapeContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +::oox::core::ContextHandlerRef +ConnectorShapePropertiesContext::onCreateContext(sal_Int32 aElementToken, + const AttributeList& rAttribs) { - switch( getBaseToken( aElementToken ) ) + switch (getBaseToken(aElementToken)) { - case XML_nvCxnSpPr : - break; - + case XML_cNvPr: + mpConnectorShapePtr->setId(rAttribs.getString(XML_id).get()); + mpConnectorShapePtr->setName(rAttribs.getString(XML_name).get()); + break; + case XML_stCxn: + { + ConnectorShapeProperties aConnectorShapeProps; + aConnectorShapeProps.mbStartShape = true; + aConnectorShapeProps.maDestShapeId = rAttribs.getString(XML_id).get(); + aConnectorShapeProps.mnDestGlueId = rAttribs.getInteger(XML_idx).get(); + mrConnectorShapePropertiesList.push_back(aConnectorShapeProps); + break; + } + case XML_endCxn: + { + ConnectorShapeProperties aConnectorShapeProps; + aConnectorShapeProps.mbStartShape = false; + aConnectorShapeProps.maDestShapeId = rAttribs.getString(XML_id).get(); + aConnectorShapeProps.mnDestGlueId = rAttribs.getInteger(XML_idx).get(); + mrConnectorShapePropertiesList.push_back(aConnectorShapeProps); + break; + } default: - return ShapeContext::onCreateContext( aElementToken, rAttribs ); + break; } return this; } +ConnectorShapeContext::ConnectorShapeContext( + ContextHandler2Helper const& rParent, const ShapePtr& pMasterShapePtr, + const ShapePtr& pGroupShapePtr, + std::vector& rConnectorShapePropertiesList) + : ShapeContext(rParent, pMasterShapePtr, pGroupShapePtr) + , mrConnectorShapePropertiesList(rConnectorShapePropertiesList) + , mpConnectorShapePtr(pGroupShapePtr) +{ +} + +ConnectorShapeContext::~ConnectorShapeContext() {} + +ContextHandlerRef ConnectorShapeContext::onCreateContext(sal_Int32 aElementToken, + const AttributeList& rAttribs) +{ + switch (getBaseToken(aElementToken)) + { + case XML_nvCxnSpPr: + return new ConnectorShapePropertiesContext(*this, mpConnectorShapePtr, + mrConnectorShapePropertiesList); + } + + return ShapeContext::onCreateContext(aElementToken, rAttribs); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index efe7c0ad03af..b748deb48702 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -97,25 +97,8 @@ bool CustomShapeProperties::representsDefaultShape() const CustomShapeProperties::PresetDataMap CustomShapeProperties::maPresetDataMap; -static OUString GetConnectorShapeType( sal_Int32 nType ) -{ - SAL_INFO( - "oox.drawingml", "preset: " << nType << " " << XML_straightConnector1); - - OUString sType; - switch( nType ) - { - case XML_straightConnector1: - sType = "mso-spt32"; - break; - default: - break; - } - return sType; -} - void CustomShapeProperties::pushToPropSet( - const Reference < XPropertySet >& xPropSet, const Reference < XShape > & xShape, const awt::Size &aSize ) + const Reference < XPropertySet >& xPropSet, const awt::Size &aSize ) { if ( mnShapePresetType >= 0 ) { @@ -127,22 +110,7 @@ void CustomShapeProperties::pushToPropSet( PropertyMap aPropertyMap; PropertySet aPropSet( xPropSet ); - OUString sConnectorShapeType = GetConnectorShapeType( mnShapePresetType ); - - if (sConnectorShapeType.getLength() > 0) - { - SAL_INFO( - "oox.drawingml", - "connector shape: " << sConnectorShapeType << " (" - << mnShapePresetType << ")"); - //const uno::Reference < drawing::XShape > xShape( xPropSet, UNO_QUERY ); - Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( xShape, UNO_QUERY ); - if( xDefaulter.is() ) { - xDefaulter->createCustomShapeDefaults( sConnectorShapeType ); - aPropertyMap.setProperty( PROP_Type, sConnectorShapeType ); - } - } - else if (maPresetDataMap.find(mnShapePresetType) != maPresetDataMap.end()) + if (maPresetDataMap.find(mnShapePresetType) != maPresetDataMap.end()) { SAL_INFO( "oox.drawingml", diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index cc988699292e..2ef801c5ee08 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include @@ -867,10 +868,8 @@ Reference< XShape > const & Shape::createAndInsert( bool bIsCroppedGraphic = (aServiceName == "com.sun.star.drawing.GraphicObjectShape" && !mpCustomShapePropertiesPtr->representsDefaultShape()); - // ToDo: Why is ConnectorShape here treated as custom shape, but below with start and end point? - bool bIsCustomShape = ( aServiceName == "com.sun.star.drawing.CustomShape" || - aServiceName == "com.sun.star.drawing.ConnectorShape" || - bIsCroppedGraphic); + bool bIsCustomShape = (aServiceName == "com.sun.star.drawing.CustomShape" || bIsCroppedGraphic); + bool bIsConnectorShape = (aServiceName == "com.sun.star.drawing.ConnectorShape"); if(bIsCroppedGraphic) { aServiceName = "com.sun.star.drawing.CustomShape"; @@ -1653,6 +1652,34 @@ Reference< XShape > const & Shape::createAndInsert( if (mbWps && aServiceName == "com.sun.star.drawing.LineShape" && !pParentGroupShape) mxShape->setPosition(maPosition); + if (bIsConnectorShape) + { + ConnectorType aConnectorType; + sal_Int32 nType = mpCustomShapePropertiesPtr->getShapePresetType(); + switch (nType) + { + case XML_line: + case XML_straightConnector1: + aConnectorType = ConnectorType_LINE; + break; + case XML_bentConnector2: + case XML_bentConnector3: + case XML_bentConnector4: + case XML_bentConnector5: + aConnectorType = ConnectorType_STANDARD; + break; + case XML_curvedConnector2: + case XML_curvedConnector3: + case XML_curvedConnector4: + case XML_curvedConnector5: + aConnectorType = ConnectorType_CURVE; + break; + default: + break; + } + xSet->setPropertyValue("EdgeKind", Any(aConnectorType)); + } + if( bIsCustomShape ) { if ( mbFlipH ) @@ -1701,7 +1728,7 @@ Reference< XShape > const & Shape::createAndInsert( // for these ==cscode== and ==csdata== markers, so don't "clean up" these SAL_INFOs SAL_INFO("oox.cscode", "==cscode== shape name: '" << msName << "'"); SAL_INFO("oox.csdata", "==csdata== shape name: '" << msName << "'"); - mpCustomShapePropertiesPtr->pushToPropSet( xSet, mxShape, maSize ); + mpCustomShapePropertiesPtr->pushToPropSet(xSet, maSize); if (mpTextBody) { diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx index 61aadb45d862..1a9cb4113871 100644 --- a/oox/source/drawingml/shapegroupcontext.cxx +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -85,7 +85,8 @@ ContextHandlerRef ShapeGroupContext::onCreateContext( sal_Int32 aElementToken, c { ShapePtr pShape = std::make_shared("com.sun.star.drawing.ConnectorShape"); pShape->setLockedCanvas(mpGroupShapePtr->getLockedCanvas()); - return new ConnectorShapeContext( *this, mpGroupShapePtr, pShape ); + return new ConnectorShapeContext(*this, mpGroupShapePtr, pShape, + pShape->getConnectorShapeProperties()); } case XML_grpSp: // group shape return new ShapeGroupContext( *this, mpGroupShapePtr, std::make_shared( "com.sun.star.drawing.GroupShape" ) ); diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx index e0fc3274c731..935cc4970c7c 100644 --- a/oox/source/drawingml/shapepropertiescontext.cxx +++ b/oox/source/drawingml/shapepropertiescontext.cxx @@ -62,16 +62,10 @@ ContextHandlerRef ShapePropertiesContext::onCreateContext( sal_Int32 aElementTok { sal_Int32 nToken = rAttribs.getToken( XML_prst, 0 ); // TODO: Move the following checks to a separate place or as a separate function - if ( nToken == XML_line ) + if (nToken == XML_line && !mrShape.isConnectorShape()) { mrShape.getServiceName() = "com.sun.star.drawing.LineShape"; } - if( ( nToken >= XML_bentConnector2 && nToken <= XML_bentConnector5 ) || - ( nToken >= XML_curvedConnector2 && nToken <= XML_curvedConnector5 ) || - nToken == XML_straightConnector1 ) - { - mrShape.getServiceName() = "com.sun.star.drawing.CustomShape"; - } // We got a preset geometry, forget the geometry inherited from the placeholder shape. mrShape.getCustomShapeProperties() = std::make_shared(); diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index ea0e21f457d8..0405c975db0a 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1496,7 +1496,8 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape pFS->startElementNS(mnXmlNamespace, XML_cNvCxnSpPr); WriteConnectorConnections(aConnectorEntry, GetShapeID(rXShapeA), GetShapeID(rXShapeB)); pFS->endElementNS(mnXmlNamespace, XML_cNvCxnSpPr); - pFS->singleElementNS(mnXmlNamespace, XML_nvPr); + if (GetDocumentType() == DOCUMENT_PPTX) + pFS->singleElementNS(mnXmlNamespace, XML_nvPr); pFS->endElementNS(mnXmlNamespace, XML_nvCxnSpPr); } diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 4355f951bc8b..4ca58a383af8 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -90,7 +90,11 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken return new ShapeStyleContext( getParser() ); */ case PPT_TOKEN( cxnSp ): // connector shape - return new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, std::make_shared( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) ); + { + auto pShape = std::make_shared(meShapeLocation, "com.sun.star.drawing.ConnectorShape"); + return new oox::drawingml::ConnectorShapeContext(*this, mpGroupShapePtr, pShape, + pShape->getConnectorShapeProperties()); + } case PPT_TOKEN( grpSp ): // group shape return new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, std::make_shared( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ); case PPT_TOKEN( sp ): // Shape diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index ae9f0f567a7c..061dda725551 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -41,6 +41,9 @@ #include #include #include +#include +#include +#include using namespace ::com::sun::star; using namespace ::oox::core; @@ -143,12 +146,19 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) PPTShape* pPPTShape = dynamic_cast< PPTShape* >( child.get() ); basegfx::B2DHomMatrix aTransformation; if ( pPPTShape ) + { pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() ); + if (pPPTShape->isConnectorShape()) + maConnectorShapeId.push_back(pPPTShape->getId()); + } else child->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), &getShapeMap() ); } } + if (!maConnectorShapeId.empty()) + createConnectorShapeConnection(); + Reference< XAnimationNodeSupplier > xNodeSupplier( getPage(), UNO_QUERY); if( !xNodeSupplier.is() ) return; @@ -330,6 +340,66 @@ Reference SlidePersist::getAnimationNode(const OUString& sId) co return aResult; } +// create connection between two shape with a connector shape. +void SlidePersist::createConnectorShapeConnection() +{ + sal_Int32 nConnectorShapeCount = maConnectorShapeId.size(); + for (sal_Int32 i = 0; i < nConnectorShapeCount; i++) + { + const auto& pIt = maShapeMap.find(maConnectorShapeId[i]); + oox::drawingml::ConnectorShapePropertiesList aConnectorShapeProperties + = pIt->second->getConnectorShapeProperties(); + uno::Reference xConnector(pIt->second->getXShape(), uno::UNO_QUERY); + uno::Reference xPropertySet(xConnector, uno::UNO_QUERY); + + if (xConnector.is()) + { + sal_Int32 nCount = aConnectorShapeProperties.size(); + for (sal_Int32 j = 0; j < nCount; j++) + { + OUString aDestShapeId = aConnectorShapeProperties[j].maDestShapeId; + const auto& pShape = maShapeMap.find(aDestShapeId); + uno::Reference xShape(pShape->second->getXShape(), uno::UNO_QUERY); + uno::Reference xSet(xShape, uno::UNO_QUERY); + if (xShape.is()) + { + uno::Reference xSupplier(xShape, uno::UNO_QUERY); + css::uno::Reference xGluePoints( + xSupplier->getGluePoints(), uno::UNO_QUERY); + + sal_Int32 nCountGluePoints = xGluePoints->getIdentifiers().getLength(); + sal_Int32 nGlueId = aConnectorShapeProperties[j].mnDestGlueId; + + // The first 4 glue points belong to the bounding box. + if (nCountGluePoints > 4) + nGlueId += 4; + else + { + // change id of the left and right glue points of the bounding box (1 <-> 3) + if (nGlueId == 1) + nGlueId = 3; // Right + else if (nGlueId == 3) + nGlueId = 1; // Left + } + + bool bStart = aConnectorShapeProperties[j].mbStartShape; + if (bStart) + { + xPropertySet->setPropertyValue("StartShape", uno::Any(xShape)); + xPropertySet->setPropertyValue("StartGluePointIndex", uno::Any(nGlueId)); + } + else + { + xPropertySet->setPropertyValue("EndShape", uno::Any(xShape)); + xPropertySet->setPropertyValue("EndGluePointIndex", uno::Any(nGlueId)); + } + } + } + } + } + maConnectorShapeId.clear(); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/shape/LockedCanvasContext.cxx b/oox/source/shape/LockedCanvasContext.cxx index 5eac3b5ceff7..19267954cf06 100644 --- a/oox/source/shape/LockedCanvasContext.cxx +++ b/oox/source/shape/LockedCanvasContext.cxx @@ -51,9 +51,10 @@ LockedCanvasContext::onCreateContext(sal_Int32 nElementToken, const ::oox::Attri } case XML_cxnSp: // CT_GvmlConnector { - return new oox::drawingml::ConnectorShapeContext( - *this, mpShapePtr, - std::make_shared("com.sun.star.drawing.ConnectorShape")); + oox::drawingml::ShapePtr pShape + = std::make_shared("com.sun.star.drawing.ConnectorShape"); + return new oox::drawingml::ConnectorShapeContext(*this, mpShapePtr, pShape, + pShape->getConnectorShapeProperties()); } case XML_pic: // CT_GvmlPicture { diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 5ce7b2d21ce5..033720a1bf1e 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -139,7 +139,8 @@ GroupShapeContext::GroupShapeContext( const FragmentHandler2& rParent, { ShapePtr xShape = std::make_shared( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" ); if( pxShape ) *pxShape = xShape; - return new ConnectorShapeContext( rParent, rxParentShape, xShape ); + return new ConnectorShapeContext(rParent, rxParentShape, xShape, + xShape->getConnectorShapeProperties()); } case XDR_TOKEN( pic ): { diff --git a/sd/qa/unit/data/pptx/tdf89449.pptx b/sd/qa/unit/data/pptx/tdf89449.pptx new file mode 100644 index 0000000000000000000000000000000000000000..e55cbf21a9271efcc62af6890fe7d1c4f084ba97 GIT binary patch literal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a&)yq@ zWQ&2R!Q{YG1=}6(1UekWCsta9#4o!v+b1sC73gR=cGv{BJ`^)+S!qA4{$L4YG{#b` zw9n^5^k%J>Yve>gG6SjLP1SIHRo%ovNj^622*>nhT{$39<=f&eKAH z;%W1A$9!8_;L`UEVXgzK#=z_2hBa*d$t|uck%QPHz7sCY?ag&A+x&2`68;1A1LuO! z^7%%a%c}WT!FifNwHRV=PdU!NmfF)gJvvz;s7ie>ceKTgm9*bH`vEue%bqmh4!)Qn z#XiGx6%8|DOZ&RiP6*{@`J&3#J8{J*hgKZ>G$NAYWc-VX!-z!~ay6yG`c$8x>jk^Nqr z^#h$4#0CF}o}V(IeDSaCyswljQ@`L_dN0s%&Yi6Vg8HIpD_PK?my1x@449@n70YO zWBxr;`<=FbAK(6gVUy(FM!SD!@b{zH4 - - - - - + @@ -21,53 +17,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -84,53 +35,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -147,53 +53,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -210,46 +71,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sd/qa/unit/data/xml/tdf100491_0.xml b/sd/qa/unit/data/xml/tdf100491_0.xml index 0c250e6fc840..e45eba130ebf 100644 --- a/sd/qa/unit/data/xml/tdf100491_0.xml +++ b/sd/qa/unit/data/xml/tdf100491_0.xml @@ -1,6 +1,6 @@ - + @@ -17,25 +17,8 @@ - - - - - - - - - - - - - - - - - - + @@ -52,25 +35,8 @@ - - - - - - - - - - - - - - - - - - + @@ -87,25 +53,8 @@ - - - - - - - - - - - - - - - - - - + @@ -122,25 +71,8 @@ - - - - - - - - - - - - - - - - - - + @@ -157,25 +89,8 @@ - - - - - - - - - - - - - - - - - - + @@ -192,25 +107,8 @@ - - - - - - - - - - - - - - - - - - + @@ -227,25 +125,8 @@ - - - - - - - - - - - - - - - - - - + @@ -262,25 +143,8 @@ - - - - - - - - - - - - - - - - - - + @@ -297,25 +161,8 @@ - - - - - - - - - - - - - - - - - - + @@ -332,25 +179,8 @@ - - - - - - - - - - - - - - - - - - + @@ -367,25 +197,8 @@ - - - - - - - - - - - - - - - - - - + @@ -402,25 +215,8 @@ - - - - - - - - - - - - - - - - - - + @@ -437,25 +233,8 @@ - - - - - - - - - - - - - - - - - - + @@ -472,25 +251,8 @@ - - - - - - - - - - - - - - - - - - + @@ -507,25 +269,8 @@ - - - - - - - - - - - - - - - - - - + @@ -542,22 +287,5 @@ - - - - - - - - - - - - - - - - - diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index e99ac6168dd5..6be1222b5c7d 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1540,10 +1540,10 @@ void SdOOXMLExportTest2::testTdf114845_rotateShape() xDocShRef->DoClose(); xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr", "name", "Straight Arrow Connector 9"); - assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm", "flipV", "1"); - double dX = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm/a:off", "x").toDouble(); - double dY = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm/a:off", "y").toDouble(); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvPr", "name", "Straight Arrow Connector 9"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:xfrm", "flipV", "1"); + double dX = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:xfrm/a:off", "x").toDouble(); + double dY = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:xfrm/a:off", "y").toDouble(); CPPUNIT_ASSERT_DOUBLES_EQUAL( 4059000.0, dX, dX * .001); CPPUNIT_ASSERT_DOUBLES_EQUAL( 3287520.0, dY, dY * .001); } diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 215d668b2f3f..100c9e784875 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,7 @@ public: virtual void setUp() override; void testDocumentLayout(); + void testTdf89449(); void testTdf147459(); void testTdf146223(); void testTdf144918(); @@ -147,6 +149,7 @@ public: CPPUNIT_TEST_SUITE(SdImportTest); CPPUNIT_TEST(testDocumentLayout); + CPPUNIT_TEST(testTdf89449); CPPUNIT_TEST(testTdf147459); CPPUNIT_TEST(testTdf146223); CPPUNIT_TEST(testTdf144918); @@ -292,6 +295,42 @@ void SdImportTest::testDocumentLayout() } } +void SdImportTest::testTdf89449() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf89449.pptx"), PPTX); + + sal_Int32 nStartGlueId; + sal_Int32 nEndGlueId; + css::drawing::ConnectorType aConnectorType; + + uno::Reference xCurvedConnector(getShapeFromPage(3, 0, xDocShRef)); + xCurvedConnector->getPropertyValue("EdgeKind") >>= aConnectorType; + CPPUNIT_ASSERT_EQUAL(drawing::ConnectorType::ConnectorType_CURVE, aConnectorType); + nStartGlueId = xCurvedConnector->getPropertyValue("StartGluePointIndex").get(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nStartGlueId); + nEndGlueId = xCurvedConnector->getPropertyValue("EndGluePointIndex").get(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nEndGlueId); + + uno::Reference xStraightConnector(getShapeFromPage(4, 0, xDocShRef)); + xStraightConnector->getPropertyValue("EdgeKind") >>= aConnectorType; + CPPUNIT_ASSERT_EQUAL(drawing::ConnectorType::ConnectorType_LINE, aConnectorType); + nStartGlueId = xStraightConnector->getPropertyValue("StartGluePointIndex").get(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nStartGlueId); + nEndGlueId = xStraightConnector->getPropertyValue("EndGluePointIndex").get(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nEndGlueId); + + uno::Reference xStandardConnector(getShapeFromPage(5, 0, xDocShRef)); + xStandardConnector->getPropertyValue("EdgeKind") >>= aConnectorType; + CPPUNIT_ASSERT_EQUAL(drawing::ConnectorType::ConnectorType_STANDARD, aConnectorType); + nStartGlueId = xStandardConnector->getPropertyValue("StartGluePointIndex").get(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nStartGlueId); + nEndGlueId = xStandardConnector->getPropertyValue("EndGluePointIndex").get(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nEndGlueId); + + xDocShRef->DoClose(); +} + void SdImportTest::testTdf147459() { sd::DrawDocShellRef xDocShRef