diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-08-31 14:13:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-02 14:10:40 +0200 |
commit | 31ee13b5a40715e217711e48753eeb7170e3349c (patch) | |
tree | 116fa315d12b1a9505f91b52917cfbeafa69fba0 /oox | |
parent | 1463625ae26900d2461fd72a5a2c894b9f1b8726 (diff) |
convert SHAPEFLAG defines to scoped enum ShapeFlag
they were defined in escherex.hxx as SHAPEFLAG_*
and in msdffimp.hxx as SP_*.
Added include for escherex.hxx to msdffimp.hxx.
Filled the missing flag bits.
ShapeFlag::Deleted is not used at the moment.
Convert ADD_SHAPE macro to lambda.
Fix horizontal/vertical mixup in RtfSdrExport::AddLineDimensions.
Comments for flag Connector were wrong. The flag applies to shapes
which ARE connectors.
MSO definition: "connector: A line that is used to connect two
or more shapes and that remains connected to those shapes."
So Rectangles and such with Connector flag don't make sense.
Change-Id: I735de00110411b280a302840dc0fcdfac5156399
Reviewed-on: https://gerrit.libreoffice.org/41754
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/vmlexport.cxx | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 60bd7d0a80cf..7d2584da3641 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -725,7 +725,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) bool bHasHandles = false; OUString sShapeType; - sal_uInt32 nMirrorFlags = 0; + ShapeFlag nMirrorFlags = ShapeFlag::NONE; MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType ); SdrObjCustomShape* pShape = static_cast<SdrObjCustomShape*>( GetSdrObjectFromXShape( xShape ) ); bool bIsDefaultObject = EscherPropertyContainer::IsDefaultObject( pShape, eShapeType ); diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index c4c3f3679861..dd2ed6300264 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -63,7 +63,7 @@ VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr const & pSerializer, VMLText , m_pSdrObject( nullptr ) , m_pShapeAttrList( nullptr ) , m_nShapeType( ESCHER_ShpInst_Nil ) - , m_nShapeFlags(0) + , m_nShapeFlags(ShapeFlag::NONE) , m_ShapeStyle( 200 ) , m_aShapeTypeWritten( ESCHER_ShpInst_COUNT ) , m_bSkipwzName( false ) @@ -181,7 +181,7 @@ void VMLExport::LeaveGroup() m_pSerializer->endElementNS( XML_v, XML_group ); } -void VMLExport::AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 nShapeId ) +void VMLExport::AddShape( sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId ) { m_nShapeType = nShapeType; m_nShapeFlags = nShapeFlags; @@ -906,12 +906,15 @@ OString VMLExport::ShapeIdString( sal_uInt32 nId ) void VMLExport::AddFlipXY( ) { - const sal_uInt32 nFlipHandV = SHAPEFLAG_FLIPH + SHAPEFLAG_FLIPV; - switch ( m_nShapeFlags & nFlipHandV ) + if (m_nShapeFlags & (ShapeFlag::FlipH | ShapeFlag::FlipV)) { - case SHAPEFLAG_FLIPH: m_ShapeStyle.append( ";flip:x" ); break; - case SHAPEFLAG_FLIPV: m_ShapeStyle.append( ";flip:y" ); break; - case nFlipHandV: m_ShapeStyle.append( ";flip:xy" ); break; + m_ShapeStyle.append( ";flip:" ); + + if (m_nShapeFlags & ShapeFlag::FlipH) + m_ShapeStyle.append( "x" ); + + if (m_nShapeFlags & ShapeFlag::FlipV) + m_ShapeStyle.append( "y" ); } } |