summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-08-31 14:13:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-02 14:10:40 +0200
commit31ee13b5a40715e217711e48753eeb7170e3349c (patch)
tree116fa315d12b1a9505f91b52917cfbeafa69fba0 /sc
parent1463625ae26900d2461fd72a5a2c894b9f1b8726 (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 'sc')
-rw-r--r--sc/source/filter/excel/xeescher.cxx7
-rw-r--r--sc/source/filter/excel/xiescher.cxx10
-rw-r--r--sc/source/filter/inc/xiescher.hxx14
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx4
4 files changed, 18 insertions, 17 deletions
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index e456865197be..13a58328fce4 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -552,7 +552,8 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc
// fill DFF property set
mrEscherEx.OpenContainer( ESCHER_SpContainer );
- mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl,
+ ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor | ShapeFlag::OLEShape );
tools::Rectangle aDummyRect;
EscherPropertyContainer aPropOpt( mrEscherEx.GetGraphicProvider(), mrEscherEx.QueryPictureStream(), aDummyRect );
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
@@ -697,7 +698,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference<
// fill DFF property set
mrEscherEx.OpenContainer( ESCHER_SpContainer );
- mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
EscherPropertyContainer aPropOpt;
bool bVisible = aCtrlProp.GetBoolProperty( "EnableVisible" );
aPropOpt.AddOpt( ESCHER_Prop_fPrint, bVisible ? 0x00080000 : 0x00080002 ); // visible flag
@@ -1074,7 +1075,7 @@ XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape
{
// create the MSODRAWING record contents for the chart object
mrEscherEx.OpenContainer( ESCHER_SpContainer );
- mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
EscherPropertyContainer aPropOpt;
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01040104 );
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 );
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index a5dfbf1b5332..3b08416f6d5d 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -150,7 +150,7 @@ XclImpDrawObjBase::XclImpDrawObjBase( const XclImpRoot& rRoot ) :
mnTab( 0 ),
mnObjType( EXC_OBJTYPE_UNKNOWN ),
mnDffShapeId( 0 ),
- mnDffFlags( 0 ),
+ mnDffFlags( ShapeFlag::NONE ),
mbHasAnchor( false ),
mbHidden( false ),
mbVisible( true ),
@@ -3142,7 +3142,7 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize )
// DFF stream conversion ======================================================
-void XclImpSolverContainer::InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, sal_uInt32 nDffFlags )
+void XclImpSolverContainer::InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, ShapeFlag nDffFlags )
{
if( nDffShapeId > 0 )
{
@@ -3195,7 +3195,7 @@ void XclImpSolverContainer::RemoveConnectorRules()
maSdrObjMap.clear();
}
-void XclImpSolverContainer::UpdateConnection( sal_uInt32 nDffShapeId, SdrObject*& rpSdrObj, sal_uInt32* pnDffFlags )
+void XclImpSolverContainer::UpdateConnection( sal_uInt32 nDffShapeId, SdrObject*& rpSdrObj, ShapeFlag* pnDffFlags )
{
XclImpSdrInfoMap::const_iterator aIt = maSdrInfoMap.find( nDffShapeId );
if( aIt != maSdrInfoMap.end() )
@@ -3495,8 +3495,8 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
XclImpDrawObjRef xDrawObj = rConvData.mrDrawing.FindDrawObj( rDffObjData.rSpHd );
const tools::Rectangle& rAnchorRect = rDffObjData.aChildAnchor;
- // Do not process the global page group shape (flag SP_FPATRIARCH)
- bool bGlobalPageGroup = ::get_flag< sal_uInt32 >( rDffObjData.nSpFlags, SP_FPATRIARCH );
+ // Do not process the global page group shape
+ bool bGlobalPageGroup( rDffObjData.nSpFlags & ShapeFlag::Patriarch );
if( !xDrawObj || !xDrawObj->IsProcessSdrObj() || bGlobalPageGroup )
return nullptr; // simply return, xSdrObj will be destroyed
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 03c554495b90..a4ac864c585d 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -103,7 +103,7 @@ public:
/** Returns the shape identifier used in the DFF stream. */
sal_uInt32 GetDffShapeId() const { return mnDffShapeId; }
/** Returns the shape flags from the DFF stream. */
- sal_uInt32 GetDffFlags() const { return mnDffFlags; }
+ ShapeFlag GetDffFlags() const { return mnDffFlags; }
/** Returns true, if the object is hidden. */
bool IsHidden() const { return mbHidden; }
@@ -193,7 +193,7 @@ private:
SCTAB mnTab; /// Location of object
sal_uInt16 mnObjType; /// The Excel object type from OBJ record.
sal_uInt32 mnDffShapeId; /// Shape ID from DFF stream.
- sal_uInt32 mnDffFlags; /// Shape flags from DFF stream.
+ ShapeFlag mnDffFlags; /// Shape flags from DFF stream.
OUString maObjName; /// Name of the object.
OUString maMacroName; /// Name of an attached macro.
OUString maHyperlink; /// On-click hyperlink URL.
@@ -881,7 +881,7 @@ class XclImpSolverContainer : public SvxMSDffSolverContainer
public:
/** Inserts information about a new SdrObject. */
- void InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, sal_uInt32 nDffFlags );
+ void InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, ShapeFlag nDffFlags );
/** Removes information of an SdrObject (and all child objects if it is a group). */
void RemoveSdrObjectInfo( SdrObject& rSdrObj );
@@ -892,16 +892,16 @@ public:
private:
/** Updates the data of a connected shape in a connector rule. */
- void UpdateConnection( sal_uInt32 nDffShapeId, SdrObject*& rpSdrObj, sal_uInt32* pnDffFlags = nullptr );
+ void UpdateConnection( sal_uInt32 nDffShapeId, SdrObject*& rpSdrObj, ShapeFlag* pnDffFlags = nullptr );
private:
/** Stores data about an SdrObject processed during import. */
struct XclImpSdrInfo
{
SdrObject* mpSdrObj; /// Pointer to an SdrObject.
- sal_uInt32 mnDffFlags; /// Shape flags from DFF stream.
- explicit XclImpSdrInfo() : mpSdrObj( nullptr ), mnDffFlags( 0 ) {}
- void Set( SdrObject* pSdrObj, sal_uInt32 nDffFlags )
+ ShapeFlag mnDffFlags; /// Shape flags from DFF stream.
+ explicit XclImpSdrInfo() : mpSdrObj( nullptr ), mnDffFlags( ShapeFlag::NONE ) {}
+ void Set( SdrObject* pSdrObj, ShapeFlag nDffFlags )
{ mpSdrObj = pSdrObj; mnDffFlags = nDffFlags; }
};
typedef std::map< sal_uInt32, XclImpSdrInfo > XclImpSdrInfoMap;
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index d39baf7e439c..39ccc18970f0 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -564,7 +564,7 @@ void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const tools::Rect
nGrbit = 0; // all off: AutoLine, AutoFill, Printable, Locked
mrEscherEx.OpenContainer( ESCHER_SpContainer );
- mrEscherEx.AddShape( ESCHER_ShpInst_TextBox, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.AddShape( ESCHER_ShpInst_TextBox, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
aPropOpt.Commit( mrEscherEx.GetStream() );
XclExpDffNoteAnchor( rRoot, rRect ).WriteDffData( mrEscherEx );
@@ -691,7 +691,7 @@ XclObjDropDown::XclObjDropDown( XclExpObjectManager& rObjMgr, const ScAddress& r
SetAutoLine( false );
nGrbit |= 0x0100; // undocumented
mrEscherEx.OpenContainer( ESCHER_SpContainer );
- mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
EscherPropertyContainer aPropOpt;
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01040104 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field