oox/source/export/shapes.cxx | 44 +++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-)
New commits: commit a14dcd55f266eb9daae85a43741bbb2a4840702c Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Apr 5 20:25:01 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Apr 17 20:56:59 2023 +0200 oox: drop macros Change-Id: Ic8eeb34bef91807b54823a4114acc1200bec9de9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150065 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150492 diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 199180862c69..a77ee85b8b92 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -321,16 +321,6 @@ uno::Reference<io::XInputStream> GetOLEObjectStream( namespace oox::drawingml { -#define GETA(propName) \ - GetProperty( rXPropSet, #propName) - -#define GETAD(propName) \ - ( GetPropertyAndState( rXPropSet, rXPropState, #propName, eState ) && eState == beans::PropertyState_DIRECT_VALUE ) - -#define GET(variable, propName) \ - if ( GETA(propName) ) \ - mAny >>= variable; - ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ShapeHashMap* pShapeMap, XmlFilterBase* pFB, DocumentType eDocumentType, DMLTextExport* pTextExport, bool bUserShapes ) : DrawingML( std::move(pFS), pFB, eDocumentType, pTextExport ) , m_nEmbeddedObjects(0) @@ -746,7 +736,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) bool bHasGeometrySeq(false); Sequence< PropertyValue > aGeometrySeq; OUString sShapeType("non-primitive"); // default in ODF - if (GETA(CustomShapeGeometry)) + if (GetProperty(rXPropSet, "CustomShapeGeometry")) { SAL_INFO("oox.shape", "got custom shape geometry"); if (mAny >>= aGeometrySeq) @@ -816,7 +806,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) { bool bUseBackground = false; - if (GETA(FillUseSlideBackground)) + if (GetProperty(rXPropSet, "FillUseSlideBackground")) mAny >>= bUseBackground; if (bUseBackground) mpFS->startElementNS(mnXmlNamespace, XML_sp, XML_useBgFill, "1"); @@ -824,7 +814,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) mpFS->startElementNS(mnXmlNamespace, XML_sp); bool isVisible = true ; - if( GETA (Visible)) + if( GetProperty(rXPropSet, "Visible")) { mAny >>= isVisible; } @@ -834,7 +824,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) OString::number(GetShapeID(xShape) == -1 ? GetNewShapeID(xShape) : GetShapeID(xShape)), XML_name, GetShapeName(xShape), XML_hidden, sax_fastparser::UseIf("1", !isVisible)); - if( GETA( URL ) ) + if( GetProperty(rXPropSet, "URL") ) { OUString sURL; mAny >>= sURL; @@ -850,10 +840,10 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) } OUString sBookmark; - if (GETA(Bookmark)) + if (GetProperty(rXPropSet, "Bookmark")) mAny >>= sBookmark; - if (GETA(OnClick)) + if (GetProperty(rXPropSet, "OnClick")) { OUString sPPAction; presentation::ClickAction eClickAction = presentation::ClickAction_NONE; @@ -1687,7 +1677,8 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape Reference< XShape > rXShapeB; PropertyState eState; ConnectorType eConnectorType = ConnectorType_STANDARD; - GET(eConnectorType, EdgeKind); + if (GetProperty(rXPropSet, "EdgeKind")) + mAny >>= eConnectorType; switch( eConnectorType ) { case ConnectorType_CURVE: @@ -1703,19 +1694,24 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape break; } - if( GETAD( EdgeStartPoint ) ) { + if (GetPropertyAndState( rXPropSet, rXPropState, "EdgeStartPoint", eState ) && eState == beans::PropertyState_DIRECT_VALUE ) + { mAny >>= aStartPoint; - if( GETAD( EdgeEndPoint ) ) { + if (GetPropertyAndState( rXPropSet, rXPropState, "EdgeEndPoint", eState ) && eState == beans::PropertyState_DIRECT_VALUE ) mAny >>= aEndPoint; - } } - GET( rXShapeA, EdgeStartConnection ); - GET( rXShapeB, EdgeEndConnection ); + if (GetProperty(rXPropSet, "EdgeStartConnection")) + mAny >>= rXShapeA; + if (GetProperty(rXPropSet, "EdgeEndConnection")) + mAny >>= rXShapeB; - GET(nStartGlueId, StartGluePointIndex); + if (GetProperty(rXPropSet, "StartGluePointIndex")) + mAny >>= nStartGlueId; if (nStartGlueId != -1) nStartGlueId = lcl_GetGluePointId(nStartGlueId); - GET(nEndGlueId, EndGluePointIndex); + + if (GetProperty(rXPropSet, "EndGluePointIndex")) + mAny >>= nEndGlueId; if (nEndGlueId != -1) nEndGlueId = lcl_GetGluePointId(nEndGlueId);