summaryrefslogtreecommitdiffstats
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-23 09:18:23 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-18 01:07:55 -0500
commit35a1bbf354ed151d1be142439df731142c19961b (patch)
tree6e75bfaaec801237d75d0dadbc5bab241781d549 /editeng
parent-Werror,-Wunused-lambda-capture (diff)
downloadcore-35a1bbf354ed151d1be142439df731142c19961b.tar.gz
core-35a1bbf354ed151d1be142439df731142c19961b.zip
convert ATTRSPECIAL to scoped enum
Change-Id: I8abf09dc5f17343945b909887c580e9016a79ac5 (cherry picked from commit aebf05f324661a07f4124a4c48b6fc889d4bfbf6) (cherry picked from commit 50d0a2a6bad92124af5f2b8ea057767b4421c71b)
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/editeng/editundo.cxx2
-rw-r--r--editeng/source/editeng/editundo.hxx10
-rw-r--r--editeng/source/editeng/editview.cxx2
-rw-r--r--editeng/source/editeng/edtspell.cxx2
-rw-r--r--editeng/source/editeng/impedit.hxx5
-rw-r--r--editeng/source/editeng/impedit5.cxx6
7 files changed, 13 insertions, 16 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 8adaeff23d28..ac0d6321ce28 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -912,7 +912,7 @@ void EditEngine::SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet)
pImpEditEngine->SetParaAttribs(nPara, rSet);
}
-void EditEngine::SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, sal_uInt8 nSpecial)
+void EditEngine::SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, SetAttribsMode nSpecial)
{
pImpEditEngine->SetAttribs(rSel, rSet, nSpecial);
}
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index 90ea9ba1c788..c96174feb7dc 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -505,7 +505,7 @@ EditUndoSetAttribs::EditUndoSetAttribs(EditEngine* pEE, const ESelection& rESel,
bSetIsRemove = false;
bRemoveParaAttribs = false;
nRemoveWhich = 0;
- nSpecial = 0;
+ nSpecial = SetAttribsMode::NONE;
}
namespace {
diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx
index 1364b0c1db35..f85ee12d5b7d 100644
--- a/editeng/source/editeng/editundo.hxx
+++ b/editeng/source/editeng/editundo.hxx
@@ -28,7 +28,7 @@
class EditEngine;
class EditView;
-
+enum class SetAttribsMode;
// EditUndoDelContent
@@ -216,10 +216,10 @@ private:
SfxItemSet aNewAttribs;
InfoArrayType aPrevAttribs;
- sal_uInt8 nSpecial;
+ SetAttribsMode nSpecial;
bool bSetIsRemove;
bool bRemoveParaAttribs;
- sal_uInt16 nRemoveWhich;
+ sal_uInt16 nRemoveWhich;
void ImpSetSelection( EditView* pView );
@@ -230,10 +230,10 @@ public:
SfxItemSet& GetNewAttribs() { return aNewAttribs; }
- void SetSpecial( sal_uInt8 n ) { nSpecial = n; }
+ void SetSpecial( SetAttribsMode n ) { nSpecial = n; }
void SetRemoveAttribs( bool b ) { bSetIsRemove = b; }
void SetRemoveParaAttribs( bool b ) { bRemoveParaAttribs = b; }
- void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; }
+ void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; }
virtual void Undo() override;
virtual void Redo() override;
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 6ffc0730990a..c2fe60245d8e 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -481,7 +481,7 @@ void EditView::SetAttribs( const SfxItemSet& rSet )
DBG_ASSERT( !pImpEditView->aEditSelection.IsInvalid(), "Blind Selection in ...." );
pImpEditView->DrawSelection();
- pImpEditView->pEditEngine->SetAttribs( pImpEditView->GetEditSelection(), rSet, ATTRSPECIAL_WHOLEWORD );
+ pImpEditView->pEditEngine->SetAttribs( pImpEditView->GetEditSelection(), rSet, SetAttribsMode::WholeWord );
pImpEditView->pEditEngine->FormatAndUpdate( this );
}
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 4077ae5fcd63..887e8141bcc4 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -624,7 +624,7 @@ void EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd,
EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) );
aSel.Max().SetIndex( nEnd ); // ???
- mpEditEngine->SetAttribs( aSel, aSet, ATTRSPECIAL_EDGE );
+ mpEditEngine->SetAttribs( aSel, aSet, SetAttribsMode::Edge );
bAllowUndoAction = false;
}
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 1547ed769669..10ca1447bead 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -66,9 +66,6 @@
#define CURSOR_BIDILEVEL_DONTKNOW 0xFFFF
#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW // Max 16K, because WYSIWYG array
-#define ATTRSPECIAL_WHOLEWORD 1
-#define ATTRSPECIAL_EDGE 2
-
#define GETCRSR_TXTONLY 0x0001
#define GETCRSR_STARTOFLINE 0x0002
#define GETCRSR_ENDOFLINE 0x0004
@@ -827,7 +824,7 @@ public:
SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags = GetAttribsFlags::ALL ) const;
SfxItemSet GetAttribs( EditSelection aSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All );
- void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0 );
+ 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 );
void SetFlatMode( bool bFlat );
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index 826dbd7dc6be..9b41296324f7 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -490,13 +490,13 @@ SfxItemSet ImpEditEngine::GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int
}
-void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_uInt8 nSpecial )
+void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, SetAttribsMode nSpecial )
{
aSel.Adjust( aEditDoc );
// When no selection => use the Attribute on the word.
// ( the RTF-parser should actually never call the Method without a Range )
- if ( ( nSpecial == ATTRSPECIAL_WHOLEWORD ) && !aSel.HasRange() )
+ if ( nSpecial == SetAttribsMode::WholeWord && !aSel.HasRange() )
aSel = SelectWord( aSel, css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, false );
sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
@@ -547,7 +547,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_
{
aEditDoc.InsertAttrib( pNode, nStartPos, nEndPos, rItem );
bCharAttribFound = true;
- if ( nSpecial == ATTRSPECIAL_EDGE )
+ if ( nSpecial == SetAttribsMode::Edge )
{
CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs();
for (std::unique_ptr<EditCharAttrib> & rAttrib : rAttribs)