diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-21 11:45:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-21 12:09:09 +0000 |
commit | beb8cfcf32f855a0fb638caef4782d9d867e3102 (patch) | |
tree | 23b5a2376ecacc2977c3ce5f3a2be182abb05b3b /include | |
parent | 2b14fb3a4f92b928f0a5fc536c6a5f4a6e51a9b8 (diff) |
convert inventorId to scoped enum
SW_DRAWLAYER had the same value as SC_DRAWLAYER, so I merged it into the
ScOrSwDraw enum constant
Change-Id: I5c45d378c00364d11cc960c9e48a6e3f10928724
Reviewed-on: https://gerrit.libreoffice.org/31037
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/filter/msfilter/svdfppt.hxx | 6 | ||||
-rw-r--r-- | include/svx/fmglob.hxx | 5 | ||||
-rw-r--r-- | include/svx/fmview.hxx | 2 | ||||
-rw-r--r-- | include/svx/galmisc.hxx | 5 | ||||
-rw-r--r-- | include/svx/globl3d.hxx | 5 | ||||
-rw-r--r-- | include/svx/obj3d.hxx | 4 | ||||
-rw-r--r-- | include/svx/sidebar/SelectionAnalyzer.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdcrtv.hxx | 12 | ||||
-rw-r--r-- | include/svx/svdedxv.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdobj.hxx | 38 | ||||
-rw-r--r-- | include/svx/svdovirt.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdtypes.hxx | 8 | ||||
-rw-r--r-- | include/svx/unoapi.hxx | 3 | ||||
-rw-r--r-- | include/svx/unopage.hxx | 5 |
14 files changed, 46 insertions, 55 deletions
diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index 22ab642f9e81..d0ccd36d806e 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -177,12 +177,6 @@ enum class TSS_Type : unsigned { Unknown = 0xffffffff // or invalid }; -// Inventor-Id for PPT UserData -const sal_uInt32 PPTInventor = sal_uInt32('P') * 0x00000001 - + sal_uInt32('P') * 0x00000100 - + sal_uInt32('T') * 0x00010000 - + sal_uInt32('0') * 0x01000000; - const int nMaxPPTLevels = 5; // Object IDs for StarDraw UserData diff --git a/include/svx/fmglob.hxx b/include/svx/fmglob.hxx index b82231ed29e0..cc8f51ce175c 100644 --- a/include/svx/fmglob.hxx +++ b/include/svx/fmglob.hxx @@ -23,11 +23,6 @@ #include <com/sun/star/form/FormComponentType.hpp> #include <svx/svdobj.hxx> -const sal_uInt32 FmFormInventor = sal_uInt32('F')*0x00000001+ - sal_uInt32('M')*0x00000100+ - sal_uInt32('0')*0x00010000+ - sal_uInt32('1')*0x01000000; - const sal_uInt16 OBJ_FM_CONTROL = css::form::FormComponentType::CONTROL; // for form components const sal_uInt16 OBJ_FM_EDIT = css::form::FormComponentType::TEXTFIELD; diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx index 5e28fe49fc50..6de1f3b3668d 100644 --- a/include/svx/fmview.hxx +++ b/include/svx/fmview.hxx @@ -93,7 +93,7 @@ public: const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats, sal_uInt16 _nControlObjectID, const OUString& _rFieldPostfix, - sal_uInt32 _nInventor, + SdrInventor _nInventor, sal_uInt16 _nLabelObjectID, SdrPage* _pLabelPage, SdrPage* _pControlPage, diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx index 4598c262cb39..4031af58369e 100644 --- a/include/svx/galmisc.hxx +++ b/include/svx/galmisc.hxx @@ -61,7 +61,6 @@ enum class SgaObjKind Inet = 6 // graphics from the internet }; -#define IV_IMAPINFO (sal_uInt32('S')*0x00000001+sal_uInt32('D')*0x00000100+sal_uInt32('U')*0x00010000+sal_uInt32('D')*0x01000000) #define ID_IMAPINFO 2 #define GAL_RES(nId) ResId(nId, *GetGalleryResMgr()) @@ -106,10 +105,10 @@ class SgaIMapInfo : public SdrObjUserData, public SfxListener ImageMap aImageMap; public: - SgaIMapInfo() : SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO ) {}; + SgaIMapInfo() : SdrObjUserData( SdrInventor::SgaImap, ID_IMAPINFO ) {}; SgaIMapInfo( const ImageMap& rImageMap) : - SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO ), + SdrObjUserData( SdrInventor::SgaImap, ID_IMAPINFO ), aImageMap( rImageMap ) {}; virtual ~SgaIMapInfo() override {}; diff --git a/include/svx/globl3d.hxx b/include/svx/globl3d.hxx index 88fec321b895..a258b6b189c7 100644 --- a/include/svx/globl3d.hxx +++ b/include/svx/globl3d.hxx @@ -22,11 +22,6 @@ #include <sal/types.h> -const sal_uInt32 E3dInventor = sal_uInt32('E')*0x00000001+ - sal_uInt32('3')*0x00000100+ - sal_uInt32('D')*0x00010000+ - sal_uInt32('1')*0x01000000; - const sal_uInt16 E3D_SCENE_ID = 1; const sal_uInt16 E3D_POLYSCENE_ID = 2; const sal_uInt16 E3D_OBJECT_ID = 3; // should not be used, it's only a helper class for E3DScene and E3DCompoundObject diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx index 5f852962309b..accfb8f69b1a 100644 --- a/include/svx/obj3d.hxx +++ b/include/svx/obj3d.hxx @@ -145,10 +145,10 @@ public: virtual ~E3dObject() override; - virtual sal_uInt32 GetObjInventor() const override; + virtual SdrInventor GetObjInventor() const override; virtual sal_uInt16 GetObjIdentifier() const override; - virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual void NbcSetLayer(SdrLayerID nLayer) override; diff --git a/include/svx/sidebar/SelectionAnalyzer.hxx b/include/svx/sidebar/SelectionAnalyzer.hxx index 196f1dd269cd..c4ed2fa1a105 100644 --- a/include/svx/sidebar/SelectionAnalyzer.hxx +++ b/include/svx/sidebar/SelectionAnalyzer.hxx @@ -24,7 +24,7 @@ class SdrMarkList; class SdrObject; - +enum class SdrInventor : sal_uInt32; namespace svx { namespace sidebar { @@ -57,7 +57,7 @@ private: static vcl::EnumContext::Context GetContextForObjectId_SD ( const sal_uInt16 nObjectId, const ViewType eViewType); - static sal_uInt32 GetInventorTypeFromMark ( + static SdrInventor GetInventorTypeFromMark ( const SdrMarkList& rMarkList); static sal_uInt16 GetObjectTypeFromMark ( const SdrMarkList& rMarkList); diff --git a/include/svx/svdcrtv.hxx b/include/svx/svdcrtv.hxx index a294bb544f7d..c66b05488d3e 100644 --- a/include/svx/svdcrtv.hxx +++ b/include/svx/svdcrtv.hxx @@ -48,7 +48,7 @@ protected: sal_Int32 nAutoCloseDistPix; sal_Int32 nFreeHandMinDistPix; - sal_uInt32 nAktInvent; // set the current ones + SdrInventor nAktInvent; // set the current ones sal_uInt16 nAktIdent; // Obj for re-creating bool b1stPointAsCenter : 1; @@ -60,7 +60,7 @@ private: SVX_DLLPRIVATE void ImpClearVars(); protected: - bool ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut, + bool ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut, sal_Int16 nMinMov, const Rectangle& rLogRect, SdrObject* pPreparedFactoryObject); void ShowCreateObj(/*OutputDevice* pOut, bool bFull*/); @@ -99,10 +99,10 @@ public: // Determine whether a measurement tool activated bool IsMeasureTool() const; - void SetCurrentObj(sal_uInt16 nIdent, sal_uInt32 nInvent=SdrInventor); - void TakeCurrentObj(sal_uInt16& nIdent, sal_uInt32& nInvent) const { nInvent=nAktInvent; nIdent=nAktIdent; } - sal_uInt32 GetCurrentObjInventor() const { return nAktInvent; } - sal_uInt16 GetCurrentObjIdentifier() const { return nAktIdent; } + void SetCurrentObj(sal_uInt16 nIdent, SdrInventor nInvent=SdrInventor::Default); + void TakeCurrentObj(sal_uInt16& nIdent, SdrInventor& nInvent) const { nInvent=nAktInvent; nIdent=nAktIdent; } + SdrInventor GetCurrentObjInventor() const { return nAktInvent; } + sal_uInt16 GetCurrentObjIdentifier() const { return nAktIdent; } // Beginning the regular Create bool BegCreateObj(const Point& rPnt, OutputDevice* pOut=nullptr, short nMinMov=-3); diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 3ad19c843699..211594aa9e89 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -262,7 +262,7 @@ public: const rtl::Reference< sdr::SelectionController >& getSelectionController() const { return mxSelectionController; } /** returns true if the shape identified by its inventor and identifier supports format paint brush operation */ - static bool SupportsFormatPaintbrush( sal_uInt32 nObjectInventor, sal_uInt16 nObjectIdentifier ); + static bool SupportsFormatPaintbrush( SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier ); /** returns a format paint brush set from the current selection */ void TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rFormatSet ); diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index b398a19071aa..ace6f5367e02 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -142,6 +142,20 @@ enum SdrObjKind { OBJ_MAXI }; +enum class SdrInventor : sal_uInt32 { + Unknown = 0, + BasicDialog = sal_uInt32( 'D' | ('L' << 8) | ('G' << 16) | ('1' << 24) ), + Default = sal_uInt32( 'S' | ('V' << 8) | ('D' << 16) | ('r' << 24) ), + E3d = sal_uInt32( 'E' | ('3' << 8) | ('D' << 16) | ('1' << 24) ), + FmForm = sal_uInt32( 'F' | ('M' << 8) | ('0' << 16) | ('1' << 24) ), + IMap = sal_uInt32( 'I' | ('M' << 8) | ('A' << 16) | ('P' << 24) ), + ReportDesign = sal_uInt32( 'R' | ('P' << 8) | ('T' << 16) | ('1' << 24) ), + ScOrSwDraw = sal_uInt32( 'S' | ('C' << 8) | ('3' << 16) | ('0' << 24) ), // Used in sc/ and sw/ + SgaImap = sal_uInt32( 'S' | ('D' << 8) | ('U' << 16) | ('D' << 24) ), + StarDrawUserData = sal_uInt32( 'S' | ('D' << 8) | ('U' << 16) | ('D' << 24) ), + Swg = sal_uInt32( 'S' | ('W' << 8) | ('G' << 16) ), +}; + enum class SdrUserCallType { MoveOnly, // only moved, size unchanged Resize, // size and maybe position changed @@ -188,7 +202,7 @@ public: class SVX_DLLPUBLIC SdrObjUserData { protected: - sal_uInt32 nInventor; + SdrInventor nInventor; sal_uInt16 nIdentifier; private: @@ -197,12 +211,12 @@ private: bool operator!=(const SdrObjUserData& rData) const = delete; public: - SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId); + SdrObjUserData(SdrInventor nInv, sal_uInt16 nId); SdrObjUserData(const SdrObjUserData& rData); virtual ~SdrObjUserData(); virtual SdrObjUserData* Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0 - sal_uInt32 GetInventor() const { return nInventor;} + SdrInventor GetInventor() const { return nInventor;} sal_uInt16 GetId() const { return nIdentifier;} }; @@ -434,7 +448,7 @@ public: void AddReference(SdrVirtObj& rVrtObj); void DelReference(SdrVirtObj& rVrtObj); - virtual sal_uInt32 GetObjInventor() const; + virtual SdrInventor GetObjInventor() const; virtual sal_uInt16 GetObjIdentifier() const; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; @@ -990,14 +1004,14 @@ public: struct SdrObjCreatorParams { - sal_uInt32 nInventor; - sal_uInt16 nObjIdentifier; + SdrInventor nInventor; + sal_uInt16 nObjIdentifier; }; struct SdrObjUserDataCreatorParams { - sal_uInt32 nInventor; - sal_uInt16 nObjIdentifier; - SdrObject* pObject; + SdrInventor nInventor; + sal_uInt16 nObjIdentifier; + SdrObject* pObject; }; /** @@ -1011,8 +1025,8 @@ struct SdrObjUserDataCreatorParams class SVX_DLLPUBLIC SdrObjFactory { public: - static SdrObject* MakeNewObject(sal_uInt32 nInventor, sal_uInt16 nObjIdentifier, SdrPage* pPage, SdrModel* pModel=nullptr); - static SdrObject* MakeNewObject(sal_uInt32 nInventor, sal_uInt16 nObjIdentifier, const Rectangle& rSnapRect, SdrPage* pPage); + static SdrObject* MakeNewObject(SdrInventor nInventor, sal_uInt16 nObjIdentifier, SdrPage* pPage, SdrModel* pModel=nullptr); + static SdrObject* MakeNewObject(SdrInventor nInventor, sal_uInt16 nObjIdentifier, const Rectangle& rSnapRect, SdrPage* pPage); static void InsertMakeObjectHdl(Link<SdrObjCreatorParams, SdrObject*> const & rLink); static void RemoveMakeObjectHdl(Link<SdrObjCreatorParams, SdrObject*> const & rLink); static void InsertMakeUserDataHdl(Link<SdrObjUserDataCreatorParams, SdrObjUserData*> const & rLink); @@ -1020,7 +1034,7 @@ public: private: static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory( - sal_uInt32 nInventor, sal_uInt16 nIdentifier, SdrPage* pPage, SdrModel* pModel ); + SdrInventor nInventor, sal_uInt16 nIdentifier, SdrPage* pPage, SdrModel* pModel ); SdrObjFactory() = delete; }; diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index d81732e863fb..3484671d5557 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -55,7 +55,7 @@ public: virtual void SetModel(SdrModel* pNewModel) override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt32 GetObjInventor() const override; + virtual SdrInventor GetObjInventor() const override; virtual sal_uInt16 GetObjIdentifier() const override; virtual SdrObjList* GetSubList() const override; diff --git a/include/svx/svdtypes.hxx b/include/svx/svdtypes.hxx index f999a92c91d8..7f800ea985ee 100644 --- a/include/svx/svdtypes.hxx +++ b/include/svx/svdtypes.hxx @@ -22,14 +22,6 @@ #include <sal/types.h> -/* - * SdrObject - */ -const sal_uInt32 SdrInventor=sal_uInt32('S')*0x00000001+ - sal_uInt32('V')*0x00000100+ - sal_uInt32('D')*0x00010000+ - sal_uInt32('r')*0x01000000; - // commands for EndCreate() enum class SdrCreateCmd { diff --git a/include/svx/unoapi.hxx b/include/svx/unoapi.hxx index 6afd9c137c44..35e7098ee051 100644 --- a/include/svx/unoapi.hxx +++ b/include/svx/unoapi.hxx @@ -33,12 +33,13 @@ class SdrObject; class SdrPage; class SvxNumBulletItem; class SfxItemPool; +enum class SdrInventor : sal_uInt32; /** * Creates a StarOffice API wrapper with the given type and inventor * Deprecated: This will be replaced with a function returning XShape. */ -SVX_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, sal_uInt32 nInventor, OUString const & referer) +SVX_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, OUString const & referer) throw (css::uno::RuntimeException, std::exception); /** Returns a StarOffice API wrapper for the given SdrObject */ diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx index 881032726b86..7bbdc1672523 100644 --- a/include/svx/unopage.hxx +++ b/include/svx/unopage.hxx @@ -49,6 +49,7 @@ class SdrObject; class SvxShape; class SvxShapeGroup; class SvxShapeConnector; +enum class SdrInventor : sal_uInt32; /** * Macros to convert Twips<->100tel mm @@ -88,14 +89,14 @@ class SVX_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper6< css::drawin SdrObject *CreateSdrObject( const css::uno::Reference< css::drawing::XShape >& xShape, bool bBeginning = false ) throw(); // Determine Type and Inventor - static void GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor, const OUString& aName ) throw(); + static void GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, const OUString& aName ) throw(); // Creating a SdrObject using it's Description. // Can be used by derived classes to support their owen Shapes (e.g. Controls). virtual SdrObject *CreateSdrObject_( const css::uno::Reference< css::drawing::XShape >& xShape ) throw (css::uno::RuntimeException, std::exception); - static SvxShape* CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor, SdrObject *pObj, SvxDrawPage *pPage = nullptr, OUString const & referer = OUString() ) throw (css::uno::RuntimeException); + static SvxShape* CreateShapeByTypeAndInventor( sal_uInt16 nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage = nullptr, OUString const & referer = OUString() ) throw (css::uno::RuntimeException); // The following method is called if a SvxShape object is to be created. // Derived classes can create a derivation or an SvxShape aggregating object. |