diff options
59 files changed, 338 insertions, 320 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 ); diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index 441ee199391e..3449c36d5729 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -126,8 +126,8 @@ namespace frm { m_pEngine->SetModifyHdl( LINK( this, ORichTextModel, OnEngineContentModified ) ); - sal_uLong nEngineControlWord = m_pEngine->GetControlWord(); - nEngineControlWord = nEngineControlWord & ~EE_CNTRL_AUTOPAGESIZE; + EEControlBits nEngineControlWord = m_pEngine->GetControlWord(); + nEngineControlWord = nEngineControlWord & ~EEControlBits::AUTOPAGESIZE; m_pEngine->SetControlWord( nEngineControlWord ); VCLXDevice* pUnoRefDevice = new VCLXDevice; diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index b9bbc91a698c..ba253f46afdb 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -28,8 +28,9 @@ #include <rsc/rscsfx.hxx> #include <editeng/editdata.hxx> -#include <i18nlangtag/lang.h> +#include <editeng/editstat.hxx> #include <editeng/editengdllapi.h> +#include <i18nlangtag/lang.h> #include <tools/lineend.hxx> #include <tools/rtti.hxx> @@ -370,8 +371,8 @@ public: bool IsFlatMode() const; void SetFlatMode( bool bFlat ); - void SetControlWord( sal_uInt32 nWord ); - sal_uInt32 GetControlWord() const; + void SetControlWord( EEControlBits nWord ); + EEControlBits GetControlWord() const; void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ); void QuickMarkInvalid( const ESelection& rSel ); diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx index 243ff07713ff..ba973a71fc2b 100644 --- a/include/editeng/editstat.hxx +++ b/include/editeng/editstat.hxx @@ -23,33 +23,42 @@ #include <rtl/ustring.hxx> #include <tools/solar.h> #include <i18nlangtag/lang.h> +#include <o3tl/typed_flags_set.hxx> -#define EE_CNTRL_USECHARATTRIBS 0x00000001 // Use of hard character attributes -#define EE_CNTRL_USEPARAATTRIBS 0x00000002 // Using paragraph attributes. -#define EE_CNTRL_CRSRLEFTPARA 0x00000004 // Cursor is moved to another paragraph -#define EE_CNTRL_DOIDLEFORMAT 0x00000008 // Formatting idle -#define EE_CNTRL_PASTESPECIAL 0x00000010 // Allow PasteSpecial -#define EE_CNTRL_AUTOINDENTING 0x00000020 // Automatic indenting -#define EE_CNTRL_UNDOATTRIBS 0x00000040 // Undo for Attributes.... -#define EE_CNTRL_ONECHARPERLINE 0x00000080 // One character per line -#define EE_CNTRL_NOCOLORS 0x00000100 // Engine: No Color -#define EE_CNTRL_OUTLINER 0x00000200 // Special treatment Outliner/Outline mode -#define EE_CNTRL_OUTLINER2 0x00000400 // Special treatment Outliner/Page -#define EE_CNTRL_ALLOWBIGOBJS 0x00000800 // Portion info in text object -#define EE_CNTRL_ONLINESPELLING 0x00001000 // During the edit Spelling -#define EE_CNTRL_STRETCHING 0x00002000 // Stretch mode -#define EE_CNTRL_MARKFIELDS 0x00004000 // Mark Fields with color -#define EE_CNTRL_RESTOREFONT 0x00010000 // Restore Font in OutDev -#define EE_CNTRL_RTFSTYLESHEETS 0x00020000 // Use Stylesheets when imported -#define EE_CNTRL_AUTOCORRECT 0x00080000 // AutoCorrect -#define EE_CNTRL_AUTOCOMPLETE 0x00100000 // AutoComplete -#define EE_CNTRL_AUTOPAGESIZEX 0x00200000 // Adjust paper width to Text -#define EE_CNTRL_AUTOPAGESIZEY 0x00400000 // Adjust paper height to Text -#define EE_CNTRL_AUTOPAGESIZE (EE_CNTRL_AUTOPAGESIZEX|EE_CNTRL_AUTOPAGESIZEY) -#define EE_CNTRL_TABINDENTING 0x00800000 // Indent with tab -#define EE_CNTRL_FORMAT100 0x01000000 // Always format to 100% -#define EE_CNTRL_ULSPACESUMMATION 0x02000000 // MS Compat: sum SA and SB, not maximum value -#define EE_CNTRL_ULSPACEFIRSTPARA 0x04000000 // MS Compat: evaluate also at the first paragraph +enum class EEControlBits +{ + NONE = 0x00000000, + USECHARATTRIBS = 0x00000001, // Use of hard character attributes + USEPARAATTRIBS = 0x00000002, // Using paragraph attributes. + CRSRLEFTPARA = 0x00000004, // Cursor is moved to another paragraph + DOIDLEFORMAT = 0x00000008, // Formatting idle + PASTESPECIAL = 0x00000010, // Allow PasteSpecial + AUTOINDENTING = 0x00000020, // Automatic indenting + UNDOATTRIBS = 0x00000040, // Undo for Attributes.... + ONECHARPERLINE = 0x00000080, // One character per line + NOCOLORS = 0x00000100, // Engine: No Color + OUTLINER = 0x00000200, // Special treatment Outliner/Outline mode + OUTLINER2 = 0x00000400, // Special treatment Outliner/Page + ALLOWBIGOBJS = 0x00000800, // Portion info in text object + ONLINESPELLING = 0x00001000, // During the edit Spelling + STRETCHING = 0x00002000, // Stretch mode + MARKFIELDS = 0x00004000, // Mark Fields with color + RESTOREFONT = 0x00010000, // Restore Font in OutDev + RTFSTYLESHEETS = 0x00020000, // Use Stylesheets when imported + AUTOCORRECT = 0x00080000, // AutoCorrect + AUTOCOMPLETE = 0x00100000, // AutoComplete + AUTOPAGESIZEX = 0x00200000, // Adjust paper width to Text + AUTOPAGESIZEY = 0x00400000, // Adjust paper height to Text + AUTOPAGESIZE = (AUTOPAGESIZEX | AUTOPAGESIZEY), + TABINDENTING = 0x00800000, // Indent with tab + FORMAT100 = 0x01000000, // Always format to 100% + ULSPACESUMMATION = 0x02000000, // MS Compat: sum SA and SB, not maximum value + ULSPACEFIRSTPARA = 0x04000000, // MS Compat: evaluate also at the first paragraph +}; +namespace o3tl +{ + template<> struct typed_flags<EEControlBits> : is_typed_flags<EEControlBits, 0x07ffffff> {}; +} #define EV_CNTRL_AUTOSCROLL 0x00000001 // Auto scrolling horizontally #define EV_CNTRL_BIGSCROLL 0x00000002 // Scroll further to the cursor @@ -74,6 +83,14 @@ EE_STAT_CRSRLEFTPARA at the time cursor movement and the enter. */ +inline void SetFlags( EEControlBits& rBits, EEControlBits nMask, bool bOn ) +{ + if ( bOn ) + rBits |= nMask; + else + rBits &= ~nMask; +} + inline void SetFlags( sal_uLong& rBits, const sal_uInt32 nMask, bool bOn ) { if ( bOn ) @@ -85,22 +102,22 @@ inline void SetFlags( sal_uLong& rBits, const sal_uInt32 nMask, bool bOn ) class EditStatus { protected: - sal_uLong nStatusBits; - sal_uLong nControlBits; - sal_Int32 nPrevPara; // for EE_STAT_CRSRLEFTPARA + sal_uLong nStatusBits; + EEControlBits nControlBits; + sal_Int32 nPrevPara; // for EE_STAT_CRSRLEFTPARA public: - EditStatus() { nStatusBits = 0; nControlBits = 0; nPrevPara = -1; } + EditStatus() { nStatusBits = 0; nControlBits = EEControlBits::NONE; nPrevPara = -1; } void Clear() { nStatusBits = 0; } - void SetControlBits( sal_uLong nMask, bool bOn ) + void SetControlBits( EEControlBits nMask, bool bOn ) { SetFlags( nControlBits, nMask, bOn ); } sal_uLong GetStatusWord() const { return nStatusBits; } sal_uLong& GetStatusWord() { return nStatusBits; } - sal_uLong GetControlWord() const { return nControlBits; } - sal_uLong& GetControlWord() { return nControlBits; } + EEControlBits GetControlWord() const { return nControlBits; } + EEControlBits& GetControlWord() { return nControlBits; } sal_Int32 GetPrevParagraph() const { return nPrevPara; } sal_Int32& GetPrevParagraph() { return nPrevPara; } diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 24b7130c30c2..d80263f1b74d 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -20,6 +20,7 @@ #define INCLUDED_EDITENG_OUTLINER_HXX #include <editeng/editdata.hxx> +#include <editeng/editstat.hxx> #include <editeng/numitem.hxx> #include <i18nlangtag/lang.h> #include <rtl/ustring.hxx> @@ -893,8 +894,8 @@ public: Link GetWidthArrReqHdl() const{ return aWidthArrReqHdl; } void SetWidthArrReqHdl(const Link& rLink){aWidthArrReqHdl=rLink; } - void SetControlWord( sal_uLong nWord ); - sal_uLong GetControlWord() const; + void SetControlWord( EEControlBits nWord ); + EEControlBits GetControlWord() const; Link GetBeginMovingHdl() const { return aBeginMovingHdl; } void SetBeginMovingHdl(const Link& rLink) {aBeginMovingHdl=rLink;} diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx index 8732926dd272..e03870c274e5 100644 --- a/sc/source/core/data/cellvalue.cxx +++ b/sc/source/core/data/cellvalue.cxx @@ -349,8 +349,8 @@ void ScCellValue::assign( const ScCellValue& rOther, ScDocument& rDestDoc, int n ScFieldEditEngine& rEngine = rDestDoc.GetEditEngine(); if (rOther.mpEditText->HasOnlineSpellErrors()) { - sal_uLong nControl = rEngine.GetControlWord(); - const sal_uLong nSpellControl = EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS; + EEControlBits nControl = rEngine.GetControlWord(); + const EEControlBits nSpellControl = EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS; bool bNewControl = ((nControl & nSpellControl) != nSpellControl); if (bNewControl) rEngine.SetControlWord(nControl | nSpellControl); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 53d7ccf57f22..9376685bcbda 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -353,11 +353,11 @@ long ScColumn::GetNeededSize( pEngine->SetUpdateMode( false ); bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER ); - sal_uLong nCtrl = pEngine->GetControlWord(); + EEControlBits nCtrl = pEngine->GetControlWord(); if ( bTextWysiwyg ) - nCtrl |= EE_CNTRL_FORMAT100; + nCtrl |= EEControlBits::FORMAT100; else - nCtrl &= ~EE_CNTRL_FORMAT100; + nCtrl &= ~EEControlBits::FORMAT100; pEngine->SetControlWord( nCtrl ); MapMode aOld = pDev->GetMapMode(); pDev->SetMapMode( aHMMMode ); @@ -504,7 +504,7 @@ long ScColumn::GetNeededSize( if ( !bTextWysiwyg && ( rZoomY.GetNumerator() != 1 || rZoomY.GetDenominator() != 1 ) && ( pEngine->GetParagraphCount() > 1 || ( bBreak && pEngine->GetLineCount(0) > 1 ) ) ) { - pEngine->SetControlWord( nCtrl | EE_CNTRL_FORMAT100 ); + pEngine->SetControlWord( nCtrl | EEControlBits::FORMAT100 ); pEngine->QuickFormatDoc( true ); long nSecondValue = pDev->LogicToPixel(Size( 0, pEngine->GetTextHeight() ), aHMMMode).Height(); if ( nSecondValue > nValue ) @@ -1056,8 +1056,8 @@ public: if (!mpEngine) { mpEngine.reset(new ScFieldEditEngine(mpDoc, mpDoc->GetEditPool())); - // EE_CNTRL_ONLINESPELLING if there are errors already - mpEngine->SetControlWord(mpEngine->GetControlWord() | EE_CNTRL_ONLINESPELLING); + // EEControlBits::ONLINESPELLING if there are errors already + mpEngine->SetControlWord(mpEngine->GetControlWord() | EEControlBits::ONLINESPELLING); mpDoc->ApplyAsianEditSettings(*mpEngine); } mpEngine->SetText(*pObj); @@ -1081,10 +1081,10 @@ public: if (bNeedObject) // remains edit cell { - sal_uInt32 nCtrl = mpEngine->GetControlWord(); - sal_uInt32 nWantBig = bSpellErrors ? EE_CNTRL_ALLOWBIGOBJS : 0; - if ( ( nCtrl & EE_CNTRL_ALLOWBIGOBJS ) != nWantBig ) - mpEngine->SetControlWord( (nCtrl & ~EE_CNTRL_ALLOWBIGOBJS) | nWantBig ); + EEControlBits nCtrl = mpEngine->GetControlWord(); + EEControlBits nWantBig = bSpellErrors ? EEControlBits::ALLOWBIGOBJS : EEControlBits::NONE; + if ( ( nCtrl & EEControlBits::ALLOWBIGOBJS ) != nWantBig ) + mpEngine->SetControlWord( (nCtrl & ~EEControlBits::ALLOWBIGOBJS) | nWantBig ); // Overwrite the existing object. delete pObj; diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index d2478a880d58..dce8dd7cd0ed 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -164,8 +164,8 @@ EditTextObject* ScEditUtil::Clone( const EditTextObject& rObj, ScDocument& rDest EditEngine& rEngine = rDestDoc.GetEditEngine(); if (rObj.HasOnlineSpellErrors()) { - sal_uLong nControl = rEngine.GetControlWord(); - const sal_uLong nSpellControl = EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS; + EEControlBits nControl = rEngine.GetControlWord(); + const EEControlBits nSpellControl = EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS; bool bNewControl = ( (nControl & nSpellControl) != nSpellControl ); if (bNewControl) rEngine.SetControlWord(nControl | nSpellControl); @@ -709,7 +709,7 @@ void ScTabEditEngine::Init( const ScPatternAttr& rPattern ) rPattern.FillEditItemSet( pEditDefaults ); SetDefaults( pEditDefaults ); // wir haben keine StyleSheets fuer Text - SetControlWord( GetControlWord() & ~EE_CNTRL_RTFSTYLESHEETS ); + SetControlWord( GetControlWord() & ~EEControlBits::RTFSTYLESHEETS ); } // Feldbefehle fuer Kopf- und Fusszeilen @@ -850,7 +850,7 @@ ScFieldEditEngine::ScFieldEditEngine( { if ( pTextObjectPool ) SetEditTextObjectPool( pTextObjectPool ); - SetControlWord( (GetControlWord() | EE_CNTRL_MARKFIELDS) & ~EE_CNTRL_RTFSTYLESHEETS ); + SetControlWord( EEControlBits(GetControlWord() | EEControlBits::MARKFIELDS) & ~EEControlBits::RTFSTYLESHEETS ); } OUString ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField, @@ -882,7 +882,7 @@ ScNoteEditEngine::ScNoteEditEngine( SfxItemPool* pEnginePoolP, { if ( pTextObjectPool ) SetEditTextObjectPool( pTextObjectPool ); - SetControlWord( (GetControlWord() | EE_CNTRL_MARKFIELDS) & ~EE_CNTRL_RTFSTYLESHEETS ); + SetControlWord( EEControlBits(GetControlWord() | EEControlBits::MARKFIELDS) & ~EEControlBits::RTFSTYLESHEETS ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 7375719c77d7..c3ea29bafff8 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -352,7 +352,7 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const rEE.SetEditTextObjectPool( GetDoc().GetEditPool() ); rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); - rEE.SetControlWord( rEE.GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS ); + rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); } return *mrData.mxEditEngine; } @@ -366,7 +366,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const rEE.SetRefMapMode( MAP_TWIP ); // headers/footers use twips as default metric rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); - rEE.SetControlWord( rEE.GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS ); + rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); // set Calc header/footer defaults SfxItemSet* pEditSet = new SfxItemSet( rEE.GetEmptyItemSet() ); @@ -390,7 +390,7 @@ EditEngine& XclRoot::GetDrawEditEngine() const rEE.SetRefMapMode( MAP_100TH_MM ); rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); - rEE.SetControlWord( rEE.GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS ); + rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); } return *mrData.mxDrawEditEng; } diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 1b77eeca9779..05a409c4359c 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -577,7 +577,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile ) mxEditEngine->SetEditTextObjectPool( rDoc.GetEditPool() ); mxEditEngine->SetUpdateMode( false ); mxEditEngine->EnableUndo( false ); - mxEditEngine->SetControlWord( mxEditEngine->GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS ); + mxEditEngine->SetControlWord( mxEditEngine->GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); // set some document properties needed during import if( mrBaseFilter.isImportFilter() ) diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 25dd3dba6704..921b105e64b5 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -3418,7 +3418,7 @@ ScEditEngineDefaulter* ScXMLImport::GetEditEngine() mpEditEngine->SetEditTextObjectPool(pDoc->GetEditPool()); mpEditEngine->SetUpdateMode(false); mpEditEngine->EnableUndo(false); - mpEditEngine->SetControlWord(mpEditEngine->GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS); + mpEditEngine->SetControlWord(mpEditEngine->GetControlWord() & ~EEControlBits::ALLOWBIGOBJS); } return mpEditEngine.get(); } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 74c6222d11a9..d394c604b6e2 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -594,11 +594,11 @@ void ScInputHandler::UpdateRefDevice() bool bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg(); bool bInPlace = pActiveViewSh && pActiveViewSh->GetViewFrame()->GetFrame().IsInPlace(); - sal_uLong nCtrl = pEngine->GetControlWord(); + EEControlBits nCtrl = pEngine->GetControlWord(); if ( bTextWysiwyg || bInPlace ) - nCtrl |= EE_CNTRL_FORMAT100; // EditEngine default: always format for 100% + nCtrl |= EEControlBits::FORMAT100; // EditEngine default: always format for 100% else - nCtrl &= ~EE_CNTRL_FORMAT100; // when formatting for screen, use the actual MapMode + nCtrl &= ~EEControlBits::FORMAT100; // when formatting for screen, use the actual MapMode pEngine->SetControlWord( nCtrl ); if ( bTextWysiwyg && pActiveViewSh ) pEngine->SetRefDevice( pActiveViewSh->GetViewData().GetDocument()->GetPrinter() ); @@ -632,7 +632,7 @@ void ScInputHandler::ImplCreateEditEngine() pEngine->SetPaperSize( Size( 1000000, 1000000 ) ); pEditDefaults = new SfxItemSet( pEngine->GetEmptyItemSet() ); - pEngine->SetControlWord( pEngine->GetControlWord() | EE_CNTRL_AUTOCORRECT ); + pEngine->SetControlWord( pEngine->GetControlWord() | EEControlBits::AUTOCORRECT ); pEngine->SetModifyHdl( LINK( this, ScInputHandler, ModifyHdl ) ); } @@ -648,15 +648,15 @@ void ScInputHandler::ImplCreateEditEngine() void ScInputHandler::UpdateAutoCorrFlag() { - sal_uLong nCntrl = pEngine->GetControlWord(); - sal_uLong nOld = nCntrl; + EEControlBits nCntrl = pEngine->GetControlWord(); + EEControlBits nOld = nCntrl; // Don't use pLastPattern here (may be invalid because of AutoStyle) bool bDisable = bLastIsSymbol || bFormulaMode; if ( bDisable ) - nCntrl &= ~EE_CNTRL_AUTOCORRECT; + nCntrl &= ~EEControlBits::AUTOCORRECT; else - nCntrl |= EE_CNTRL_AUTOCORRECT; + nCntrl |= EEControlBits::AUTOCORRECT; if ( nCntrl != nOld ) pEngine->SetControlWord(nCntrl); @@ -680,17 +680,17 @@ void ScInputHandler::UpdateSpellSettings( bool bFromStartTab ) if ( bFromStartTab || eMode != SC_INPUT_NONE ) { - sal_uLong nCntrl = pEngine->GetControlWord(); - sal_uLong nOld = nCntrl; + EEControlBits nCntrl = pEngine->GetControlWord(); + EEControlBits nOld = nCntrl; if( bOnlineSpell ) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; // No AutoCorrect for Symbol Font (EditEngine does no evaluate Default) if ( pLastPattern && pLastPattern->IsSymbolFont() ) - nCntrl &= ~EE_CNTRL_AUTOCORRECT; + nCntrl &= ~EEControlBits::AUTOCORRECT; else - nCntrl |= EE_CNTRL_AUTOCORRECT; + nCntrl |= EEControlBits::AUTOCORRECT; if ( nCntrl != nOld ) pEngine->SetControlWord(nCntrl); @@ -3512,9 +3512,9 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState, // Online spelling is turned back on in StartTable, after setting // the right language from cell attributes. - sal_uLong nCntrl = pEngine->GetControlWord(); - if ( nCntrl & EE_CNTRL_ONLINESPELLING ) - pEngine->SetControlWord( nCntrl & ~EE_CNTRL_ONLINESPELLING ); + EEControlBits nCntrl = pEngine->GetControlWord(); + if ( nCntrl & EEControlBits::ONLINESPELLING ) + pEngine->SetControlWord( nCntrl & ~EEControlBits::ONLINESPELLING ); bModified = false; bSelIsRef = false; diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index fb5abdfa215a..728e14e952ef 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1691,12 +1691,12 @@ void ScTextWnd::UpdateAutoCorrFlag() { if ( pEditEngine ) { - sal_uLong nControl = pEditEngine->GetControlWord(); - sal_uLong nOld = nControl; + EEControlBits nControl = pEditEngine->GetControlWord(); + EEControlBits nOld = nControl; if ( bFormulaMode ) - nControl &= ~EE_CNTRL_AUTOCORRECT; // No AutoCorrect in Formulas + nControl &= ~EEControlBits::AUTOCORRECT; // No AutoCorrect in Formulas else - nControl |= EE_CNTRL_AUTOCORRECT; // Else do enable it + nControl |= EEControlBits::AUTOCORRECT; // Else do enable it if ( nControl != nOld ) pEditEngine->SetControlWord( nControl ); diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index c0f3166be1cd..8f0a1b4a578b 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -94,7 +94,7 @@ ScEditWindow::ScEditWindow( vcl::Window* pParent, WinBits nBits, ScEditWindowLoc // Feldbefehle: pEdEngine->SetData( aData ); - pEdEngine->SetControlWord( pEdEngine->GetControlWord() | EE_CNTRL_MARKFIELDS ); + pEdEngine->SetControlWord( pEdEngine->GetControlWord() | EEControlBits::MARKFIELDS ); mbRTL = ScGlobal::IsSystemRTL(); if (mbRTL) pEdEngine->SetDefaultHorizontalTextDirection(EE_HTEXTDIR_R2L); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 3bbe8b8f6503..9881145b3a71 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5369,7 +5369,7 @@ bool ScGridWindow::IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCROW nRow if (!aLogicEdit.IsInside(aLogicClick)) return false; - pEngine->SetControlWord(pEngine->GetControlWord() | EE_CNTRL_ONLINESPELLING); + pEngine->SetControlWord(pEngine->GetControlWord() | EEControlBits::ONLINESPELLING); pEngine->SetAllMisspellRanges(*pRanges); EditView aTempView(pEngine.get(), this); @@ -5536,7 +5536,7 @@ bool ScGridWindow::ContinueOnlineSpelling() // because MapMode must be set for some old documents pEngine.reset(new ScTabEditEngine(pDoc)); pEngine->SetControlWord( - pEngine->GetControlWord() | (EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS)); + pEngine->GetControlWord() | (EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS)); pEngine->SetStatusEventHdl(LINK(&aStatus, SpellCheckStatus, EventHdl)); // Delimiters hier wie in inputhdl.cxx !!! pEngine->SetWordDelimiters( diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 6a6c13dd3f47..9391e4947f18 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2095,13 +2095,13 @@ ScFieldEditEngine* ScOutputData::CreateOutputEditEngine() pEngine->SetUpdateMode( false ); // a RefDevice always has to be set, otherwise EditEngine would create a VirtualDevice pEngine->SetRefDevice( pFmtDevice ); - sal_uLong nCtrl = pEngine->GetControlWord(); + EEControlBits nCtrl = pEngine->GetControlWord(); if ( bShowSpellErrors ) - nCtrl |= EE_CNTRL_ONLINESPELLING; + nCtrl |= EEControlBits::ONLINESPELLING; if ( eType == OUTTYPE_PRINTER ) - nCtrl &= ~EE_CNTRL_MARKFIELDS; + nCtrl &= ~EEControlBits::MARKFIELDS; if ( eType == OUTTYPE_WINDOW && mpRefDevice == pFmtDevice ) - nCtrl &= ~EE_CNTRL_FORMAT100; // use the actual MapMode + nCtrl &= ~EEControlBits::FORMAT100; // use the actual MapMode pEngine->SetControlWord( nCtrl ); mpDoc->ApplyAsianEditSettings( *pEngine ); pEngine->EnableAutoColor( mbUseStyleColor ); @@ -2405,11 +2405,11 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor) mpOldCondSet = mpCondSet; mpOldPreviewFontSet = mpPreviewFontSet; - sal_uLong nControl = mpEngine->GetControlWord(); + EEControlBits nControl = mpEngine->GetControlWord(); if (meOrient == SVX_ORIENTATION_STACKED) - nControl |= EE_CNTRL_ONECHARPERLINE; + nControl |= EEControlBits::ONECHARPERLINE; else - nControl &= ~EE_CNTRL_ONECHARPERLINE; + nControl &= ~EEControlBits::ONECHARPERLINE; mpEngine->SetControlWord( nControl ); if ( !mbHyphenatorSet && static_cast<const SfxBoolItem&>(pSet->Get(EE_PARA_HYPHENATE)).GetValue() ) @@ -3764,7 +3764,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) if ( rParam.mbAsianVertical ) { - // in asian mode, use EditEngine::SetVertical instead of EE_CNTRL_ONECHARPERLINE + // in asian mode, use EditEngine::SetVertical instead of EEControlBits::ONECHARPERLINE rParam.meOrient = SVX_ORIENTATION_STANDARD; DrawEditAsianVertical(rParam); return; @@ -4764,11 +4764,11 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) pOldPattern = pPattern; pOldCondSet = pCondSet; - sal_uLong nControl = pEngine->GetControlWord(); + EEControlBits nControl = pEngine->GetControlWord(); if (eOrient==SVX_ORIENTATION_STACKED) - nControl |= EE_CNTRL_ONECHARPERLINE; + nControl |= EEControlBits::ONECHARPERLINE; else - nControl &= ~EE_CNTRL_ONECHARPERLINE; + nControl &= ~EEControlBits::ONECHARPERLINE; pEngine->SetControlWord( nControl ); if ( !bHyphenatorSet && static_cast<const SfxBoolItem&>(pSet->Get(EE_PARA_HYPHENATE)).GetValue() ) diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index cf4d8e8fa5f7..095ef36fe5a6 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1676,7 +1676,7 @@ void ScPrintFunc::MakeEditEngine() pEditEngine->SetRefDevice(pPrinter ? pPrinter : pDoc->GetRefDevice()); pEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) ); - pEditEngine->SetControlWord( pEditEngine->GetControlWord() & ~EE_CNTRL_RTFSTYLESHEETS ); + pEditEngine->SetControlWord( pEditEngine->GetControlWord() & ~EEControlBits::RTFSTYLESHEETS ); pDoc->ApplyAsianEditSettings( *pEditEngine ); pEditEngine->EnableAutoColor( bUseStyleColor ); diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx index b3f75e402cb3..359876bcb9fe 100644 --- a/sc/source/ui/view/spelldialog.cxx +++ b/sc/source/ui/view/spelldialog.cxx @@ -251,7 +251,7 @@ void ScSpellDialogChildWindow::Init() mpViewData->SetSpellingView( pEditView ); Rectangle aRect( Point( 0, 0 ), Point( 0, 0 ) ); pEditView->SetOutputArea( aRect ); - mxEngine->SetControlWord( EE_CNTRL_USECHARATTRIBS ); + mxEngine->SetControlWord( EEControlBits::USECHARATTRIBS ); mxEngine->EnableUndo( false ); mxEngine->SetPaperSize( aRect.GetSize() ); mxEngine->SetText( EMPTY_OUSTRING ); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index db824d56a1cd..5675d68e5720 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -942,8 +942,8 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, // bei IdleFormat wird manchmal ein Cursor gemalt, wenn die View schon weg ist (23576) - sal_uLong nEC = pNewEngine->GetControlWord(); - pNewEngine->SetControlWord(nEC & ~EE_CNTRL_DOIDLEFORMAT); + EEControlBits nEC = pNewEngine->GetControlWord(); + pNewEngine->SetControlWord(nEC & ~EEControlBits::DOIDLEFORMAT); sal_uLong nVC = pEditView[eWhich]->GetControlWord(); pEditView[eWhich]->SetControlWord(nVC & ~EV_CNTRL_AUTOSCROLL); @@ -3013,13 +3013,13 @@ void ScViewData::UpdateOutlinerFlags( Outliner& rOutl ) const ScDocument* pLocalDoc = GetDocument(); bool bOnlineSpell = pLocalDoc->GetDocOptions().IsAutoSpell(); - sal_uLong nCntrl = rOutl.GetControlWord(); - nCntrl |= EE_CNTRL_MARKFIELDS; - nCntrl |= EE_CNTRL_AUTOCORRECT; + EEControlBits nCntrl = rOutl.GetControlWord(); + nCntrl |= EEControlBits::MARKFIELDS; + nCntrl |= EEControlBits::AUTOCORRECT; if( bOnlineSpell ) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; rOutl.SetControlWord(nCntrl); rOutl.SetCalcFieldValueHdl( LINK( SC_MOD(), ScModule, CalcFieldValueHdl ) ); diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index f9d054cfb8f0..0317fa4d7201 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -518,7 +518,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR rViewData.SetSpellingView( pEditView ); Rectangle aRect( Point( 0, 0 ), Point( 0, 0 ) ); pEditView->SetOutputArea( aRect ); - pEngine->SetControlWord( EE_CNTRL_USECHARATTRIBS ); + pEngine->SetControlWord( EEControlBits::USECHARATTRIBS ); pEngine->EnableUndo( false ); pEngine->SetPaperSize( aRect.GetSize() ); pEngine->SetText( EMPTY_OUSTRING ); diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 51a29afd5393..0cf966ee201d 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -279,22 +279,22 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) SetLinkManager( new sfx2::LinkManager(mpDocSh) ); } - sal_uLong nCntrl = rOutliner.GetControlWord(); - nCntrl |= EE_CNTRL_ALLOWBIGOBJS; + EEControlBits nCntrl = rOutliner.GetControlWord(); + nCntrl |= EEControlBits::ALLOWBIGOBJS; if (mbOnlineSpell) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; - nCntrl &= ~ EE_CNTRL_ULSPACESUMMATION; + nCntrl &= ~ EEControlBits::ULSPACESUMMATION; if ( meDocType != DOCUMENT_TYPE_IMPRESS ) SetSummationOfParagraphs( false ); else { SetSummationOfParagraphs( pOptions->IsSummationOfParagraphs() ); if ( pOptions->IsSummationOfParagraphs() ) - nCntrl |= EE_CNTRL_ULSPACESUMMATION; + nCntrl |= EEControlBits::ULSPACESUMMATION; } rOutliner.SetControlWord(nCntrl); @@ -326,13 +326,13 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) pHitTestOutliner->SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() ); - sal_uLong nCntrl2 = pHitTestOutliner->GetControlWord(); - nCntrl2 |= EE_CNTRL_ALLOWBIGOBJS; - nCntrl2 &= ~EE_CNTRL_ONLINESPELLING; + EEControlBits nCntrl2 = pHitTestOutliner->GetControlWord(); + nCntrl2 |= EEControlBits::ALLOWBIGOBJS; + nCntrl2 &= ~EEControlBits::ONLINESPELLING; - nCntrl2 &= ~ EE_CNTRL_ULSPACESUMMATION; + nCntrl2 &= ~ EEControlBits::ULSPACESUMMATION; if ( pOptions->IsSummationOfParagraphs() ) - nCntrl2 |= EE_CNTRL_ULSPACESUMMATION; + nCntrl2 |= EEControlBits::ULSPACESUMMATION; pHitTestOutliner->SetControlWord( nCntrl2 ); @@ -613,11 +613,11 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode) // StyleRequestHandler are. ::Outliner& rDrawOutliner = GetDrawOutliner(); rDrawOutliner.SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool())); - sal_uLong nCntrl = rDrawOutliner.GetControlWord(); + EEControlBits nCntrl = rDrawOutliner.GetControlWord(); if (mbOnlineSpell) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; rDrawOutliner.SetControlWord(nCntrl); // Initialize HitTestOutliner and DocumentOutliner, but don't initialize the @@ -831,16 +831,16 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool void SdDrawDocument::SetOnlineSpell(bool bIn) { mbOnlineSpell = bIn; - sal_uLong nCntrl = 0; + EEControlBits nCntrl; if(mpOutliner) { nCntrl = mpOutliner->GetControlWord(); if(mbOnlineSpell) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; mpOutliner->SetControlWord(nCntrl); } @@ -850,9 +850,9 @@ void SdDrawDocument::SetOnlineSpell(bool bIn) nCntrl = mpInternalOutliner->GetControlWord(); if (mbOnlineSpell) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; mpInternalOutliner->SetControlWord(nCntrl); } @@ -862,9 +862,9 @@ void SdDrawDocument::SetOnlineSpell(bool bIn) nCntrl = rOutliner.GetControlWord(); if (mbOnlineSpell) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; rOutliner.SetControlWord(nCntrl); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 8205f8a8acb6..ce15ed3b0381 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -238,9 +238,9 @@ bool ImplSdPPTImport::Import() pSdrModel->EnableUndo(false); SdrOutliner& rOutl = mpDoc->GetDrawOutliner(); - sal_uInt32 nControlWord = rOutl.GetEditEngine().GetControlWord(); - nControlWord |= EE_CNTRL_ULSPACESUMMATION; - nControlWord &=~ EE_CNTRL_ULSPACEFIRSTPARA; + EEControlBits nControlWord = rOutl.GetEditEngine().GetControlWord(); + nControlWord |= EEControlBits::ULSPACESUMMATION; + nControlWord &= ~EEControlBits::ULSPACEFIRSTPARA; ((EditEngine&)rOutl.GetEditEngine()).SetControlWord( nControlWord ); SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin(); diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index eeae073f6766..5cef329d5f5c 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -338,8 +338,8 @@ void AnnotationWindow::InitControls() mpVScrollbar->SetScrollHdl(LINK(this, AnnotationWindow, ScrollHdl)); mpVScrollbar->EnableDrag(); - sal_uLong nCntrl = mpOutliner->GetControlWord(); - nCntrl |= EE_CNTRL_PASTESPECIAL | EE_CNTRL_AUTOCORRECT | EV_CNTRL_AUTOSCROLL | EE_CNTRL_NOCOLORS; + EEControlBits nCntrl = mpOutliner->GetControlWord(); + nCntrl |= EEControlBits::PASTESPECIAL | EEControlBits::AUTOCORRECT | EEControlBits::USECHARATTRIBS | EEControlBits::NOCOLORS; mpOutliner->SetControlWord(nCntrl); Engine()->SetModifyHdl( Link() ); diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index b6f924d026c0..fc01b4a96cb0 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -672,23 +672,23 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) if ( bMiscOptions ) { pDoc->SetSummationOfParagraphs( pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ); - sal_uInt32 nSum = pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ? EE_CNTRL_ULSPACESUMMATION : 0; - sal_uInt32 nCntrl; + EEControlBits nSum = pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ? EEControlBits::ULSPACESUMMATION : EEControlBits::NONE; + EEControlBits nCntrl; SdDrawDocument* pDocument = pDocSh->GetDoc(); SdrOutliner& rOutl = pDocument->GetDrawOutliner(); - nCntrl = rOutl.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; + nCntrl = rOutl.GetControlWord() &~ EEControlBits::ULSPACESUMMATION; rOutl.SetControlWord( nCntrl | nSum ); ::sd::Outliner* pOutl = pDocument->GetOutliner( false ); if( pOutl ) { - nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; + nCntrl = pOutl->GetControlWord() &~ EEControlBits::ULSPACESUMMATION; pOutl->SetControlWord( nCntrl | nSum ); } pOutl = pDocument->GetInternalOutliner( false ); if( pOutl ) { - nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; + nCntrl = pOutl->GetControlWord() &~ EEControlBits::ULSPACESUMMATION; pOutl->SetControlWord( nCntrl | nSum ); } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index b6663dbddb63..3eb55845f39e 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -387,9 +387,9 @@ bool DrawDocShell::ImportFrom(SfxMedium &rMedium, // in. We need to tell both the edit engine of the draw outliner, // and the document, to do "summation of paragraphs". SdrOutliner& rOutl = mpDoc->GetDrawOutliner(); - sal_uInt32 nControlWord = rOutl.GetEditEngine().GetControlWord(); - nControlWord |= EE_CNTRL_ULSPACESUMMATION; - nControlWord &=~ EE_CNTRL_ULSPACEFIRSTPARA; + EEControlBits nControlWord = rOutl.GetEditEngine().GetControlWord(); + nControlWord |= EEControlBits::ULSPACESUMMATION; + nControlWord &=~ EEControlBits::ULSPACEFIRSTPARA; ((EditEngine&)rOutl.GetEditEngine()).SetControlWord( nControlWord ); mpDoc->SetSummationOfParagraphs( true ); diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index fbcd9cd68313..a9c746fe5f19 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -327,10 +327,9 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine (void) Application::GetDefaultDevice()->GetTextWidth(OUString("XXXX")))); pEditEngine->SetControlWord( - (pEditEngine->GetControlWord() - | EE_CNTRL_AUTOINDENTING) & - (~EE_CNTRL_UNDOATTRIBS) & - (~EE_CNTRL_PASTESPECIAL)); + EEControlBits(pEditEngine->GetControlWord() | EEControlBits::AUTOINDENTING) & + EEControlBits(~EEControlBits::UNDOATTRIBS) & + EEControlBits(~EEControlBits::PASTESPECIAL) ); pEditEngine->SetWordDelimiters (" .=+-*/(){}[];\""); pEditEngine->SetRefMapMode (MAP_PIXEL); diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index b5f2b71f359e..812469caf889 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -297,12 +297,12 @@ void PreviewRenderer::PaintPage ( // Turn off online spelling and redlining. SdrOutliner* pOutliner = NULL; - sal_uLong nSavedControlWord (0); + EEControlBits nSavedControlWord; if (mpDocShellOfView!=NULL && mpDocShellOfView->GetDoc()!=NULL) { pOutliner = &mpDocShellOfView->GetDoc()->GetDrawOutliner(); nSavedControlWord = pOutliner->GetControlWord(); - pOutliner->SetControlWord((nSavedControlWord & ~EE_CNTRL_ONLINESPELLING)); + pOutliner->SetControlWord((nSavedControlWord & ~EEControlBits::ONLINESPELLING)); } // Use a special redirector to prevent PresObj shapes from being painted. diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 6264d10b11c8..26f0f9f72873 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -786,24 +786,24 @@ throw (UnknownPropertyException, PropertyVetoException, bChanged = true; if ( pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS ) { - sal_uInt32 nSum = bIsSummationOfParagraphs ? EE_CNTRL_ULSPACESUMMATION : 0; - sal_uInt32 nCntrl; + EEControlBits nSum = bIsSummationOfParagraphs ? EEControlBits::ULSPACESUMMATION : EEControlBits::NONE; + EEControlBits nCntrl; pDoc->SetSummationOfParagraphs( bIsSummationOfParagraphs ); SdDrawDocument* pDocument = pDocSh->GetDoc(); SdrOutliner& rOutl = pDocument->GetDrawOutliner(); - nCntrl = rOutl.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; + nCntrl = rOutl.GetControlWord() &~ EEControlBits::ULSPACESUMMATION; rOutl.SetControlWord( nCntrl | nSum ); ::sd::Outliner* pOutl = pDocument->GetOutliner( false ); if( pOutl ) { - nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; + nCntrl = pOutl->GetControlWord() &~ EEControlBits::ULSPACESUMMATION; pOutl->SetControlWord( nCntrl | nSum ); } pOutl = pDocument->GetInternalOutliner( false ); if( pOutl ) { - nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; + nCntrl = pOutl->GetControlWord() &~ EEControlBits::ULSPACESUMMATION; pOutl->SetControlWord( nCntrl | nSum ); } } diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 57d7736cd0a3..a421de2bc64b 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1428,10 +1428,10 @@ private: mpPrinter->SetMapMode(aMap); ::Outliner& rOutliner = mrBase.GetDocument()->GetDrawOutliner(); - const sal_uLong nSavedControlWord (rOutliner.GetControlWord()); - sal_uLong nCntrl = nSavedControlWord; - nCntrl &= ~EE_CNTRL_MARKFIELDS; - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + const EEControlBits nSavedControlWord (rOutliner.GetControlWord()); + EEControlBits nCntrl = nSavedControlWord; + nCntrl &= ~EEControlBits::MARKFIELDS; + nCntrl &= ~EEControlBits::ONLINESPELLING; rOutliner.SetControlWord( nCntrl ); // When in outline view then apply all pending changes to the model. diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 1077a24b5c81..26d15c9c95e5 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -171,10 +171,10 @@ Outliner::Outliner( SdDrawDocument* pDoc, sal_uInt16 nMode ) SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); SetForbiddenCharsTable( pDoc->GetForbiddenCharsTable() ); - sal_uLong nCntrl = GetControlWord(); - nCntrl |= EE_CNTRL_ALLOWBIGOBJS; - nCntrl |= EE_CNTRL_MARKFIELDS; - nCntrl |= EE_CNTRL_AUTOCORRECT; + EEControlBits nCntrl = GetControlWord(); + nCntrl |= EEControlBits::ALLOWBIGOBJS; + nCntrl |= EEControlBits::MARKFIELDS; + nCntrl |= EEControlBits::AUTOCORRECT; bool bOnlineSpell = false; @@ -203,9 +203,9 @@ Outliner::Outliner( SdDrawDocument* pDoc, sal_uInt16 nMode ) } if (bOnlineSpell) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; SetControlWord(nCntrl); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index bded56ca05b9..96b7c65adc77 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1371,12 +1371,12 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) if (pOL) { - sal_uLong nCntrl = pOL->GetControlWord(); + EEControlBits nCntrl = pOL->GetControlWord(); if (bOnlineSpell) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; pOL->SetControlWord(nCntrl); } diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index d75a96d3c87c..7806b653dfea 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -251,17 +251,17 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) case SID_COLORVIEW: { ::Outliner* pOutl = pOutlinerView->GetOutliner(); - sal_uLong nCntrl = pOutl->GetControlWord(); + EEControlBits nCntrl = pOutl->GetControlWord(); - if ( !(nCntrl & EE_CNTRL_NOCOLORS) ) + if ( !(nCntrl & EEControlBits::NOCOLORS) ) { // color view is enabled: disable - pOutl->SetControlWord(nCntrl | EE_CNTRL_NOCOLORS); + pOutl->SetControlWord(nCntrl | EEControlBits::NOCOLORS); } else { // color view is disabled: enable - pOutl->SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS); + pOutl->SetControlWord(nCntrl & ~EEControlBits::NOCOLORS); } InvalidateWindows(); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index bc7ec61bc3a8..24df4ce1107b 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -785,9 +785,9 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) else { // Enable color view? - sal_uLong nCntrl = rOutl.GetControlWord(); + EEControlBits nCntrl = rOutl.GetControlWord(); bool bNoColor = false; - if (nCntrl & EE_CNTRL_NOCOLORS) + if (nCntrl & EEControlBits::NOCOLORS) bNoColor = true; rSet.Put( SfxBoolItem( SID_COLORVIEW, bNoColor ) ); @@ -1231,12 +1231,12 @@ void OutlineViewShell::ReadFrameViewData(FrameView* pView) rOutl.SetFlatMode( pView->IsNoAttribs() ); - sal_uLong nCntrl = rOutl.GetControlWord(); + EEControlBits nCntrl = rOutl.GetControlWord(); if ( pView->IsNoColors() ) - rOutl.SetControlWord(nCntrl | EE_CNTRL_NOCOLORS); + rOutl.SetControlWord(nCntrl | EEControlBits::NOCOLORS); else - rOutl.SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS); + rOutl.SetControlWord(nCntrl & ~EEControlBits::NOCOLORS); sal_uInt16 nPage = mpFrameView->GetSelectedPage(); pLastPage = GetDoc()->GetSdPage( nPage, PK_STANDARD ); @@ -1250,9 +1250,9 @@ void OutlineViewShell::WriteFrameViewData() { ::Outliner& rOutl = pOlView->GetOutliner(); - sal_uLong nCntrl = rOutl.GetControlWord(); + EEControlBits nCntrl = rOutl.GetControlWord(); bool bNoColor = false; - if (nCntrl & EE_CNTRL_NOCOLORS) + if (nCntrl & EEControlBits::NOCOLORS) bNoColor = true; mpFrameView->SetNoColors(bNoColor); mpFrameView->SetNoAttribs( rOutl.IsFlatMode() ); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index c1bd6fc6dc5a..feeea971ae06 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -193,9 +193,9 @@ OutlineView::~OutlineView() { // uninitialize Outliner: enable color display ResetLinks(); - sal_uLong nCntrl = mrOutliner.GetControlWord(); + EEControlBits nCntrl = mrOutliner.GetControlWord(); mrOutliner.SetUpdateMode(false); // otherwise there will be drawn on SetControlWord - mrOutliner.SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS); + mrOutliner.SetControlWord(nCntrl & ~EEControlBits::NOCOLORS); SvtAccessibilityOptions aOptions; mrOutliner.ForceAutoColor( aOptions.GetIsAutomaticFontColor() ); mrOutliner.Clear(); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 3eff2560d9c8..96d63bc6cb2a 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -629,14 +629,14 @@ bool View::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr) /** * Start text input */ -static void SetSpellOptions( const SdDrawDocument& rDoc, sal_uLong& rCntrl ) +static void SetSpellOptions( const SdDrawDocument& rDoc, EEControlBits& rCntrl ) { bool bOnlineSpell = rDoc.GetOnlineSpell(); if( bOnlineSpell ) - rCntrl |= EE_CNTRL_ONLINESPELLING; + rCntrl |= EEControlBits::ONLINESPELLING; else - rCntrl &= ~EE_CNTRL_ONLINESPELLING; + rCntrl &= ~EEControlBits::ONLINESPELLING; } void OutlinerMasterViewFilter::Start(SdrOutliner *pOutl) @@ -677,14 +677,14 @@ bool View::SdrBeginTextEdit( { pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>( mrDoc.GetStyleSheetPool() )); pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); - sal_uLong nCntrl = pOutl->GetControlWord(); - nCntrl |= EE_CNTRL_ALLOWBIGOBJS; - nCntrl |= EE_CNTRL_MARKFIELDS; - nCntrl |= EE_CNTRL_AUTOCORRECT; + EEControlBits nCntrl = pOutl->GetControlWord(); + nCntrl |= EEControlBits::ALLOWBIGOBJS; + nCntrl |= EEControlBits::MARKFIELDS; + nCntrl |= EEControlBits::AUTOCORRECT; - nCntrl &= ~EE_CNTRL_ULSPACESUMMATION; + nCntrl &= ~EEControlBits::ULSPACESUMMATION; if ( mrDoc.IsSummationOfParagraphs() ) - nCntrl |= EE_CNTRL_ULSPACESUMMATION; + nCntrl |= EEControlBits::ULSPACESUMMATION; SetSpellOptions( mrDoc, nCntrl ); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index e61da8fa5356..f6a0bdee9a4b 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -376,9 +376,9 @@ EditEngine& SmDocShell::GetEditEngine() Application::GetDefaultDevice()->GetTextWidth(OUString("XXXX"))) ); pEditEngine->SetControlWord( - (pEditEngine->GetControlWord() | EE_CNTRL_AUTOINDENTING) & - (~EE_CNTRL_UNDOATTRIBS) & - (~EE_CNTRL_PASTESPECIAL) ); + (pEditEngine->GetControlWord() | EEControlBits::AUTOINDENTING) & + EEControlBits(~EEControlBits::UNDOATTRIBS) & + EEControlBits(~EEControlBits::PASTESPECIAL) ); pEditEngine->SetWordDelimiters(" .=+-*/(){}[];\""); pEditEngine->SetRefMapMode( MAP_PIXEL ); diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 5b657c359368..4ac6708d24c7 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -558,7 +558,7 @@ namespace drawinglayer // #i107346# const SdrOutliner& rDrawTextOutliner = rText.GetModel()->GetDrawOutliner(&rTextObj); - const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EE_CNTRL_ONLINESPELLING); + const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EEControlBits::ONLINESPELLING); return attribute::SdrTextAttribute( rText, diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 5cf1ca1d34d8..f04c617b8a8b 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -206,12 +206,12 @@ void SdrObjEditView::ModelHasChanged() pTextEditOutliner->SetPaperSize(Size(0,0)); // re-format Outliner if (!bContourFrame) { pTextEditOutliner->ClearPolygon(); - sal_uIntPtr nStat=pTextEditOutliner->GetControlWord(); - nStat|=EE_CNTRL_AUTOPAGESIZE; + EEControlBits nStat=pTextEditOutliner->GetControlWord(); + nStat|=EEControlBits::AUTOPAGESIZE; pTextEditOutliner->SetControlWord(nStat); } else { - sal_uIntPtr nStat=pTextEditOutliner->GetControlWord(); - nStat&=~EE_CNTRL_AUTOPAGESIZE; + EEControlBits nStat=pTextEditOutliner->GetControlWord(); + nStat&=~EEControlBits::AUTOPAGESIZE; pTextEditOutliner->SetControlWord(nStat); Rectangle aAnchorRect; pTextObj->TakeTextAnchorRect(aAnchorRect); @@ -323,7 +323,7 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectang { const SdrTextObj* pText = PTR_CAST(SdrTextObj,GetTextEditObject()); bool bTextFrame(pText && pText->IsTextFrame()); - bool bFitToSize(0 != (pTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING)); + bool bFitToSize(pTextEditOutliner->GetControlWord() & EEControlBits::STRETCHING); bool bModifyMerk(pTextEditOutliner->IsModified()); // #43095# Rectangle aBlankRect(rOutlView.GetOutputArea()); aBlankRect.Union(aMinTextEditArea); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index d769b5d4a5fd..a3826c74b85a 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2703,10 +2703,10 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe TakeTextAnchorRect(aAnkRect); SdrTextVertAdjust eVAdj=GetTextVerticalAdjust(); SdrTextHorzAdjust eHAdj=GetTextHorizontalAdjust(); - sal_uIntPtr nStat0=rOutliner.GetControlWord(); + EEControlBits nStat0=rOutliner.GetControlWord(); Size aNullSize; - rOutliner.SetControlWord(nStat0|EE_CNTRL_AUTOPAGESIZE); + rOutliner.SetControlWord(nStat0|EEControlBits::AUTOPAGESIZE); rOutliner.SetMinAutoPaperSize(aNullSize); sal_Int32 nMaxAutoPaperWidth = 1000000; sal_Int32 nMaxAutoPaperHeight= 1000000; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 0ce0b3957824..56d3ee61ee9d 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -714,11 +714,11 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, boo bool bContourFrame=IsContourTextFrame(); bool bFrame=IsTextFrame(); - sal_uIntPtr nStat0=rOutliner.GetControlWord(); + EEControlBits nStat0=rOutliner.GetControlWord(); Size aNullSize; if (!bContourFrame) { - rOutliner.SetControlWord(nStat0|EE_CNTRL_AUTOPAGESIZE); + rOutliner.SetControlWord(nStat0|EEControlBits::AUTOPAGESIZE); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); } @@ -1226,8 +1226,8 @@ void SdrTextObj::ImpInitDrawOutliner( SdrOutliner& rOutl ) const rOutl.Init( nOutlinerMode ); rOutl.SetGlobalCharStretching(100,100); - sal_uIntPtr nStat=rOutl.GetControlWord(); - nStat&=~(EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE); + EEControlBits nStat=rOutl.GetControlWord(); + nStat &= ~EEControlBits(EEControlBits::STRETCHING|EEControlBits::AUTOPAGESIZE); rOutl.SetControlWord(nStat); Size aNullSize; Size aMaxSize(100000,100000); @@ -1260,8 +1260,8 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( bool bContourFrame, // FitToSize can't be used together with ContourFrame for now if (IsFitToSize() || IsAutoFit()) { - sal_uIntPtr nStat=rOutliner.GetControlWord(); - nStat|=EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE; + EEControlBits nStat=rOutliner.GetControlWord(); + nStat|=EEControlBits::STRETCHING|EEControlBits::AUTOPAGESIZE; rOutliner.SetControlWord(nStat); } } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 2f1003a2d6b3..60302d260f40 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -746,13 +746,13 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive( SdrOutliner& rOutliner = ImpGetDrawOutliner(); SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet); SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet); - const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); + const EEControlBits nOriginalControlWord(rOutliner.GetControlWord()); const Size aNullSize; // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); - rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_AUTOPAGESIZE|EE_CNTRL_STRETCHING); + rOutliner.SetControlWord(nOriginalControlWord|EEControlBits::AUTOPAGESIZE|EEControlBits::STRETCHING); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); @@ -880,13 +880,13 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( SdrOutliner& rOutliner = ImpGetDrawOutliner(); SdrTextHorzAdjust eHAdj = rSdrBlockTextPrimitive.getSdrTextHorzAdjust(); SdrTextVertAdjust eVAdj = rSdrBlockTextPrimitive.getSdrTextVertAdjust(); - const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); + const EEControlBits nOriginalControlWord(rOutliner.GetControlWord()); const Size aNullSize; // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); rOutliner.SetFixedCellHeight(rSdrBlockTextPrimitive.isFixedCellHeight()); - rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_AUTOPAGESIZE); + rOutliner.SetControlWord(nOriginalControlWord|EEControlBits::AUTOPAGESIZE); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); @@ -1119,10 +1119,10 @@ void SdrTextObj::impDecomposeStretchTextPrimitive( // prepare outliner SdrOutliner& rOutliner = ImpGetDrawOutliner(); - const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); + const EEControlBits nOriginalControlWord(rOutliner.GetControlWord()); const Size aNullSize; - rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE); + rOutliner.SetControlWord(nOriginalControlWord|EEControlBits::STRETCHING|EEControlBits::AUTOPAGESIZE); rOutliner.SetFixedCellHeight(rSdrStretchTextPrimitive.isFixedCellHeight()); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 7ac1db737a29..b0b2ccce3e64 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -53,12 +53,12 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) ImpSetTextEditParams(); if (!bContourFrame) { - sal_uIntPtr nStat=rOutl.GetControlWord(); - nStat|=EE_CNTRL_AUTOPAGESIZE; + EEControlBits nStat=rOutl.GetControlWord(); + nStat|=EEControlBits::AUTOPAGESIZE; if (bFitToSize || IsAutoFit()) - nStat|=EE_CNTRL_STRETCHING; + nStat|=EEControlBits::STRETCHING; else - nStat&=~EE_CNTRL_STRETCHING; + nStat&=~EEControlBits::STRETCHING; rOutl.SetControlWord(nStat); } @@ -270,8 +270,8 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) pEdtOutl = NULL; rOutl.Clear(); - sal_uInt32 nStat = rOutl.GetControlWord(); - nStat &= ~EE_CNTRL_AUTOPAGESIZE; + EEControlBits nStat = rOutl.GetControlWord(); + nStat &= ~EEControlBits::AUTOPAGESIZE; rOutl.SetControlWord(nStat); mbInEditMode = false; diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx index 970f09b06510..e657a273b9a9 100644 --- a/svx/source/svdraw/svdoutl.cxx +++ b/svx/source/svdraw/svdoutl.cxx @@ -51,8 +51,8 @@ void SdrOutliner::SetTextObj( const SdrTextObj* pObj ) SetGlobalCharStretching(100,100); - sal_uIntPtr nStat = GetControlWord(); - nStat &= ~( EE_CNTRL_STRETCHING | EE_CNTRL_AUTOPAGESIZE ); + EEControlBits nStat = GetControlWord(); + nStat &= ~EEControlBits( EEControlBits::STRETCHING | EEControlBits::AUTOPAGESIZE ); SetControlWord(nStat); Size aNullSize; diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index d9739ade8672..15016d4595e2 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1438,9 +1438,9 @@ void SdrTableObj::TakeTextRect( const CellPos& rPos, SdrOutliner& rOutliner, Rec SdrTextVertAdjust eVAdj=xCell->GetTextVerticalAdjust(); - sal_uIntPtr nStat0=rOutliner.GetControlWord(); + EEControlBits nStat0=rOutliner.GetControlWord(); Size aNullSize; - nStat0 |= EE_CNTRL_AUTOPAGESIZE; + nStat0 |= EEControlBits::AUTOPAGESIZE; rOutliner.SetControlWord(nStat0); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(aAnkRect.GetSize()); @@ -1841,9 +1841,9 @@ bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl) if (bUpdMerk) rOutl.SetUpdateMode(true); - sal_uIntPtr nStat=rOutl.GetControlWord(); - nStat |= EE_CNTRL_AUTOPAGESIZE; - nStat &=~EE_CNTRL_STRETCHING; + EEControlBits nStat=rOutl.GetControlWord(); + nStat |= EEControlBits::AUTOPAGESIZE; + nStat &=~EEControlBits::STRETCHING; rOutl.SetControlWord(nStat); OutlinerParaObject* pPara = GetOutlinerParaObject(); @@ -1896,8 +1896,8 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl) pEdtOutl = 0; rOutl.Clear(); - sal_uInt32 nStat = rOutl.GetControlWord(); - nStat &= ~EE_CNTRL_AUTOPAGESIZE; + EEControlBits nStat = rOutl.GetControlWord(); + nStat &= ~EEControlBits::AUTOPAGESIZE; rOutl.SetControlWord(nStat); mbInEditMode = false; diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 63a64e511779..7f2a32ba18be 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -633,8 +633,8 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor() ); // #i102251# - const sal_uInt32 nOldCntrl(rOutl.GetControlWord()); - sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING; + const EEControlBits nOldCntrl(rOutl.GetControlWord()); + EEControlBits nCntrl = nOldCntrl & ~EEControlBits::ONLINESPELLING; rOutl.SetControlWord(nCntrl); SdrObject* pTempBackgroundShape = 0; diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 60405050f1b6..9b254f5bf4ea 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -418,17 +418,17 @@ void SwSidebarWin::InitControls() mpVScrollbar->AddEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); - sal_uLong nCntrl = mpOutliner->GetControlWord(); + EEControlBits nCntrl = mpOutliner->GetControlWord(); // TODO: crash when AUTOCOMPLETE enabled - nCntrl |= EE_CNTRL_MARKFIELDS | EE_CNTRL_PASTESPECIAL | EE_CNTRL_AUTOCORRECT | EV_CNTRL_AUTOSCROLL; // | EE_CNTRL_AUTOCOMPLETE; + nCntrl |= EEControlBits::MARKFIELDS | EEControlBits::PASTESPECIAL | EEControlBits::AUTOCORRECT | EEControlBits::USECHARATTRIBS; // | EEControlBits::AUTOCOMPLETE; if (SwViewOption::IsFieldShadings()) - nCntrl |= EE_CNTRL_MARKFIELDS; + nCntrl |= EEControlBits::MARKFIELDS; else - nCntrl &= ~EE_CNTRL_MARKFIELDS; + nCntrl &= ~EEControlBits::MARKFIELDS; if (pVOpt->IsOnlineSpell()) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; mpOutliner->SetControlWord(nCntrl); sal_uInt16 aIndex = SW_MOD()->InsertRedlineAuthor(GetAuthor()); @@ -930,16 +930,16 @@ void SwSidebarWin::SetLanguage(const SvxLanguageItem& rNewItem) Engine()->SetModifyHdl( pLink ); const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); - sal_uLong nCntrl = Engine()->GetControlWord(); + EEControlBits nCntrl = Engine()->GetControlWord(); // turn off - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; Engine()->SetControlWord(nCntrl); //turn back on if (pVOpt->IsOnlineSpell()) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; Engine()->SetControlWord(nCntrl); Engine()->CompleteOnlineSpelling(); @@ -1235,11 +1235,11 @@ sal_Int32 SwSidebarWin::GetMinimumSizeWithoutMeta() void SwSidebarWin::SetSpellChecking() { const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); - sal_uLong nCntrl = mpOutliner->GetControlWord(); + EEControlBits nCntrl = mpOutliner->GetControlWord(); if (pVOpt->IsOnlineSpell()) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; mpOutliner->SetControlWord(nCntrl); mpOutliner->CompleteOnlineSpelling(); diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 291328d2fae9..f0105c37ff12 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -443,14 +443,14 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) //!! JP 16.03.2001: why?? pSdrView = rSh.GetDrawView(); //!! JP 16.03.2001: why?? pOutliner = pSdrView->GetTextEditOutliner(); SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner(); - sal_uInt32 nCtrl = pOutliner->GetControlWord(); + EEControlBits nCtrl = pOutliner->GetControlWord(); bool bSet = static_cast<const SfxBoolItem&>(rReq.GetArgs()->Get( nSlot)).GetValue(); if(bSet) - nCtrl |= EE_CNTRL_ONLINESPELLING|EE_CNTRL_ALLOWBIGOBJS; + nCtrl |= EEControlBits::ONLINESPELLING|EEControlBits::ALLOWBIGOBJS; else - nCtrl &= ~EE_CNTRL_ONLINESPELLING; + nCtrl &= ~EEControlBits::ONLINESPELLING; pOutliner->SetControlWord(nCtrl); rView.ExecuteSlot(rReq); diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index ccadc8f92a06..a2aa744ccb06 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -103,8 +103,8 @@ void SwDrawTextShell::Init() if( !pOutliner ) return ; OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - sal_uLong nCtrl = pOutliner->GetControlWord(); - nCtrl |= EE_CNTRL_AUTOCORRECT; + EEControlBits nCtrl = pOutliner->GetControlWord(); + nCtrl |= EEControlBits::AUTOCORRECT; SetUndoManager(&pOutliner->GetUndoManager()); @@ -113,10 +113,10 @@ void SwDrawTextShell::Init() const SwViewOption* pVOpt = rSh.GetViewOptions(); if(pVOpt->IsOnlineSpell()) { - nCtrl |= EE_CNTRL_ONLINESPELLING|EE_CNTRL_ALLOWBIGOBJS; + nCtrl |= EEControlBits::ONLINESPELLING|EEControlBits::ALLOWBIGOBJS; } else - nCtrl &= ~(EE_CNTRL_ONLINESPELLING); + nCtrl &= ~(EEControlBits::ONLINESPELLING); pOutliner->SetControlWord(nCtrl); pOLV->ShowCursor(); diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx index 866aeb9240d1..cf7bf29952cc 100644 --- a/sw/source/uibase/shells/langhelper.cxx +++ b/sw/source/uibase/shells/langhelper.cxx @@ -193,16 +193,16 @@ namespace SwLangHelper if (bForSelection) { const SwViewOption* pVOpt = rView.GetWrtShellPtr()->GetViewOptions(); - sal_uLong nCntrl = pEditEngine->GetControlWord(); + EEControlBits nCntrl = pEditEngine->GetControlWord(); // turn off - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; pEditEngine->SetControlWord(nCntrl); //turn back on if (pVOpt->IsOnlineSpell()) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; pEditEngine->SetControlWord(nCntrl); pEditEngine->CompleteOnlineSpelling(); diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 43037c9c6ea6..249787afa234 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -521,20 +521,20 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, pOutliner->SetHyphenator( xHyphenator ); pSh->SetCalcFieldValueHdl(pOutliner); - sal_uInt32 nCntrl = pOutliner->GetControlWord(); - nCntrl |= EE_CNTRL_ALLOWBIGOBJS; + EEControlBits nCntrl = pOutliner->GetControlWord(); + nCntrl |= EEControlBits::ALLOWBIGOBJS; const SwViewOption *pOpt = pSh->GetViewOptions(); if (SwViewOption::IsFieldShadings()) - nCntrl |= EE_CNTRL_MARKFIELDS; + nCntrl |= EEControlBits::MARKFIELDS; else - nCntrl &= ~EE_CNTRL_MARKFIELDS; + nCntrl &= ~EEControlBits::MARKFIELDS; if (pOpt->IsOnlineSpell()) - nCntrl |= EE_CNTRL_ONLINESPELLING; + nCntrl |= EEControlBits::ONLINESPELLING; else - nCntrl &= ~EE_CNTRL_ONLINESPELLING; + nCntrl &= ~EEControlBits::ONLINESPELLING; pOutliner->SetControlWord(nCntrl); const SfxPoolItem& rItem = pSh->GetDoc()->GetDefault(RES_CHRATR_LANGUAGE); |