diff options
author | Noel Grandin <noel@peralex.com> | 2014-04-04 08:45:26 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-04-04 13:44:16 +0200 |
commit | 214751e3cc5b154d90963f4abf0a9317733b001b (patch) | |
tree | 9d7c0127be2b0e9ada88bcf73e632233bd841f61 /include | |
parent | 6f349af57ebd6d160b6354c2033c46467da4598a (diff) |
cleanup up the EditEngine::GetAttribs call
It was using a bool parameter, but passing various constants
through it.
Make the constants into an enum, and use the enum in the GetAttribs
call.
Change-Id: I3010397dfe83b24db3946b9dea2fb37f4393abdd
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editeng.hxx | 16 | ||||
-rw-r--r-- | include/editeng/unoedprx.hxx | 2 | ||||
-rw-r--r-- | include/editeng/unoedsrc.hxx | 3 | ||||
-rw-r--r-- | include/editeng/unofored.hxx | 2 | ||||
-rw-r--r-- | include/editeng/unoforou.hxx | 2 | ||||
-rw-r--r-- | include/editeng/unotext.hxx | 2 |
6 files changed, 17 insertions, 10 deletions
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 128fdf50341e..bb5efa3be97f 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -109,12 +109,18 @@ class ParaPortionList; -/** values for GetAttribs +/** values for: + SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ); */ -const sal_uInt8 EditEngineAttribs_All = 0; /// returns all attributes even when theire not set -const sal_uInt8 EditEngineAttribs_HardAndPara = 1; /// returns all attributes set on paragraph and on portions -const sal_uInt8 EditEngineAttribs_OnlyHard = 2; /// returns only attributes hard set on portions +enum EditEngineAttribs { + EditEngineAttribs_All, /// returns all attributes even when theire not set + EditEngineAttribs_HardAndPara, /// returns all attributes set on paragraph and on portions + EditEngineAttribs_OnlyHard /// returns only attributes hard set on portions +}; +/** values for: + SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const; +*/ #define GETATTRIBS_STYLESHEET (sal_uInt8)0x01 #define GETATTRIBS_PARAATTRIBS (sal_uInt8)0x02 #define GETATTRIBS_CHARATTRIBS (sal_uInt8)0x04 @@ -297,7 +303,7 @@ public: void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const; SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const; - SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = sal_False ); + SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ); bool HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const; const SfxPoolItem& GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ); diff --git a/include/editeng/unoedprx.hxx b/include/editeng/unoedprx.hxx index 34ca35f6df76..1bc9ebc66d94 100644 --- a/include/editeng/unoedprx.hxx +++ b/include/editeng/unoedprx.hxx @@ -36,7 +36,7 @@ public: virtual sal_Int32 GetParagraphCount() const SAL_OVERRIDE; virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const SAL_OVERRIDE; virtual OUString GetText( const ESelection& rSel ) const SAL_OVERRIDE; - virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const SAL_OVERRIDE; + virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const SAL_OVERRIDE; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const SAL_OVERRIDE; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE; virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE; diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx index d12372c2dfd0..aed5ee6ae5db 100644 --- a/include/editeng/unoedsrc.hxx +++ b/include/editeng/unoedsrc.hxx @@ -30,6 +30,7 @@ #include <svl/poolitem.hxx> #include <svl/itempool.hxx> #include <editeng/editengdllapi.h> +#include <editeng/editeng.hxx> #include <list> @@ -141,7 +142,7 @@ public: virtual sal_Int32 GetParagraphCount() const = 0; virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const = 0; virtual OUString GetText( const ESelection& rSel ) const = 0; - virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const = 0; + virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const = 0; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const = 0; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) = 0; virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) = 0; diff --git a/include/editeng/unofored.hxx b/include/editeng/unofored.hxx index 5ea61a7bcedf..a07a784f047b 100644 --- a/include/editeng/unofored.hxx +++ b/include/editeng/unofored.hxx @@ -38,7 +38,7 @@ public: virtual sal_Int32 GetParagraphCount() const SAL_OVERRIDE; virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const SAL_OVERRIDE; virtual OUString GetText( const ESelection& rSel ) const SAL_OVERRIDE; - virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const SAL_OVERRIDE; + virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const SAL_OVERRIDE; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const SAL_OVERRIDE; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE; virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE; diff --git a/include/editeng/unoforou.hxx b/include/editeng/unoforou.hxx index 22d89a175d83..7840909a115d 100644 --- a/include/editeng/unoforou.hxx +++ b/include/editeng/unoforou.hxx @@ -56,7 +56,7 @@ public: virtual sal_Int32 GetParagraphCount() const SAL_OVERRIDE; virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const SAL_OVERRIDE; virtual OUString GetText( const ESelection& rSel ) const SAL_OVERRIDE; - virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const SAL_OVERRIDE; + virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const SAL_OVERRIDE; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const SAL_OVERRIDE; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE; virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE; diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx index 3250ec33de78..5c4eed690912 100644 --- a/include/editeng/unotext.hxx +++ b/include/editeng/unotext.hxx @@ -177,7 +177,7 @@ public: virtual sal_Int32 GetParagraphCount() const SAL_OVERRIDE; virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const SAL_OVERRIDE; virtual OUString GetText( const ESelection& rSel ) const SAL_OVERRIDE; - virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const SAL_OVERRIDE; + virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const SAL_OVERRIDE; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const SAL_OVERRIDE; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE; virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE; |