summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/cmdid.h2
-rw-r--r--sw/inc/swcommands.h2
-rw-r--r--sw/sdi/_viewsh.sdi12
-rw-r--r--sw/sdi/swriter.sdi50
-rw-r--r--sw/source/core/uibase/inc/redline_tmpl.hrc12
-rw-r--r--sw/source/core/uibase/lingu/olmenu.cxx17
-rw-r--r--sw/source/core/uibase/uiview/view2.cxx39
-rw-r--r--sw/source/core/uibase/uiview/viewstat.cxx28
8 files changed, 33 insertions, 129 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 721b3f4b6009..8f4967585d0d 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -163,8 +163,6 @@
#define FN_COPY_HYPERLINK_LOCATION (FN_EDIT2 + 40) /* copy hyperlink URL to clipboard */
#define FN_REDLINE_NEXT_CHANGE (FN_EDIT2 + 41) /* Go to the next change */
#define FN_REDLINE_PREV_CHANGE (FN_EDIT2 + 42) /* Go to the previous change */
-#define FN_REDLINE_ACCEPT_DIRECT_SELECTION (FN_EDIT2 + 43) /* accept redlines in the selection */
-#define FN_REDLINE_REJECT_DIRECT_SELECTION (FN_EDIT2 + 44) /* reject redlines in the selection */
/*--------------------------------------------------------------------
Region: Edit
diff --git a/sw/inc/swcommands.h b/sw/inc/swcommands.h
index aa580e31e7b0..cc9bc07d0f42 100644
--- a/sw/inc/swcommands.h
+++ b/sw/inc/swcommands.h
@@ -122,8 +122,6 @@
#define CMD_FN_HIDE_ALL_NOTES ".uno:HideAllNotes"
#define CMD_FN_REDLINE_ACCEPT_DIRECT ".uno:AcceptTracedChange"
#define CMD_FN_REDLINE_REJECT_DIRECT ".uno:RejectTracedChange"
-#define CMD_FN_REDLINE_ACCEPT_DIRECT_SELECTION ".uno:AcceptTracedChangesInSelection"
-#define CMD_FN_REDLINE_REJECT_DIRECT_SELECTION ".uno:RejectTracedChangesInSelection"
#define CMD_FN_REDLINE_NEXT_CHANGE ".uno:NextTrackedChange"
#define CMD_FN_REDLINE_PREV_CHANGE ".uno:PreviousTrackedChange"
#define CMD_FN_REMOVE_HYPERLINK ".uno:RemoveHyperlink"
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 7c8f2ad114cf..40ec958f82ee 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -142,18 +142,6 @@ interface BaseTextEditView
StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_MAILBOX_EDITOR";
]
- FN_REDLINE_ACCEPT_DIRECT_SELECTION
- [
- ExecMethod = Execute ;
- StateMethod = GetState ;
- DisableFlags="SW_DISABLE_ON_MAILBOX_EDITOR";
- ]
- FN_REDLINE_REJECT_DIRECT_SELECTION
- [
- ExecMethod = Execute ;
- StateMethod = GetState ;
- DisableFlags="SW_DISABLE_ON_MAILBOX_EDITOR";
- ]
FN_REDLINE_NEXT_CHANGE
[
ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 1ddeba3ab9bf..9bde88a4149a 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -9823,56 +9823,6 @@ SfxVoidItem RejectTracedChange FN_REDLINE_REJECT_DIRECT
GroupId = GID_EDIT;
]
-SfxVoidItem AcceptTracedChangeInSelection FN_REDLINE_ACCEPT_DIRECT_SELECTION
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-SfxVoidItem RejectTracedChangeInSelection FN_REDLINE_REJECT_DIRECT_SELECTION
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
SfxVoidItem NextTrackedChange FN_REDLINE_NEXT_CHANGE
[
/* flags: */
diff --git a/sw/source/core/uibase/inc/redline_tmpl.hrc b/sw/source/core/uibase/inc/redline_tmpl.hrc
index 8212465d994c..42717089947b 100644
--- a/sw/source/core/uibase/inc/redline_tmpl.hrc
+++ b/sw/source/core/uibase/inc/redline_tmpl.hrc
@@ -25,18 +25,6 @@
}; \
MenuItem \
{ \
- Identifier = FN_REDLINE_ACCEPT_DIRECT_SELECTION; \
- HelpId = CMD_FN_REDLINE_ACCEPT_DIRECT_SELECTION ; \
- Text [ en-US ] = "Accept Changes" ; \
- }; \
- MenuItem \
- { \
- Identifier = FN_REDLINE_REJECT_DIRECT_SELECTION ; \
- HelpId = CMD_FN_REDLINE_REJECT_DIRECT_SELECTION ; \
- Text [ en-US ] = "Reject Changes" ; \
- }; \
- MenuItem \
- { \
Identifier = FN_REDLINE_NEXT_CHANGE; \
HelpId = CMD_FN_REDLINE_NEXT_CHANGE ; \
Text [ en-US ] = "Next Change" ; \
diff --git a/sw/source/core/uibase/lingu/olmenu.cxx b/sw/source/core/uibase/lingu/olmenu.cxx
index 7bd32817e916..682df9aebb34 100644
--- a/sw/source/core/uibase/lingu/olmenu.cxx
+++ b/sw/source/core/uibase/lingu/olmenu.cxx
@@ -607,13 +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
+ FN_REDLINE_PREV_CHANGE
};
SwDoc *pDoc = m_pSh->GetDoc();
- SfxItemSet aSet(pDoc->GetAttrPool(), FN_REDLINE_NEXT_CHANGE, FN_REDLINE_REJECT_DIRECT_SELECTION);
+ SfxItemSet aSet(pDoc->GetAttrPool(), FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_PREV_CHANGE);
for (size_t i = 0; i < SAL_N_ELEMENTS(pRedlineIds); ++i)
{
const sal_uInt16 nWhich = pRedlineIds[i];
@@ -628,11 +628,6 @@ 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 )
@@ -813,9 +808,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
}
}
else if (nId == FN_REDLINE_ACCEPT_DIRECT || nId == FN_REDLINE_REJECT_DIRECT
- || nId == FN_REDLINE_NEXT_CHANGE || nId == FN_REDLINE_PREV_CHANGE
- || nId == FN_REDLINE_ACCEPT_DIRECT_SELECTION
- || nId == FN_REDLINE_REJECT_DIRECT_SELECTION)
+ || nId == FN_REDLINE_NEXT_CHANGE || nId == FN_REDLINE_PREV_CHANGE)
{
// Let SwView::Execute() handle the redline actions.
SfxRequest aReq(m_pSh->GetView().GetViewFrame(), nId);
diff --git a/sw/source/core/uibase/uiview/view2.cxx b/sw/source/core/uibase/uiview/view2.cxx
index cf2d68a077aa..e33ea5d56ea4 100644
--- a/sw/source/core/uibase/uiview/view2.cxx
+++ b/sw/source/core/uibase/uiview/view2.cxx
@@ -664,33 +664,32 @@ void SwView::Execute(SfxRequest &rReq)
case FN_REDLINE_ACCEPT_DIRECT:
case FN_REDLINE_REJECT_DIRECT:
{
- // We check for a redline at the start of the selection/cursor, not the point.
- // This ensures we work properly with FN_REDLINE_NEXT_CHANGE, which leaves the
- // point at the *end* of the redline and the mark at the start (so GetRedline
- // would return NULL if called on the point)
SwDoc *pDoc = m_pWrtShell->GetDoc();
SwPaM *pCursor = m_pWrtShell->GetCrsr();
-
- sal_uInt16 nRedline = 0;
- const SwRangeRedline *pRedline = pDoc->GetRedline(*pCursor->Start(), &nRedline);
- assert(pRedline != 0);
- if (pRedline)
+ if( pCursor->HasMark())
{
if (FN_REDLINE_ACCEPT_DIRECT == nSlot)
- m_pWrtShell->AcceptRedline(nRedline);
+ m_pWrtShell->AcceptRedlinesInSelection();
else
- m_pWrtShell->RejectRedline(nRedline);
+ m_pWrtShell->RejectRedlinesInSelection();
}
- }
- break;
-
- case FN_REDLINE_ACCEPT_DIRECT_SELECTION:
- case FN_REDLINE_REJECT_DIRECT_SELECTION:
- {
- if (FN_REDLINE_ACCEPT_DIRECT_SELECTION == nSlot)
- m_pWrtShell->AcceptRedlinesInSelection();
else
- m_pWrtShell->RejectRedlinesInSelection();
+ {
+ // We check for a redline at the start of the selection/cursor, not the point.
+ // This ensures we work properly with FN_REDLINE_NEXT_CHANGE, which leaves the
+ // point at the *end* of the redline and the mark at the start (so GetRedline
+ // would return NULL if called on the point)
+ sal_uInt16 nRedline = 0;
+ const SwRangeRedline *pRedline = pDoc->GetRedline(*pCursor->Start(), &nRedline);
+ assert(pRedline != 0);
+ if (pRedline)
+ {
+ if (FN_REDLINE_ACCEPT_DIRECT == nSlot)
+ m_pWrtShell->AcceptRedline(nRedline);
+ else
+ m_pWrtShell->RejectRedline(nRedline);
+ }
+ }
}
break;
diff --git a/sw/source/core/uibase/uiview/viewstat.cxx b/sw/source/core/uibase/uiview/viewstat.cxx
index 195889b84b77..775e3402e62d 100644
--- a/sw/source/core/uibase/uiview/viewstat.cxx
+++ b/sw/source/core/uibase/uiview/viewstat.cxx
@@ -289,29 +289,12 @@ void SwView::GetState(SfxItemSet &rSet)
case FN_REDLINE_ACCEPT_DIRECT:
case FN_REDLINE_REJECT_DIRECT:
{
- // If the selection/cursor start position isn't on a redline, disable
- // accepting/rejecting changes.
- SwDoc *pDoc = m_pWrtShell->GetDoc();
- SwPaM *pCursor = m_pWrtShell->GetCrsr();
- if (0 == pDoc->GetRedline(*pCursor->Start(), 0))
- rSet.DisableItem(nWhich);
- if (GetDocShell()->HasChangeRecordProtection())
- rSet.DisableItem(nWhich);
- }
- break;
- case FN_REDLINE_ACCEPT_DIRECT_SELECTION:
- case FN_REDLINE_REJECT_DIRECT_SELECTION:
- {
- // If the selection does not contain a redline, disable
- // accepting/rejecting changes.
SwDoc *pDoc = m_pWrtShell->GetDoc();
SwPaM *pCursor = m_pWrtShell->GetCrsr();
if (GetDocShell()->HasChangeRecordProtection())
rSet.DisableItem(nWhich);
- else if (!pCursor->HasMark())
- rSet.DisableItem(nWhich);
- else
- {
+ else if (pCursor->HasMark())
+ { // If the selection does not contain redlines, disable accepting/rejecting changes.
sal_uInt16 index = 0;
const SwRedlineTbl& table = pDoc->GetRedlineTbl();
const SwRangeRedline* redline = table.FindAtPosition( *pCursor->Start(), index );
@@ -334,6 +317,13 @@ void SwView::GetState(SfxItemSet &rSet)
if( redline == NULL )
rSet.DisableItem(nWhich);
}
+ else
+ {
+ // If the cursor position isn't on a redline, disable
+ // accepting/rejecting changes.
+ if (0 == pDoc->GetRedline(*pCursor->Start(), 0))
+ rSet.DisableItem(nWhich);
+ }
}
break;