diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-05-09 09:05:57 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-09 11:15:16 +0000 |
commit | 17076d8ecf77f313b7a93912528f9cb0fd0d3ea8 (patch) | |
tree | cb77cae87f0a07e729deb9a66679a4cfec434768 /include | |
parent | 70d5cd845d4fe218588155cf43bdf854e8fc54f3 (diff) |
convert OUTLINER_MODE to scoped enum
Change-Id: I7ac45d7fbd5e77a105cbe942c6d4fd6cfc8ff909
Reviewed-on: https://gerrit.libreoffice.org/24789
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editobj.hxx | 5 | ||||
-rw-r--r-- | include/editeng/outliner.hxx | 35 | ||||
-rw-r--r-- | include/editeng/outlobj.hxx | 5 | ||||
-rw-r--r-- | include/svx/svdetc.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdmodel.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdoutl.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdtext.hxx | 3 |
7 files changed, 32 insertions, 24 deletions
diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx index c0d4f276c1b7..a3ab3a9e5bb5 100644 --- a/include/editeng/editobj.hxx +++ b/include/editeng/editobj.hxx @@ -39,6 +39,7 @@ class SfxStyleSheetPool; class SvxFieldItem; class SvxFieldData; class SvStream; +enum class OutlinerMode; namespace editeng { @@ -85,8 +86,8 @@ public: std::vector<svl::SharedString> GetSharedStrings() const; const SfxItemPool* GetPool() const; - sal_uInt16 GetUserType() const; // For OutlinerMode, it can however not save in compatible format - void SetUserType( sal_uInt16 n ); + OutlinerMode GetUserType() const; // For OutlinerMode, it can however not save in compatible format + void SetUserType( OutlinerMode n ); bool IsVertical() const; void SetVertical( bool bVertical ); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 78b2e211eaee..8b71ae12805b 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -560,16 +560,21 @@ struct EBulletInfo EBulletInfo() : bVisible( false ), nType( 0 ), nParagraph( EE_PARA_NOT_FOUND ) {} }; -#define OUTLINERMODE_DONTKNOW 0x0000 -#define OUTLINERMODE_TEXTOBJECT 0x0001 -#define OUTLINERMODE_TITLEOBJECT 0x0002 -#define OUTLINERMODE_OUTLINEOBJECT 0x0003 -#define OUTLINERMODE_OUTLINEVIEW 0x0004 - -#define OUTLINERMODE_USERMASK 0x00FF +enum class OutlinerMode { + DontKnow = 0x0000, + TextObject = 0x0001, + TitleObject = 0x0002, + OutlineObject = 0x0003, + OutlineView = 0x0004, + Subtitle = 0x0101, + Note = 0x0201 +}; +namespace o3tl +{ + template<> struct typed_flags<OutlinerMode> : is_typed_flags<OutlinerMode, 0x030f> {}; +} -#define OUTLINERMODE_SUBTITLE (0x0100|OUTLINERMODE_TEXTOBJECT) -#define OUTLINERMODE_NOTE (0x0200|OUTLINERMODE_TEXTOBJECT) +#define OUTLINERMODE_USERMASK (OutlinerMode)0x00FF class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster { @@ -611,7 +616,7 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster const sal_Int16 nMinDepth; sal_Int32 nFirstPage; - sal_uInt16 nOutlinerMode; + OutlinerMode nOutlinerMode; bool bFirstParaIsEmpty; sal_uInt8 nBlockInsCallback; @@ -646,7 +651,7 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster bool ImpCanDeleteSelectedPages( OutlinerView* pCurView ); bool ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_Int32 nFirstPage, sal_Int32 nPages ); - sal_uInt16 ImplGetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; } + OutlinerMode ImplGetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; } void ImplCheckDepth( sal_Int16& rnDepth ) const; protected: @@ -667,11 +672,11 @@ protected: public: - Outliner( SfxItemPool* pPool, sal_uInt16 nOutlinerMode ); + Outliner( SfxItemPool* pPool, OutlinerMode nOutlinerMode ); virtual ~Outliner(); - void Init( sal_uInt16 nOutlinerMode ); - sal_uInt16 GetMode() const { return nOutlinerMode; } + void Init( OutlinerMode nOutlinerMode ); + OutlinerMode GetMode() const { return nOutlinerMode; } void SetVertical( bool bVertical ); bool IsVertical() const; @@ -950,7 +955,7 @@ public: // this is needed for StarOffice Api void SetLevelDependendStyleSheet( sal_Int32 nPara ); - sal_uInt16 GetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; } + OutlinerMode GetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; } // spell and return a sentence bool SpellSentence(EditView& rEditView, svx::SpellPortions& rToFill, bool bIsGrammarChecking ); diff --git a/include/editeng/outlobj.hxx b/include/editeng/outlobj.hxx index f4d9c6a51a65..6bde289e7f73 100644 --- a/include/editeng/outlobj.hxx +++ b/include/editeng/outlobj.hxx @@ -27,6 +27,7 @@ #include <o3tl/cow_wrapper.hxx> class EditTextObject; +enum class OutlinerMode; /** * This is the guts of OutlinerParaObject, refcounted and shared among @@ -74,8 +75,8 @@ public: bool isWrongListEqual(const OutlinerParaObject& rCompare) const; // outliner mode access - sal_uInt16 GetOutlinerMode() const; - void SetOutlinerMode(sal_uInt16 nNew); + OutlinerMode GetOutlinerMode() const; + void SetOutlinerMode(OutlinerMode nNew); // vertical access bool IsVertical() const; diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index 6f92187dcb53..577a1d93571d 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -53,7 +53,7 @@ namespace com { namespace sun { namespace star { namespace lang { * The resulting default font height, however, stays the same (the logical * font height is converted). */ -SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner(sal_uInt16 nOutlinerMode, SdrModel& rMod); +SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rMod); /** * Global default settings for the DrawingEngine. @@ -95,7 +95,7 @@ public: // Create an Outliner with the engine-global default values on the heap. // If pMod != nullptr, the MapMode of the passed model is used. // The resulting default font height, however, stays the same (the logical font height is converted). - friend SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner(sal_uInt16 nOutlinerMode, SdrModel& rMod); + friend SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rMod); }; class SfxItemSet; diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 350acefe74dc..d90671311e76 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -580,7 +580,7 @@ public: void ReformatAllTextObjects(); - SdrOutliner* createOutliner( sal_uInt16 nOutlinerMode ); + SdrOutliner* createOutliner( OutlinerMode nOutlinerMode ); void disposeOutliner( SdrOutliner* pOutliner ); bool IsWriter() const { return !bMyPool; } diff --git a/include/svx/svdoutl.hxx b/include/svx/svdoutl.hxx index 902574138518..c76fbb9c2345 100644 --- a/include/svx/svdoutl.hxx +++ b/include/svx/svdoutl.hxx @@ -34,7 +34,7 @@ protected: const SdrPage* mpVisualizedPage; public: - SdrOutliner( SfxItemPool* pItemPool, sal_uInt16 nMode ); + SdrOutliner( SfxItemPool* pItemPool, OutlinerMode nMode ); virtual ~SdrOutliner() ; void SetTextObj( const SdrTextObj* pObj ); diff --git a/include/svx/svdtext.hxx b/include/svx/svdtext.hxx index b2f6ce112b3d..8338428fe241 100644 --- a/include/svx/svdtext.hxx +++ b/include/svx/svdtext.hxx @@ -30,6 +30,7 @@ class SdrOutliner; class SdrTextObj; class SdrModel; class SfxItemSet; +enum class OutlinerMode; namespace sdr { namespace properties { class TextProperties; @@ -46,7 +47,7 @@ public: virtual ~SdrText(); virtual void SetModel(SdrModel* pNewModel); - void ForceOutlinerParaObject( sal_uInt16 nOutlMode ); + void ForceOutlinerParaObject( OutlinerMode nOutlMode ); virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject ); OutlinerParaObject* GetOutlinerParaObject() const; |