summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2017-01-09 17:30:14 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-01-30 22:30:24 +0000
commit8d999b118e553a47a34639c7fda138b609b7aac9 (patch)
tree9b8e1044e92cd89b0a65dbc70e8449d1e8b849b9
parent93ada372b019be0a2fcd555dec234c146a850a4d (diff)
tdf#102132 Add contextual edit region uno command.
Change-Id: I2b95457ba2f074a13059c9f5ce87589f925d3eda Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/33455 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu5
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/sdi/_basesh.sdi6
-rw-r--r--sw/sdi/swriter.sdi18
-rw-r--r--sw/source/uibase/dialog/regionsw.cxx1
-rw-r--r--sw/source/uibase/shells/basesh.cxx5
-rw-r--r--sw/uiconfig/swriter/popupmenu/text.xml1
7 files changed, 37 insertions, 0 deletions
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 @@
<value xml:lang="en-US">~Sections...</value>
</prop>
</node>
+ <node oor:name=".uno:EditCurrentRegion" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Edit Section...</value>
+ </prop>
+ </node>
<node oor:name=".uno:JumpToReference" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">To Reference</value>
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 @@
<menu:menuitem menu:id=".uno:PreviousTrackedChange"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:EditStyle"/>
+ <menu:menuitem menu:id=".uno:EditCurrentRegion"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
<menu:menuitem menu:id=".uno:EditHyperlink"/>