officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |   24 +++-
 sw/inc/cmdid.h                                                      |    6 -
 sw/sdi/_tabsh.sdi                                                   |   18 +++
 sw/sdi/swriter.sdi                                                  |   52 
+++++++++-
 sw/source/ui/app/mn.src                                             |   18 ++-
 sw/source/uibase/shells/tabsh.cxx                                   |   17 ++-
 6 files changed, 115 insertions(+), 20 deletions(-)

New commits:
commit 447783a97777b2053acd74d265af3ed2a6c5c93a
Author: Philippe Jung <phil.j...@free.fr>
Date:   Sun May 17 17:42:54 2015 +0200

    tdf#90882 Writer: insert row/col before/after
    
    From the contextual menu, it is now possible to insert rows or cols
    before the current position.
    
    Number of rows/cols inserted is based on current selection.
    
    Change-Id: Ie1a718fbb1b8caf67716f9c8fad21f90d182ca79
    Reviewed-on: https://gerrit.libreoffice.org/15773
    Reviewed-by: Yousuf Philips <philip...@hotmail.com>
    Tested-by: Yousuf Philips <philip...@hotmail.com>

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 40ddf82..87e9234 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1118,9 +1118,17 @@
           <value>1</value>
         </prop>
       </node>
-      <node oor:name=".uno:InsertRows" oor:op="replace">
+      <node oor:name=".uno:InsertRowsBelow" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Insert Row Below</value>
+          <value xml:lang="en-US">Insert Rows Below</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
+      <node oor:name=".uno:InsertRowsAfter" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Insert Rows After</value>
         </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
@@ -1134,9 +1142,17 @@
           <value>1</value>
         </prop>
       </node>
-      <node oor:name=".uno:InsertColumns" oor:op="replace">
+      <node oor:name=".uno:InsertColumnsBefore" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Insert Columns Left</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
+      <node oor:name=".uno:InsertColumnsAfter" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Insert Column Right</value>
+          <value xml:lang="en-US">Insert Columns Right</value>
         </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index dda4a38..e07ca6f 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -334,8 +334,8 @@
 
 #define FN_TABLE_REP                (FN_FORMAT + 99)  /* TableRepresentation */
 #define FN_CONVERT_TEXT_TABLE       (FN_FORMAT + 100)  /* convert text <-> 
table */
-#define FN_TABLE_INSERT_ROW         (FN_FORMAT + 101)  /* */
-#define FN_TABLE_INSERT_COL         (FN_FORMAT + 102)  /* */
+#define FN_TABLE_INSERT_ROW_AFTER   (FN_FORMAT + 101)  /* */
+#define FN_TABLE_INSERT_COL_AFTER   (FN_FORMAT + 102)  /* */
 #define FN_TABLE_DELETE_ROW         (FN_FORMAT + 103)  /* */
 #define FN_TABLE_DELETE_COL         (FN_FORMAT + 104)  /* */
 #define FN_TABLE_SPLIT_CELLS        (FN_FORMAT + 105)  /* */
@@ -343,6 +343,8 @@
 #define FN_TABLE_SET_ROW_HEIGHT     (FN_FORMAT + 107)  /* */
 #define FN_TABLE_SET_COL_WIDTH      (FN_FORMAT + 108)  /* */
 #define FN_OPTIMIZE_TABLE           (FN_FORMAT + 110)  /* ToolBoxItem for 
optimizing tables */
+#define FN_TABLE_INSERT_ROW_BEFORE  (FN_FORMAT + 111)  /* */
+#define FN_TABLE_INSERT_COL_BEFORE  (FN_FORMAT + 112)  /* */
 #define FN_TABLE_SELECT_ROW         (FN_FORMAT + 113)  /* */
 #define FN_TABLE_SELECT_COL         (FN_FORMAT + 114)  /* */
 #define FN_TABLE_SELECT_ALL         (FN_FORMAT + 115)  /* */
diff --git a/sw/sdi/_tabsh.sdi b/sw/sdi/_tabsh.sdi
index c740572..63792fe 100644
--- a/sw/sdi/_tabsh.sdi
+++ b/sw/sdi/_tabsh.sdi
@@ -141,7 +141,14 @@ interface BaseTextTable
         StateMethod = NoState ;
     ]
 
-    FN_TABLE_INSERT_COL // status(final|play)
+    FN_TABLE_INSERT_COL_BEFORE // status(final|play)
+    [
+        ExecMethod = Execute ;
+        StateMethod = NoState ;
+        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+    ]
+
+    FN_TABLE_INSERT_COL_AFTER // status(final|play)
     [
         ExecMethod = Execute ;
         StateMethod = NoState ;
@@ -155,7 +162,14 @@ interface BaseTextTable
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
-    FN_TABLE_INSERT_ROW // status(final|play)
+    FN_TABLE_INSERT_ROW_BEFORE // status(final|play)
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+    ]
+
+    FN_TABLE_INSERT_ROW_AFTER // status(final|play)
     [
         ExecMethod = Execute ;
         StateMethod = GetState ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index deea1c0..c7d9dfd 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -3610,7 +3610,31 @@ SfxVoidItem InsertColumnDialog FN_TABLE_INSERT_COL_DLG
     GroupId = GID_TABLE;
 ]
 
-SfxVoidItem InsertColumns FN_TABLE_INSERT_COL
+SfxVoidItem InsertColumnsBefore FN_TABLE_INSERT_COL_BEFORE
+()
+[
+    /* flags: */
+    AutoUpdate = FALSE,
+    Cachable = Cachable,
+    FastCall = TRUE,
+    HasCoreId = FALSE,
+    HasDialog = TRUE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Asynchron;
+
+    /* config: */
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_TABLE;
+]
+
+SfxVoidItem InsertColumnsAfter FN_TABLE_INSERT_COL_AFTER
 ()
 [
     /* flags: */
@@ -4356,7 +4380,31 @@ SfxVoidItem InsertRowDialog FN_TABLE_INSERT_ROW_DLG
     GroupId = GID_TABLE;
 ]
 
-SfxVoidItem InsertRows FN_TABLE_INSERT_ROW
+SfxVoidItem InsertRowsBefore FN_TABLE_INSERT_ROW_BEFORE
+()
+[
+    /* flags: */
+    AutoUpdate = FALSE,
+    Cachable = Cachable,
+    FastCall = TRUE,
+    HasCoreId = FALSE,
+    HasDialog = TRUE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Asynchron;
+
+    /* config: */
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_TABLE;
+]
+
+SfxVoidItem InsertRowsAfter FN_TABLE_INSERT_ROW_AFTER
 ()
 [
     /* flags: */
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index e41eebd..18ed720 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -259,8 +259,13 @@
            {\
                     MenuItem\
                     {\
-                        Identifier = FN_TABLE_INSERT_ROW ; \
-                        Text [ en-US ] = "Row Below" ; \
+                        Identifier = FN_TABLE_INSERT_ROW_BEFORE ; \
+                        Text [ en-US ] = "Rows Above" ; \
+                    };\
+                    MenuItem\
+                    {\
+                        Identifier = FN_TABLE_INSERT_ROW_AFTER ; \
+                        Text [ en-US ] = "Rows Below" ; \
                     };\
                     MenuItem\
                     {\
@@ -271,8 +276,13 @@
                     SEPARATOR ; \
                     MenuItem\
                     {\
-                        Identifier = FN_TABLE_INSERT_COL ; \
-                        Text [ en-US ] = "Column Right" ; \
+                        Identifier = FN_TABLE_INSERT_COL_BEFORE ; \
+                        Text [ en-US ] = "Columns Left" ; \
+                    };\
+                    MenuItem\
+                    {\
+                        Identifier = FN_TABLE_INSERT_COL_AFTER ; \
+                        Text [ en-US ] = "Columns Right" ; \
                     };\
                     MenuItem\
                     {\
diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index 5862618..7f00281 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -820,10 +820,13 @@ void SwTableShell::Execute(SfxRequest &rReq)
             OSL_ENSURE( false, "function may not be called now." );
             break;
 
-        case FN_TABLE_INSERT_COL:
-        case FN_TABLE_INSERT_ROW:
+        case FN_TABLE_INSERT_COL_BEFORE:
+        case FN_TABLE_INSERT_ROW_BEFORE:
+        case FN_TABLE_INSERT_COL_AFTER:
+        case FN_TABLE_INSERT_ROW_AFTER:
         {
-            bool bColumn = rReq.GetSlot() == FN_TABLE_INSERT_COL;
+            bool bColumn = rReq.GetSlot() == FN_TABLE_INSERT_COL_BEFORE
+                           || rReq.GetSlot() == FN_TABLE_INSERT_COL_AFTER;
             sal_uInt16 nCount = 0;
             bool bAfter = true;
             if (pItem)
@@ -855,7 +858,9 @@ void SwTableShell::Execute(SfxRequest &rReq)
                         nCount = maxX - minX + 1;
                     else
                         nCount = maxY - minY + 1;
-                 }
+                }
+                bAfter = rReq.GetSlot() == FN_TABLE_INSERT_COL_AFTER
+                         || rReq.GetSlot() == FN_TABLE_INSERT_ROW_AFTER;
             }
 
             if( nCount )
@@ -914,7 +919,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
                 if( pDlg.get() && (pDlg->Execute() == 1) )
                 {
                     const sal_uInt16 nDispatchSlot = (nSlot == 
FN_TABLE_INSERT_COL_DLG)
-                        ? FN_TABLE_INSERT_COL : FN_TABLE_INSERT_ROW;
+                        ? FN_TABLE_INSERT_COL_AFTER : 
FN_TABLE_INSERT_ROW_AFTER;
                     SfxUInt16Item aCountItem( nDispatchSlot, static_cast< 
sal_uInt16 >(pDlg->getInsertCount()) );
                     SfxBoolItem  aAfter( FN_PARAM_INSERT_AFTER, 
!pDlg->isInsertBefore() );
                     SfxViewFrame* pVFrame = GetView().GetViewFrame();
@@ -1246,7 +1251,7 @@ void SwTableShell::GetState(SfxItemSet &rSet)
                 }
                 break;
             }
-            case FN_TABLE_INSERT_ROW:
+            case FN_TABLE_INSERT_ROW_AFTER:
             case FN_TABLE_INSERT_ROW_DLG:
                 if ( rSh.IsInRepeatedHeadline() )
                     rSet.DisableItem( nSlot );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to