summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-16 11:44:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-16 12:42:04 +0200
commit4e19742382708a691c6f62c47744fd2fa663216c (patch)
tree15f47d1b0ef832cdd34e6cad81eae69c3e5ccd64
parent1c3de19e9892deabd7ed2f47afbdf86f292eff8f (diff)
convert EditEngineAttribs to scoped enum
and drop unused EditEngineAttribs_HardAndPara enumerator Change-Id: Ic1fcddc6adeb5317f96bcef9b6f715b26d901a8d
-rw-r--r--editeng/source/editeng/impedit.hxx2
-rw-r--r--editeng/source/editeng/impedit5.cxx8
-rw-r--r--editeng/source/uno/unofored.cxx7
-rw-r--r--editeng/source/uno/unoforou.cxx11
-rw-r--r--editeng/source/uno/unotext.cxx2
-rw-r--r--include/editeng/editeng.hxx11
-rw-r--r--include/editeng/unoedprx.hxx2
-rw-r--r--include/editeng/unoedsrc.hxx2
-rw-r--r--include/editeng/unofored.hxx2
-rw-r--r--include/editeng/unoforou.hxx2
-rw-r--r--include/editeng/unotext.hxx2
-rw-r--r--sc/source/core/tool/editutil.cxx2
-rw-r--r--starmath/source/accessibility.cxx7
-rw-r--r--starmath/source/accessibility.hxx2
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx2
15 files changed, 27 insertions, 37 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index bc42f55d45af..d9ec4848cf2a 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -819,7 +819,7 @@ public:
sal_uInt32 GetParaHeight( sal_Int32 nParagraph );
SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags = GetAttribsFlags::ALL ) const;
- SfxItemSet GetAttribs( EditSelection aSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All );
+ SfxItemSet GetAttribs( EditSelection aSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All );
void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, SetAttribsMode nSpecial = SetAttribsMode::NONE );
void RemoveCharAttribs( EditSelection aSel, bool bRemoveParaAttribs, sal_uInt16 nWhich );
void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false );
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index f0892252e756..edf94a0efd39 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -337,14 +337,14 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, EditEngineAttribs nOnl
// First the very hard formatting ...
EditDoc::FindAttribs( pNode, nStartPos, nEndPos, aCurSet );
- if( nOnlyHardAttrib != EditEngineAttribs_OnlyHard )
+ if( nOnlyHardAttrib != EditEngineAttribs::OnlyHard )
{
// and then paragraph formatting and template...
for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++)
{
if ( aCurSet.GetItemState( nWhich ) == SfxItemState::DEFAULT )
{
- if ( nOnlyHardAttrib == EditEngineAttribs_All )
+ if ( nOnlyHardAttrib == EditEngineAttribs::All )
{
const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItem( nWhich );
aCurSet.Put( rItem );
@@ -358,7 +358,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, EditEngineAttribs nOnl
else if ( aCurSet.GetItemState( nWhich ) == SfxItemState::SET )
{
const SfxPoolItem* pItem = nullptr;
- if ( nOnlyHardAttrib == EditEngineAttribs_All )
+ if ( nOnlyHardAttrib == EditEngineAttribs::All )
{
pItem = &pNode->GetContentAttribs().GetItem( nWhich );
}
@@ -384,7 +384,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, EditEngineAttribs nOnl
}
// fill empty slots with defaults ...
- if ( nOnlyHardAttrib == EditEngineAttribs_All )
+ if ( nOnlyHardAttrib == EditEngineAttribs::All )
{
for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++ )
{
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index 47f7afd5a734..8f7683e995a6 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -68,13 +68,10 @@ SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, EditEngin
GetAttribsFlags nFlags = GetAttribsFlags::NONE;
switch( nOnlyHardAttrib )
{
- case EditEngineAttribs_All:
+ case EditEngineAttribs::All:
nFlags = GetAttribsFlags::ALL;
break;
- case EditEngineAttribs_HardAndPara:
- nFlags = GetAttribsFlags::PARAATTRIBS|GetAttribsFlags::CHARATTRIBS;
- break;
- case EditEngineAttribs_OnlyHard:
+ case EditEngineAttribs::OnlyHard:
nFlags = GetAttribsFlags::CHARATTRIBS;
break;
default:
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index c41bdac93a8a..1fa359a8c7b4 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -79,13 +79,10 @@ static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditE
switch( nOnlyHardAttrib )
{
- case EditEngineAttribs_All:
+ case EditEngineAttribs::All:
nFlags = GetAttribsFlags::ALL;
break;
- case EditEngineAttribs_HardAndPara:
- nFlags = GetAttribsFlags::PARAATTRIBS|GetAttribsFlags::CHARATTRIBS;
- break;
- case EditEngineAttribs_OnlyHard:
+ case EditEngineAttribs::OnlyHard:
nFlags = GetAttribsFlags::CHARATTRIBS;
break;
default:
@@ -101,7 +98,7 @@ static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditE
SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const
{
- if( mpAttribsCache && ( EditEngineAttribs_All == nOnlyHardAttrib ) )
+ if( mpAttribsCache && ( EditEngineAttribs::All == nOnlyHardAttrib ) )
{
// have we the correct set in cache?
if( const_cast<SvxOutlinerForwarder*>(this)->maAttribCacheSelection.IsEqual(rSel) )
@@ -123,7 +120,7 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, EditEngineA
SfxItemSet aSet( ImplOutlinerForwarderGetAttribs( rSel, nOnlyHardAttrib, rEditEngine ) );
- if( EditEngineAttribs_All == nOnlyHardAttrib )
+ if( EditEngineAttribs::All == nOnlyHardAttrib )
{
mpAttribsCache = new SfxItemSet( aSet );
maAttribCacheSelection = rSel;
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index f3fe061c6f75..17e4560ce4b0 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1066,7 +1066,7 @@ uno::Sequence< beans::PropertyState > SvxUnoTextRangeBase::_getPropertyStates(co
{
ESelection aSel( GetSelection() );
CheckSelection( aSel, pForwarder );
- pSet = new SfxItemSet( pForwarder->GetAttribs( aSel, EditEngineAttribs_OnlyHard ) );
+ pSet = new SfxItemSet( pForwarder->GetAttribs( aSel, EditEngineAttribs::OnlyHard ) );
}
bool bUnknownPropertyFound = false;
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 4742a607b349..d3e3f7e4cb9e 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -113,12 +113,11 @@ enum class CharCompressType;
/** values for:
- SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All );
+ SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All );
*/
-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
+enum class EditEngineAttribs {
+ All, /// returns all attributes even when they are not set
+ OnlyHard /// returns only attributes hard set on portions
};
/** values for:
@@ -321,7 +320,7 @@ public:
void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags = GetAttribsFlags::ALL ) const;
- SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All );
+ 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 ab28fe522768..cc92ef40bddc 100644
--- a/include/editeng/unoedprx.hxx
+++ b/include/editeng/unoedprx.hxx
@@ -36,7 +36,7 @@ public:
virtual sal_Int32 GetParagraphCount() const override;
virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override;
virtual OUString GetText( const ESelection& rSel ) const override;
- virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override;
virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override;
virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
virtual void RemoveAttribs( const ESelection& rSelection ) override;
diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx
index e4930816fbd5..fdd7eb89c1d6 100644
--- a/include/editeng/unoedsrc.hxx
+++ b/include/editeng/unoedsrc.hxx
@@ -142,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, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) 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 ) = 0;
diff --git a/include/editeng/unofored.hxx b/include/editeng/unofored.hxx
index 6bd997527260..b6c561caa37f 100644
--- a/include/editeng/unofored.hxx
+++ b/include/editeng/unofored.hxx
@@ -38,7 +38,7 @@ public:
virtual sal_Int32 GetParagraphCount() const override;
virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override;
virtual OUString GetText( const ESelection& rSel ) const override;
- virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override;
virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override;
virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
virtual void RemoveAttribs( const ESelection& rSelection ) override;
diff --git a/include/editeng/unoforou.hxx b/include/editeng/unoforou.hxx
index 1efbefa99d1c..7159db6c419d 100644
--- a/include/editeng/unoforou.hxx
+++ b/include/editeng/unoforou.hxx
@@ -56,7 +56,7 @@ public:
virtual sal_Int32 GetParagraphCount() const override;
virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override;
virtual OUString GetText( const ESelection& rSel ) const override;
- virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override;
virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override;
virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
virtual void RemoveAttribs( const ESelection& rSelection ) override;
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index a2cd5d206abc..a9b42bdb8341 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -180,7 +180,7 @@ public:
virtual sal_Int32 GetParagraphCount() const override;
virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override;
virtual OUString GetText( const ESelection& rSel ) const override;
- virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override;
virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override;
virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
virtual void RemoveAttribs( const ESelection& rSelection ) override;
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 32d4a4257281..e820f11eb598 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -382,7 +382,7 @@ ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) :
{
const SfxPoolItem* pItem = nullptr;
pEditAttrs.reset( new SfxItemSet( pEngine->GetAttribs(
- ESelection(0,0,0,pEngine->GetTextLen(0)), EditEngineAttribs_OnlyHard ) ) );
+ ESelection(0,0,0,pEngine->GetTextLen(0)), EditEngineAttribs::OnlyHard ) ) );
const SfxItemSet& rEditDefaults = pEngine->GetDefaults();
for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END && !bNeedsObject; nId++)
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 6e23b4a8f6a9..cc560281908a 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -928,13 +928,10 @@ SfxItemSet SmTextForwarder::GetAttribs( const ESelection& rSel, EditEngineAttrib
GetAttribsFlags nFlags = GetAttribsFlags::NONE;
switch( nOnlyHardAttrib )
{
- case EditEngineAttribs_All:
+ case EditEngineAttribs::All:
nFlags = GetAttribsFlags::ALL;
break;
- case EditEngineAttribs_HardAndPara:
- nFlags = GetAttribsFlags::PARAATTRIBS|GetAttribsFlags::CHARATTRIBS;
- break;
- case EditEngineAttribs_OnlyHard:
+ case EditEngineAttribs::OnlyHard:
nFlags = GetAttribsFlags::CHARATTRIBS;
break;
default:
diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx
index dbe9d40e9d7b..b69978e76135 100644
--- a/starmath/source/accessibility.hxx
+++ b/starmath/source/accessibility.hxx
@@ -188,7 +188,7 @@ public:
virtual sal_Int32 GetParagraphCount() const override;
virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override;
virtual OUString GetText( const ESelection& rSel ) const override;
- virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override;
virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override;
virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
virtual void RemoveAttribs( const ESelection& rSelection ) override;
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 37b9ed24f24b..5b329f48a334 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -89,7 +89,7 @@ namespace accessibility
sal_Int32 GetParagraphCount() const override { return 1; }
sal_Int32 GetTextLen( sal_Int32 /*nParagraph*/ ) const override { return 0; }
OUString GetText( const ESelection& /*rSel*/ ) const override { return OUString(); }
- SfxItemSet GetAttribs( const ESelection& /*rSel*/, EditEngineAttribs /*nOnlyHardAttrib*/ = EditEngineAttribs_All ) const override
+ SfxItemSet GetAttribs( const ESelection& /*rSel*/, EditEngineAttribs /*nOnlyHardAttrib*/ = EditEngineAttribs::All ) const override
{
// AW: Very dangerous: The former implementation used a SfxItemPool created on the
// fly which of course was deleted again ASAP. Thus, the returned SfxItemSet was using