summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-04-05 20:25:01 +0200
committerAndras Timar <andras.timar@collabora.com>2023-05-13 20:05:18 +0200
commit1b441fb37daac9ae885986495fd3d3337fd2e821 (patch)
tree3126f93f5640f9a3b3a5b17d14295a1877c845aa /oox
parent111160238f2bb3a882331a2e91e88235fadd4fed (diff)
oox: drop macros
Change-Id: Ic8eeb34bef91807b54823a4114acc1200bec9de9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150065 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150492
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/shapes.cxx44
1 files changed, 20 insertions, 24 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index b543dcea82c6..971d112a6402 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);