diff options
author | Rob Snelders <rob@ertai.nl> | 2012-04-14 13:17:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-04-17 12:16:18 +0200 |
commit | 808be9732e409789f9d26c13c15bbd899c408cd0 (patch) | |
tree | a1d70ec9148cc3143428f6e9b746e4fb070c1d71 /cui | |
parent | translated or removed german comments in connectivity, cppuhelper and cui (diff) | |
download | core-808be9732e409789f9d26c13c15bbd899c408cd0.tar.gz core-808be9732e409789f9d26c13c15bbd899c408cd0.zip |
fdo#40778 Remove dictionary choice when adding new entry to the spellchecker
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 21 | ||||
-rw-r--r-- | cui/source/inc/SpellDialog.hxx | 4 |
2 files changed, 20 insertions, 5 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 04f8185cd716..fe1e39d86774 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -324,7 +324,10 @@ void SpellDialog::Init_Impl() aSuggestionLB.SetDoubleClickHdl( LINK( this, SpellDialog, ChangeHdl ) ); aSentenceED.SetModifyHdl(LINK ( this, SpellDialog, ModifyHdl) ); - aAddToDictMB.SetSelectHdl(LINK ( this, SpellDialog, AddToDictionaryHdl ) ); + + aAddToDictMB.SetMenuMode( MENUBUTTON_MENUMODE_TIMED ); + aAddToDictMB.SetSelectHdl(LINK ( this, SpellDialog, AddToDictSelectHdl ) ); + aAddToDictMB.SetClickHdl(LINK ( this, SpellDialog, AddToDictClickHdl ) ); aLanguageLB.SetSelectHdl(LINK( this, SpellDialog, LanguageSelectHdl ) ); aExplainLink.SetClickHdl( LINK( this, SpellDialog, HandleHyperlink ) ); @@ -1003,7 +1006,19 @@ void SpellDialog::InitUserDicts() } //----------------------------------------------------------------------- -IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton ) +IMPL_LINK(SpellDialog, AddToDictClickHdl, MenuButton*, pButton ) +{ + return AddToDictionaryExecute(1, pButton->GetPopupMenu()); +} + +//----------------------------------------------------------------------- +IMPL_LINK(SpellDialog, AddToDictSelectHdl, MenuButton*, pButton ) +{ + return AddToDictionaryExecute(pButton->GetCurItemId(), pButton->GetPopupMenu()); +} + +//----------------------------------------------------------------------- +int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu ) { aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP ); @@ -1011,8 +1026,6 @@ IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton ) //manually changed const String aNewWord= aSentenceED.GetErrorText(); - sal_uInt16 nItemId = pButton->GetCurItemId(); - PopupMenu *pMenu = pButton->GetPopupMenu(); String aDicName ( pMenu->GetItemText( nItemId ) ); uno::Reference< linguistic2::XDictionary > xDic; diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 2d9383bf33c1..f302e1f4acfd 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -212,13 +212,15 @@ private: DECL_LINK(CancelHdl, void *); DECL_LINK( ModifyHdl, SentenceEditWindow_Impl *); DECL_LINK(UndoHdl, void *); - DECL_LINK( AddToDictionaryHdl, MenuButton* ); + DECL_LINK( AddToDictSelectHdl, MenuButton* ); + DECL_LINK( AddToDictClickHdl, MenuButton* ); DECL_LINK( LanguageSelectHdl, SvxLanguageBox* ); DECL_LINK( DialogUndoHdl, SpellUndoAction_Impl* ); DECL_LINK( HandleHyperlink, svt::FixedHyperlink * ); DECL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog * ); + int AddToDictionaryExecute( sal_uInt16 ItemId, PopupMenu *pMenu ); void StartSpellOptDlg_Impl(); void InitUserDicts(); void UpdateBoxes_Impl(); |