Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Ah yes.. sorry about that..

On 14-04-12 13:52, Markus Mohrhard wrote:
Hey

2012/4/14 Rob Snelders<programming@ertai.nl>:
Hereby the patch to fix bug fdo#40778.

--
did you forget to attach the patch?

Regards,
Markus
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

From 6a7d65d968e83bdfdcf2e681dc8d35813eac019e Mon Sep 17 00:00:00 2001
From: Rob Snelders <ertai@idefix.(none)>
Date: Sat, 14 Apr 2012 13:17:04 +0200
Subject: [PATCH] fdo#40778 Remove dictionary choice when adding new entry to
 the spellchecker

---
 cui/source/dialogs/SpellDialog.cxx |   21 +++++++++++++++++----
 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 23b3aa4..1681d67 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 ) );
@@ -1009,7 +1012,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 );
 
@@ -1017,8 +1032,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 2d9383b..f302e1f 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();
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.