Kaydet (Commit) eb9c04ed authored tarafından Noel Grandin's avatar Noel Grandin

convert SPELLCMD_ constants to enum class

Change-Id: I0f57a60a44ddac63a73e0bb35df59b3b25857d43
üst 7dd09f07
......@@ -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 );
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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);
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment