diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-24 16:05:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-25 08:56:14 +0200 |
commit | abf60c4a0fd111985891e2faa30a1e32799fdf9c (patch) | |
tree | b83b66c7457b8e221a01dfe3808adc918c41e6b9 /editeng | |
parent | 6cb56b551bc1e30a887d8a333d70567cad23aa9e (diff) |
convert EE_CNTRL constants to enum class
there were a couple of lines in SC and SW where the code was using a
EV_CNTRL constant. I switched it to used the same-valued constant from
EE_CNTRL
Change-Id: I027183cc3b6e700bf365d48833e37eddc9b50f04
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 32 | ||||
-rw-r--r-- | editeng/source/editeng/editstt2.hxx | 54 | ||||
-rw-r--r-- | editeng/source/editeng/edtspell.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 6 | ||||
-rw-r--r-- | editeng/source/outliner/outleeng.cxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/outlin2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 12 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 2 |
10 files changed, 63 insertions, 63 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index c65c8910d380..ad2b3d44c586 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1794,30 +1794,30 @@ bool EditEngine::IsFlatMode() const return !( pImpEditEngine->aStatus.UseCharAttribs() ); } -void EditEngine::SetControlWord( sal_uInt32 nWord ) +void EditEngine::SetControlWord( EEControlBits nWord ) { if ( nWord != pImpEditEngine->aStatus.GetControlWord() ) { - sal_uInt32 nPrev = pImpEditEngine->aStatus.GetControlWord(); + EEControlBits nPrev = pImpEditEngine->aStatus.GetControlWord(); pImpEditEngine->aStatus.GetControlWord() = nWord; - sal_uInt32 nChanges = nPrev ^ nWord; + EEControlBits nChanges = nPrev ^ nWord; if ( pImpEditEngine->IsFormatted() ) { // possibly reformat: - if ( ( nChanges & EE_CNTRL_USECHARATTRIBS ) || - ( nChanges & EE_CNTRL_USEPARAATTRIBS ) || - ( nChanges & EE_CNTRL_ONECHARPERLINE ) || - ( nChanges & EE_CNTRL_STRETCHING ) || - ( nChanges & EE_CNTRL_OUTLINER ) || - ( nChanges & EE_CNTRL_NOCOLORS ) || - ( nChanges & EE_CNTRL_OUTLINER2 ) ) + if ( ( nChanges & EEControlBits::USECHARATTRIBS ) || + ( nChanges & EEControlBits::USEPARAATTRIBS ) || + ( nChanges & EEControlBits::ONECHARPERLINE ) || + ( nChanges & EEControlBits::STRETCHING ) || + ( nChanges & EEControlBits::OUTLINER ) || + ( nChanges & EEControlBits::NOCOLORS ) || + ( nChanges & EEControlBits::OUTLINER2 ) ) { - if ( ( nChanges & EE_CNTRL_USECHARATTRIBS ) || - ( nChanges & EE_CNTRL_USEPARAATTRIBS ) ) + if ( ( nChanges & EEControlBits::USECHARATTRIBS ) || + ( nChanges & EEControlBits::USEPARAATTRIBS ) ) { - bool bUseCharAttribs = ( nWord & EE_CNTRL_USECHARATTRIBS ); + bool bUseCharAttribs = bool( nWord & EEControlBits::USECHARATTRIBS ); pImpEditEngine->GetEditDoc().CreateDefFont( bUseCharAttribs ); } @@ -1826,12 +1826,12 @@ void EditEngine::SetControlWord( sal_uInt32 nWord ) } } - bool bSpellingChanged = nChanges & EE_CNTRL_ONLINESPELLING; + bool bSpellingChanged = bool(nChanges & EEControlBits::ONLINESPELLING); if ( bSpellingChanged ) { pImpEditEngine->StopOnlineSpellTimer(); - if (nWord & EE_CNTRL_ONLINESPELLING) + if (nWord & EEControlBits::ONLINESPELLING) { // Create WrongList, start timer... sal_Int32 nNodes = pImpEditEngine->GetEditDoc().Count(); @@ -1870,7 +1870,7 @@ void EditEngine::SetControlWord( sal_uInt32 nWord ) } } -sal_uInt32 EditEngine::GetControlWord() const +EEControlBits EditEngine::GetControlWord() const { return pImpEditEngine->aStatus.GetControlWord(); } diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index 2d8be5857ec4..84993a155d5e 100644 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -28,10 +28,10 @@ class InternalEditStatus : public EditStatus public: InternalEditStatus() { ; } - void TurnOnFlags( sal_uLong nFlags ) + void TurnOnFlags( EEControlBits nFlags ) { nControlBits |= nFlags; } - void TurnOffFlags( sal_uLong nFlags ) + void TurnOffFlags( EEControlBits nFlags ) { nControlBits &= ~nFlags; } void TurnOnStatusBits( sal_uLong nBits ) @@ -42,80 +42,80 @@ public: bool UseCharAttribs() const - { return ( ( nControlBits & EE_CNTRL_USECHARATTRIBS ) != 0 ); } + { return bool( nControlBits & EEControlBits::USECHARATTRIBS ); } bool NotifyCursorMovements() const - { return ( ( nControlBits & EE_CNTRL_CRSRLEFTPARA ) != 0 ); } + { return bool( nControlBits & EEControlBits::CRSRLEFTPARA ); } bool UseIdleFormatter() const - { return ( ( nControlBits & EE_CNTRL_DOIDLEFORMAT) != 0 ); } + { return bool( nControlBits & EEControlBits::DOIDLEFORMAT); } bool AllowPasteSpecial() const - { return ( ( nControlBits & EE_CNTRL_PASTESPECIAL ) != 0 ); } + { return bool( nControlBits & EEControlBits::PASTESPECIAL ); } bool DoAutoIndenting() const - { return ( ( nControlBits & EE_CNTRL_AUTOINDENTING ) != 0 ); } + { return bool( nControlBits & EEControlBits::AUTOINDENTING ); } bool DoUndoAttribs() const - { return ( ( nControlBits & EE_CNTRL_UNDOATTRIBS ) != 0 ); } + { return bool( nControlBits & EEControlBits::UNDOATTRIBS ); } bool OneCharPerLine() const - { return ( ( nControlBits & EE_CNTRL_ONECHARPERLINE ) != 0 ); } + { return bool( nControlBits & EEControlBits::ONECHARPERLINE ); } bool IsOutliner() const - { return ( ( nControlBits & EE_CNTRL_OUTLINER ) != 0 ); } + { return bool( nControlBits & EEControlBits::OUTLINER ); } bool IsOutliner2() const - { return ( ( nControlBits & EE_CNTRL_OUTLINER2 ) != 0 ); } + { return bool( nControlBits & EEControlBits::OUTLINER2 ); } bool IsAnyOutliner() const { return IsOutliner() || IsOutliner2(); } bool DoNotUseColors() const - { return ( ( nControlBits & EE_CNTRL_NOCOLORS ) != 0 ); } + { return bool( nControlBits & EEControlBits::NOCOLORS ); } bool AllowBigObjects() const - { return ( ( nControlBits & EE_CNTRL_ALLOWBIGOBJS ) != 0 ); } + { return bool( nControlBits & EEControlBits::ALLOWBIGOBJS ); } bool DoOnlineSpelling() const - { return ( ( nControlBits & EE_CNTRL_ONLINESPELLING ) != 0 ); } + { return bool( nControlBits & EEControlBits::ONLINESPELLING ); } bool DoStretch() const - { return ( ( nControlBits & EE_CNTRL_STRETCHING ) != 0 ); } + { return bool( nControlBits & EEControlBits::STRETCHING ); } bool AutoPageSize() const - { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZE ) != 0 ); } + { return bool( nControlBits & EEControlBits::AUTOPAGESIZE ); } bool AutoPageWidth() const - { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEX ) != 0 ); } + { return bool( nControlBits & EEControlBits::AUTOPAGESIZEX ); } bool AutoPageHeight() const - { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEY ) != 0 ); } + { return bool( nControlBits & EEControlBits::AUTOPAGESIZEY ); } bool MarkFields() const - { return ( ( nControlBits & EE_CNTRL_MARKFIELDS ) != 0 ); } + { return bool( nControlBits & EEControlBits::MARKFIELDS ); } bool DoRestoreFont() const - { return ( ( nControlBits & EE_CNTRL_RESTOREFONT ) != 0 ); } + { return bool( nControlBits & EEControlBits::RESTOREFONT ); } bool DoImportRTFStyleSheets() const - { return ( ( nControlBits & EE_CNTRL_RTFSTYLESHEETS ) != 0 ); } + { return bool( nControlBits & EEControlBits::RTFSTYLESHEETS ); } bool DoAutoCorrect() const - { return ( ( nControlBits & EE_CNTRL_AUTOCORRECT ) != 0 ); } + { return bool( nControlBits & EEControlBits::AUTOCORRECT ); } bool DoAutoComplete() const - { return ( ( nControlBits & EE_CNTRL_AUTOCOMPLETE ) != 0 ); } + { return bool( nControlBits & EEControlBits::AUTOCOMPLETE ); } bool DoTabIndenting() const - { return ( ( nControlBits & EE_CNTRL_TABINDENTING ) != 0 ); } + { return bool( nControlBits & EEControlBits::TABINDENTING ); } bool DoFormat100() const - { return ( ( nControlBits & EE_CNTRL_FORMAT100 ) != 0 ); } + { return bool( nControlBits & EEControlBits::FORMAT100 ); } bool ULSpaceSummation() const - { return ( ( nControlBits & EE_CNTRL_ULSPACESUMMATION ) != 0 ); } + { return bool( nControlBits & EEControlBits::ULSPACESUMMATION ); } bool ULSpaceFirstParagraph() const - { return ( ( nControlBits & EE_CNTRL_ULSPACEFIRSTPARA ) != 0 ); } + { return bool( nControlBits & EEControlBits::ULSPACEFIRSTPARA ); } }; #endif // INCLUDED_EDITENG_SOURCE_EDITENG_EDITSTT2_HXX diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index c08330cdbd04..8993d3448b33 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -702,7 +702,7 @@ OUString const* EdtAutoCorrDoc::GetPrevPara(bool const) const SfxBoolItem& rBulletState = static_cast<const SfxBoolItem&>( mpEditEngine->GetParaAttrib( nPos, EE_PARA_BULLETSTATE )); bool bBullet = rBulletState.GetValue() ? true : false; - if ( !bBullet && (mpEditEngine->GetControlWord() & EE_CNTRL_OUTLINER) ) + if ( !bBullet && (mpEditEngine->GetControlWord() & EEControlBits::OUTLINER) ) { // The Outliner has still a Bullet at Level 0. const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 72c35e3db28c..febfd39745f8 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -351,10 +351,10 @@ public: void ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16 nShowCursorFlags = 0 ); Pair Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck = RGCHK_NEG ); - void SetInsertMode( bool bInsert ); + void SetInsertMode( bool bInsert ); bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); } - void EnablePaste( bool bEnable ) { SetFlags( nControl, EV_CNTRL_ENABLEPASTE, bEnable ); } + void EnablePaste( bool bEnable ) { SetFlags( nControl, EV_CNTRL_ENABLEPASTE, bEnable ); } bool IsPasteEnabled() const { return ( ( nControl & EV_CNTRL_ENABLEPASTE ) != 0 ); } bool DoSingleLinePaste() const { return ( ( nControl & EV_CNTRL_SINGLELINEPASTE ) != 0 ); } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index fb3003ed71a0..131b09cbd01b 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -135,10 +135,10 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : eDefaultHorizontalTextDirection = EE_HTEXTDIR_DEFAULT; - aStatus.GetControlWord() = EE_CNTRL_USECHARATTRIBS | EE_CNTRL_DOIDLEFORMAT | - EE_CNTRL_PASTESPECIAL | EE_CNTRL_UNDOATTRIBS | - EE_CNTRL_ALLOWBIGOBJS | EE_CNTRL_RTFSTYLESHEETS | - EE_CNTRL_FORMAT100; + aStatus.GetControlWord() = EEControlBits::USECHARATTRIBS | EEControlBits::DOIDLEFORMAT | + EEControlBits::PASTESPECIAL | EEControlBits::UNDOATTRIBS | + EEControlBits::ALLOWBIGOBJS | EEControlBits::RTFSTYLESHEETS | + EEControlBits::FORMAT100; aSelEngine.SetFunctionSet( &aSelFuncSet ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index bf4f5afa7fc2..c273180e802b 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2526,7 +2526,7 @@ void ImpEditEngine::SetVertical( bool bVertical ) if ( IsVertical() != bVertical ) { GetEditDoc().SetVertical( bVertical ); - bool bUseCharAttribs = ( aStatus.GetControlWord() & EE_CNTRL_USECHARATTRIBS ) ? sal_True : sal_False; + bool bUseCharAttribs = ( aStatus.GetControlWord() & EEControlBits::USECHARATTRIBS ) ? sal_True : sal_False; GetEditDoc().CreateDefFont( bUseCharAttribs ); if ( IsFormatted() ) { @@ -4178,9 +4178,9 @@ void ImpEditEngine::SetFlatMode( bool bFlat ) return; if ( !bFlat ) - aStatus.TurnOnFlags( EE_CNTRL_USECHARATTRIBS ); + aStatus.TurnOnFlags( EEControlBits::USECHARATTRIBS ); else - aStatus.TurnOffFlags( EE_CNTRL_USECHARATTRIBS ); + aStatus.TurnOffFlags( EEControlBits::USECHARATTRIBS ); aEditDoc.CreateDefFont( !bFlat ); diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index 3b1c160b3bae..ad3c1a6e40f1 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -46,7 +46,7 @@ OutlinerEditEng::~OutlinerEditEng() void OutlinerEditEng::PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) { - if( GetControlWord() & EE_CNTRL_OUTLINER ) + if( GetControlWord() & EEControlBits::OUTLINER ) { PaintFirstLineInfo aInfo( nPara, rStartPos, nBaseLineY, rOrigin, nOrientation, pOutDev ); pOwner->maPaintFirstLineHdl.Call( &aInfo ); diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index 3fc587e35fb3..8dd6ef1456f3 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -274,12 +274,12 @@ bool Outliner::IsInSelectionMode() const return pEditEngine->IsInSelectionMode(); } -void Outliner::SetControlWord( sal_uLong nWord ) +void Outliner::SetControlWord( EEControlBits nWord ) { pEditEngine->SetControlWord( nWord ); } -sal_uLong Outliner::GetControlWord() const +EEControlBits Outliner::GetControlWord() const { return pEditEngine->GetControlWord(); } diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 83a0f7ad5086..959bb65f639b 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -198,8 +198,8 @@ void Outliner::Init( sal_uInt16 nMode ) Clear(); - sal_uLong nCtrl = pEditEngine->GetControlWord(); - nCtrl &= ~(EE_CNTRL_OUTLINER|EE_CNTRL_OUTLINER2); + EEControlBits nCtrl = pEditEngine->GetControlWord(); + nCtrl &= ~EEControlBits(EEControlBits::OUTLINER|EEControlBits::OUTLINER2); SetMaxDepth( 9 ); @@ -210,10 +210,10 @@ void Outliner::Init( sal_uInt16 nMode ) break; case OUTLINERMODE_OUTLINEOBJECT: - nCtrl |= EE_CNTRL_OUTLINER2; + nCtrl |= EEControlBits::OUTLINER2; break; case OUTLINERMODE_OUTLINEVIEW: - nCtrl |= EE_CNTRL_OUTLINER; + nCtrl |= EEControlBits::OUTLINER; break; default: OSL_FAIL( "Outliner::Init - Invalid Mode!" ); @@ -905,7 +905,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const aBulletFont.SetOrientation( bVertical ? 2700 : 0 ); Color aColor( COL_AUTO ); - if( !pEditEngine->IsFlatMode() && !( pEditEngine->GetControlWord() & EE_CNTRL_NOCOLORS ) ) + if( !pEditEngine->IsFlatMode() && !( pEditEngine->GetControlWord() & EEControlBits::NOCOLORS ) ) { aColor = pFmt->GetBulletColor(); } @@ -1572,7 +1572,7 @@ Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, bool bRetu Point aTopLeft; Size aBulletSize( ImplGetBulletSize( nPara ) ); - bool bOutlineMode = ( pEditEngine->GetControlWord() & EE_CNTRL_OUTLINER ) != 0; + bool bOutlineMode = bool( pEditEngine->GetControlWord() & EEControlBits::OUTLINER ); // the ODF attribute text:space-before which holds the spacing to add to the left of the label const short nSpaceBefore = pFmt->GetAbsLSpace() + pFmt->GetFirstLineOffset(); diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 43f51bdc7165..183aa1860575 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -448,7 +448,7 @@ void OutlinerView::Indent( short nDiff ) if( !nDiff || ( ( nDiff > 0 ) && ImpCalcSelectedPages( true ) && !pOwner->ImpCanIndentSelectedPages( this ) ) ) return; - const bool bOutlinerView = pOwner->pEditEngine->GetControlWord() & EE_CNTRL_OUTLINER; + const bool bOutlinerView = bool(pOwner->pEditEngine->GetControlWord() & EEControlBits::OUTLINER); bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); pOwner->pEditEngine->SetUpdateMode( false ); |