summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-04-29 08:20:09 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-04-29 08:20:58 +0200
commit94fc0b4752599601ddf9ff3c9b49da15cffb4882 (patch)
treed0377c89da19a5dde9fa0997f11b8540dc9173c9
parentaea15180a8928935d0a27c8cb2ded57b36045f78 (diff)
prevent duplicated redline accept/reject spellcheck popup items
Change-Id: Ib7bd7e471b017f7e09a447f987ab7ce8bf506b53
-rw-r--r--sw/source/core/uibase/lingu/olmenu.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/core/uibase/lingu/olmenu.cxx b/sw/source/core/uibase/lingu/olmenu.cxx
index 8694eabe21f7..7bd32817e916 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 )