From 8d999b118e553a47a34639c7fda138b609b7aac9 Mon Sep 17 00:00:00 2001 From: Gulsah Kose Date: Mon, 9 Jan 2017 17:30:14 +0300 Subject: tdf#102132 Add contextual edit region uno command. Change-Id: I2b95457ba2f074a13059c9f5ce87589f925d3eda Signed-off-by: Gulsah Kose Reviewed-on: https://gerrit.libreoffice.org/33455 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky --- .../data/org/openoffice/Office/UI/WriterCommands.xcu | 5 +++++ sw/inc/cmdid.h | 1 + sw/sdi/_basesh.sdi | 6 ++++++ sw/sdi/swriter.sdi | 18 ++++++++++++++++++ sw/source/uibase/dialog/regionsw.cxx | 1 + sw/source/uibase/shells/basesh.cxx | 5 +++++ sw/uiconfig/swriter/popupmenu/text.xml | 1 + 7 files changed, 37 insertions(+) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 703b048211eb..b86a26809f17 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -1949,6 +1949,11 @@ ~Sections... + + + Edit Section... + + To Reference diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index cf15543a13c2..6a5631d9f287 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -110,6 +110,7 @@ #define FN_EDIT_REGION (FN_EDIT + 65) /* Edit region */ #define FN_GOTO_REFERENCE (FN_EDIT + 66) /* From Refmark to the reference */ +#define FN_EDIT_CURRENT_REGION (FN_EDIT + 67) /* Edit current region*/ // already defined in SVX #define FN_NEXT_BOOKMARK (FN_EDIT + 68) /* */ diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi index 1d3d1ae0f15f..12eec45a4c41 100644 --- a/sw/sdi/_basesh.sdi +++ b/sw/sdi/_basesh.sdi @@ -220,6 +220,12 @@ interface BaseTextSelection StateMethod = GetState ; ] + FN_EDIT_CURRENT_REGION // status(final|play) + [ + ExecMethod = EditRegionDialog ; + StateMethod = GetState ; + ] + FN_INSERT_REGION // status() [ ExecMethod = InsertRegionDialog; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 135af78fe402..fb1884b97c88 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -1076,6 +1076,24 @@ SfxVoidItem EditRegion FN_EDIT_REGION GroupId = GID_EDIT; ] +SfxVoidItem EditCurrentRegion FN_EDIT_CURRENT_REGION +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = GID_EDIT; +] + SfxVoidItem EndOfDocumentSel FN_END_OF_DOCUMENT_SEL () [ diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 7bd9780ef9c3..9c0a3de1e61b 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -214,6 +214,7 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq) switch ( nSlot ) { case FN_EDIT_REGION: + case FN_EDIT_CURRENT_REGION: { vcl::Window* pParentWin = &GetView().GetViewFrame()->GetWindow(); { diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 66cc701c4951..13d1587e2fa1 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -1395,6 +1395,11 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) rSet.DisableItem(nWhich); break; + case FN_EDIT_CURRENT_REGION: + if( !rSh.GetCurrSection() ) + rSet.DisableItem(nWhich); + break; + case FN_INSERT_REGION: if( rSh.CursorInsideInputField() || rSh.IsSelFrameMode() diff --git a/sw/uiconfig/swriter/popupmenu/text.xml b/sw/uiconfig/swriter/popupmenu/text.xml index a6a60215aab5..763066be8bf6 100644 --- a/sw/uiconfig/swriter/popupmenu/text.xml +++ b/sw/uiconfig/swriter/popupmenu/text.xml @@ -43,6 +43,7 @@ + -- cgit