diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-25 12:13:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-25 12:14:12 +0200 |
commit | eb9c04ed215f9b12584c6e254c36303c6b3865ed (patch) | |
tree | e0bed2cc0a5591321c49fd7f54a31e02a2aea75b | |
parent | 7dd09f07a12affb8da0afd731ec2a99575a51e2e (diff) |
convert SPELLCMD_ constants to enum class
Change-Id: I0f57a60a44ddac63a73e0bb35df59b3b25857d43
-rw-r--r-- | editeng/source/editeng/editview.cxx | 8 | ||||
-rw-r--r-- | include/editeng/editstat.hxx | 21 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarTxtControl.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 2 |
6 files changed, 23 insertions, 20 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index fa77d3c3c0be..cc2685d16c8c 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -938,7 +938,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) OUString aWord = pImpEditView->SpellIgnoreOrAddWord( false ); if ( pCallBack ) { - SpellCallbackInfo aInf( SPELLCMD_IGNOREWORD, aWord ); + SpellCallbackInfo aInf( SpellCallbackCommand::IGNOREWORD, aWord ); pCallBack->Call( &aInf ); } SetSelection( aOldSel ); @@ -967,7 +967,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) if ( pCallBack ) { - SpellCallbackInfo aInf( ( nId == MN_WORDLANGUAGE ) ? SPELLCMD_WORDLANGUAGE : SPELLCMD_PARALANGUAGE, nLangToUse ); + SpellCallbackInfo aInf( ( nId == MN_WORDLANGUAGE ) ? SpellCallbackCommand::WORDLANGUAGE : SpellCallbackCommand::PARALANGUAGE, nLangToUse ); pCallBack->Call( &aInf ); } SetSelection( aOldSel ); @@ -986,7 +986,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) } else { - SpellCallbackInfo aInf( SPELLCMD_STARTSPELLDLG, OUString() ); + SpellCallbackInfo aInf( SpellCallbackCommand::STARTSPELLDLG, OUString() ); pCallBack->Call( &aInf ); } } @@ -1014,7 +1014,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) if ( pCallBack ) { - SpellCallbackInfo aInf( SPELLCMD_ADDTODICTIONARY, aSelected ); + SpellCallbackInfo aInf( SpellCallbackCommand::ADDTODICTIONARY, aSelected ); pCallBack->Call( &aInf ); } SetSelection( aOldSel ); diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx index 2c2f5f8570df..b53c744c3092 100644 --- a/include/editeng/editstat.hxx +++ b/include/editeng/editstat.hxx @@ -138,26 +138,29 @@ public: sal_Int32& GetPrevParagraph() { return nPrevPara; } }; -#define SPELLCMD_IGNOREWORD 0x0001 -#define SPELLCMD_STARTSPELLDLG 0x0002 -#define SPELLCMD_ADDTODICTIONARY 0x0003 -#define SPELLCMD_WORDLANGUAGE 0x0004 -#define SPELLCMD_PARALANGUAGE 0x0005 +enum class SpellCallbackCommand +{ + IGNOREWORD = 0x0001, + STARTSPELLDLG = 0x0002, + ADDTODICTIONARY = 0x0003, + WORDLANGUAGE = 0x0004, + PARALANGUAGE = 0x0005, +}; struct SpellCallbackInfo { - sal_uInt16 nCommand; + SpellCallbackCommand nCommand; OUString aWord; LanguageType eLanguage; - SpellCallbackInfo( sal_uInt16 nCMD, const OUString& rWord ) - : aWord( rWord ) + SpellCallbackInfo( SpellCallbackCommand nCMD, const OUString& rWord ) + : aWord( rWord ) { nCommand = nCMD; eLanguage = LANGUAGE_DONTKNOW; } - SpellCallbackInfo( sal_uInt16 nCMD, LanguageType eLang ) + SpellCallbackInfo( SpellCallbackCommand nCMD, LanguageType eLang ) { nCommand = nCMD; eLanguage = eLang; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 12fb75fb138c..acb6bd2c4459 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -554,7 +554,7 @@ IMPL_LINK_NOARG(ScGridWindow, PopupModeEndHdl) IMPL_LINK( ScGridWindow, PopupSpellingHdl, SpellCallbackInfo*, pInfo ) { - if( pInfo->nCommand == SPELLCMD_STARTSPELLDLG ) + if( pInfo->nCommand == SpellCallbackCommand::STARTSPELLDLG ) pViewData->GetDispatcher().Execute( SID_SPELL_DIALOG, SfxCallMode::ASYNCHRON ); return 0; } diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 48ac39eb684d..1c2b66cd069a 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -973,11 +973,11 @@ void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* delete mpOnlineSearchItem; mpOnlineSearchItem = NULL; - sal_uInt16 nCommand = pInfo->nCommand; + SpellCallbackCommand nCommand = pInfo->nCommand; - if (nCommand == SPELLCMD_IGNOREWORD + if (nCommand == SpellCallbackCommand::IGNOREWORD // restart when add to dictionary takes place, too. - || nCommand == SPELLCMD_ADDTODICTIONARY) + || nCommand == SpellCallbackCommand::ADDTODICTIONARY) { if(pObj && pOutl && pObj->ISA(SdrTextObj)) { @@ -991,7 +991,7 @@ void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* mpOnlineSearchItem->SetSearchString(pInfo->aWord); StartOnlineSpelling(); } - else if (nCommand == SPELLCMD_STARTSPELLDLG) + else if (nCommand == SpellCallbackCommand::STARTSPELLDLG) { SfxViewFrame::Current()->GetDispatcher()->Execute( SID_SPELL_DIALOG, SfxCallMode::ASYNCHRON ); diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index 918586e8ee4f..88f5316b9ad9 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -321,7 +321,7 @@ void SidebarTxtControl::MouseButtonUp( const MouseEvent& rMEvt ) IMPL_LINK( SidebarTxtControl, OnlineSpellCallback, SpellCallbackInfo*, pInfo ) { - if ( pInfo->nCommand == SPELLCMD_STARTSPELLDLG ) + if ( pInfo->nCommand == SpellCallbackCommand::STARTSPELLDLG ) { mrDocView.GetViewFrame()->GetDispatcher()->Execute( FN_SPELL_GRAMMAR_DIALOG, SfxCallMode::ASYNCHRON); } diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 249787afa234..ccc39a4aca63 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -721,7 +721,7 @@ bool SwView::HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const //#i87414# mod IMPL_LINK(SwView, OnlineSpellCallback, SpellCallbackInfo*, pInfo) { - if (pInfo->nCommand == SPELLCMD_STARTSPELLDLG) + if (pInfo->nCommand == SpellCallbackCommand::STARTSPELLDLG) GetViewFrame()->GetDispatcher()->Execute( FN_SPELL_GRAMMAR_DIALOG, SfxCallMode::ASYNCHRON); return 0; } |