[Libreoffice-commits] core.git: sw/source

Luboš Luňák l.lunak at collabora.com
Mon Apr 28 23:21:26 PDT 2014


 sw/source/core/uibase/lingu/olmenu.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 94fc0b4752599601ddf9ff3c9b49da15cffb4882
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Tue Apr 29 08:20:09 2014 +0200

    prevent duplicated redline accept/reject spellcheck popup items
    
    Change-Id: Ib7bd7e471b017f7e09a447f987ab7ce8bf506b53

diff --git a/sw/source/core/uibase/lingu/olmenu.cxx b/sw/source/core/uibase/lingu/olmenu.cxx
index 8694eab..7bd3281 100644
--- a/sw/source/core/uibase/lingu/olmenu.cxx
+++ b/sw/source/core/uibase/lingu/olmenu.cxx
@@ -607,15 +607,13 @@ void SwSpellPopup::checkRedline()
     // Build an item set that contains a void item for each menu entry. The
     // WhichId of each item is set, so SwView may clear it.
     static const sal_uInt16 pRedlineIds[] = {
-        FN_REDLINE_ACCEPT_DIRECT,
-        FN_REDLINE_REJECT_DIRECT,
         FN_REDLINE_NEXT_CHANGE,
         FN_REDLINE_PREV_CHANGE,
         FN_REDLINE_ACCEPT_DIRECT_SELECTION,
         FN_REDLINE_REJECT_DIRECT_SELECTION
     };
     SwDoc *pDoc = m_pSh->GetDoc();
-    SfxItemSet aSet(pDoc->GetAttrPool(), FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT_SELECTION);
+    SfxItemSet aSet(pDoc->GetAttrPool(), FN_REDLINE_NEXT_CHANGE, FN_REDLINE_REJECT_DIRECT_SELECTION);
     for (size_t i = 0; i < SAL_N_ELEMENTS(pRedlineIds); ++i)
     {
         const sal_uInt16 nWhich = pRedlineIds[i];
@@ -630,6 +628,11 @@ void SwSpellPopup::checkRedline()
         const sal_uInt16 nWhich = pRedlineIds[i];
         EnableItem(nWhich, aSet.Get(nWhich).Which());
     }
+    // Spellcheck popup selects the whole word, so xxx_SELECTION items would be enabled if needed,
+    // and there would be needless duplicates (and if only a part of the word is redlined,
+    // these might not work anyway).
+    EnableItem(FN_REDLINE_ACCEPT_DIRECT, false);
+    EnableItem(FN_REDLINE_REJECT_DIRECT, false);
 }
 
 sal_uInt16  SwSpellPopup::Execute( const Rectangle& rWordPos, Window* pWin )


More information about the Libreoffice-commits mailing list