[Libreoffice-commits] core.git: officecfg/registry sw/inc sw/sdi sw/source sw/uiconfig

Gulsah Kose gulsah.1004 at gmail.com
Mon Jan 30 22:30:54 UTC 2017


 officecfg/registry/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(+)

New commits:
commit 8d999b118e553a47a34639c7fda138b609b7aac9
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date:   Mon Jan 9 17:30:14 2017 +0300

    tdf#102132 Add contextual edit region uno command.
    
    Change-Id: I2b95457ba2f074a13059c9f5ce87589f925d3eda
    Signed-off-by: Gulsah Kose <gulsah.1004 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/33455
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 703b048..b86a268 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 cf15543..6a5631d 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 1d3d1ae..12eec45 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 135af78..fb1884b 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 7bd9780..9c0a3de 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 66cc701..13d1587 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 a6a6021..763066b 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"/>


More information about the Libreoffice-commits mailing list