Bugzilla – Attachment 59679 Details for
Bug 40778
Remove dictionary choice when adding new entry to the spellchecker
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to have the add-to-dictionary-button add the word to the dictionary without the pupop when only 1 active dictionary.
0001-Select-at-Dictionary-add-button.patch (text/plain), 2.92 KB, created by
Rob Snelders
on 2012-04-09 07:16:36 UTC
(
hide
)
Description:
Patch to have the add-to-dictionary-button add the word to the dictionary without the pupop when only 1 active dictionary.
Filename:
MIME Type:
Creator:
Rob Snelders
Created:
2012-04-09 07:16:36 UTC
Size:
2.92 KB
patch
obsolete
>From 9113ea69f3f448e1cf9833bb4c7a39ddd37c4189 Mon Sep 17 00:00:00 2001 >From: Rob Snelders <programming@ertai.nl> >Date: Mon, 9 Apr 2012 15:59:33 +0200 >Subject: [PATCH] Select at Dictionary add button > >--- > cui/source/dialogs/SpellDialog.cxx | 2 ++ > vcl/inc/vcl/menubtn.hxx | 4 ++++ > vcl/source/control/menubtn.cxx | 9 ++++++++- > 3 files changed, 14 insertions(+), 1 deletions(-) > >diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx >index 570e7eb..4bcc96b 100644 >--- a/cui/source/dialogs/SpellDialog.cxx >+++ b/cui/source/dialogs/SpellDialog.cxx >@@ -1005,12 +1005,14 @@ void SpellDialog::InitUserDicts() > } > } > aAddToDictMB.SetPopupMenu(pMenu); >+ aAddToDictMB.SetDirectSelect(true); > aAddToDictMB.Enable( bEnable ); > } > > //----------------------------------------------------------------------- > IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton ) > { >+ > aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP ); > > //GetErrorText() returns the current error even if the text is already >diff --git a/vcl/inc/vcl/menubtn.hxx b/vcl/inc/vcl/menubtn.hxx >index 4488753..a616151 100644 >--- a/vcl/inc/vcl/menubtn.hxx >+++ b/vcl/inc/vcl/menubtn.hxx >@@ -57,6 +57,7 @@ private: > sal_uInt16 mnMenuMode; > Link maActivateHdl; > Link maSelectHdl; >+ bool mbDirectSelect; > > SAL_DLLPRIVATE void ImplInitMenuButtonData(); > SAL_DLLPRIVATE void ImplExecuteMenu(); >@@ -91,6 +92,9 @@ public: > sal_uInt16 GetCurItemId() const { return mnCurItemId; } > void SetCurItemId( sal_uInt16 nItemId ) { mnCurItemId = nItemId; } > >+ bool GetDirectSelect() const { return mbDirectSelect; } >+ void SetDirectSelect( bool bDirectSelect ) { mbDirectSelect = bDirectSelect; } >+ > void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; } > const Link& GetActivateHdl() const { return maActivateHdl; } > void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } >diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx >index 2bb1412..c29f7af 100644 >--- a/vcl/source/control/menubtn.cxx >+++ b/vcl/source/control/menubtn.cxx >@@ -53,6 +53,7 @@ void MenuButton::ImplInitMenuButtonData() > mpOwnMenu = NULL; > mnCurItemId = 0; > mnMenuMode = 0; >+ mbDirectSelect = false; > } > > // ----------------------------------------------------------------------- >@@ -183,7 +184,13 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt ) > { > if ( !(GetStyle() & WB_NOPOINTERFOCUS) ) > GrabFocus(); >- ImplExecuteMenu(); >+ if (mbDirectSelect & (mpMenu->GetItemCount() == 1)) >+ { >+ mnCurItemId = 1; >+ Select(); >+ } >+ else >+ ImplExecuteMenu(); > } > } > } >-- >1.7.5.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 40778
:
59679
|
59964
|
60917