summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-06-05 11:46:34 +0200
committerJan Holesovsky <kendy@collabora.com>2015-06-08 08:32:42 +0000
commit396f1f145ab502a2dba269c986f1f8d172f824e7 (patch)
tree09cbccbada1a7bacc94ad722d45ab9c1e066dd2c
parent4b84c8a46875c14640c51dbb66b22e010850402c (diff)
WRITER: readd InsertRows/InsertCols
Following ESC decision, uno commands InsertRows / InsertColumns must be added to the current one InsertRowsBefore / InsertColumnsBefore and InsertRowsAfter / InsertColumnsAfter. This will guarantee ascending compatibility while making more explicit the behaviour thanks to the new commands. Change-Id: I31964e3bdfa63b9447edb794fe233e2665651142 Reviewed-on: https://gerrit.libreoffice.org/16098 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu18
-rw-r--r--sw/inc/cmdid.h6
-rw-r--r--sw/sdi/_tabsh.sdi16
-rw-r--r--sw/sdi/swriter.sdi50
-rw-r--r--sw/source/uibase/shells/tabsh.cxx14
5 files changed, 100 insertions, 4 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 736e95648150..728f2d3f92dd 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1132,6 +1132,15 @@
<value>1</value>
</prop>
</node>
+ <!-- 2015/06 The next one is to be deprecated one day or another -->
+ <node oor:name=".uno:InsertRows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Row 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 Below</value>
@@ -1162,6 +1171,15 @@
<value>1</value>
</prop>
</node>
+ <!-- 2015/06 The next one is to be deprecated one day or another -->
+ <node oor:name=".uno:InsertColumns" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Column Right</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 Columns Right</value>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 7c15b3a88fbf..4f7792319d8a 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -334,20 +334,22 @@
#define FN_TABLE_REP (FN_FORMAT + 99) /* TableRepresentation */
#define FN_CONVERT_TEXT_TABLE (FN_FORMAT + 100) /* convert text <-> table */
-#define FN_TABLE_INSERT_ROW_AFTER (FN_FORMAT + 101) /* */
-#define FN_TABLE_INSERT_COL_AFTER (FN_FORMAT + 102) /* */
+#define FN_TABLE_INSERT_ROW (FN_FORMAT + 101) /* */
+#define FN_TABLE_INSERT_COL (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) /* */
#define FN_TABLE_MERGE_CELLS (FN_FORMAT + 106) /* */
#define FN_TABLE_SET_ROW_HEIGHT (FN_FORMAT + 107) /* */
#define FN_TABLE_SET_COL_WIDTH (FN_FORMAT + 108) /* */
+#define FN_TABLE_INSERT_ROW_AFTER (FN_FORMAT + 109) /* */
#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) /* */
+#define FN_TABLE_INSERT_COL_AFTER (FN_FORMAT + 116) /* */
#define FN_TABLE_SET_READ_ONLY_CELLS (FN_FORMAT + 117) /* protect table cells */
#define FN_TABLE_UNSET_READ_ONLY_CELLS (FN_FORMAT + 119) /* undo table cell protection */
#define FN_TABLE_HEADLINE_REPEAT (FN_FORMAT + 120) /* also used in SwXTextTable*/
diff --git a/sw/sdi/_tabsh.sdi b/sw/sdi/_tabsh.sdi
index 63792fe7b0e7..b8be3011e72f 100644
--- a/sw/sdi/_tabsh.sdi
+++ b/sw/sdi/_tabsh.sdi
@@ -148,6 +148,14 @@ interface BaseTextTable
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ // 2015/06 Deprecated, replaced by INSERT_COL_AFTER
+ FN_TABLE_INSERT_COL // status(final|play)
+ [
+ ExecMethod = Execute ;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+
FN_TABLE_INSERT_COL_AFTER // status(final|play)
[
ExecMethod = Execute ;
@@ -176,6 +184,14 @@ interface BaseTextTable
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ // 2015/06 Deprecated, replaced by INSERT_ROW_AFTER
+ FN_TABLE_INSERT_ROW // status(final|play)
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+
FN_TABLE_INSERT_ROW_DLG // status(final|play)
[
Export = FALSE ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 76987c789f3b..f8c123e849bf 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -3634,6 +3634,31 @@ SfxVoidItem InsertColumnsBefore FN_TABLE_INSERT_COL_BEFORE
GroupId = GID_TABLE;
]
+/* 2015/06 Deprecated, replaced by InsertColumsAfter */
+SfxVoidItem InsertColumns FN_TABLE_INSERT_COL
+()
+[
+ /* 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
()
[
@@ -4404,6 +4429,31 @@ SfxVoidItem InsertRowsBefore FN_TABLE_INSERT_ROW_BEFORE
GroupId = GID_TABLE;
]
+/* 2015/06 Deprecated, replaced by InsertRowsAfter */
+SfxVoidItem InsertRows FN_TABLE_INSERT_ROW
+()
+[
+ /* 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
()
[
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 55abe1001d4f..edf0ff30a128 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -820,13 +820,20 @@ void SwTableShell::Execute(SfxRequest &rReq)
OSL_ENSURE( false, "function may not be called now." );
break;
+
+ // 2015/06 The following two are deprecated but kept for ascending
+ // compatibility
+ case FN_TABLE_INSERT_COL:
+ case FN_TABLE_INSERT_ROW:
+ // fallback
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_BEFORE
- || rReq.GetSlot() == FN_TABLE_INSERT_COL_AFTER;
+ || rReq.GetSlot() == FN_TABLE_INSERT_COL_AFTER
+ || rReq.GetSlot() == FN_TABLE_INSERT_COL;
sal_uInt16 nCount = 0;
bool bAfter = true;
if (pItem)
@@ -860,7 +867,9 @@ void SwTableShell::Execute(SfxRequest &rReq)
nCount = maxY - minY + 1;
}
bAfter = rReq.GetSlot() == FN_TABLE_INSERT_COL_AFTER
- || rReq.GetSlot() == FN_TABLE_INSERT_ROW_AFTER;
+ || rReq.GetSlot() == FN_TABLE_INSERT_ROW_AFTER
+ || rReq.GetSlot() == FN_TABLE_INSERT_ROW
+ || rReq.GetSlot() == FN_TABLE_INSERT_COL;
}
if( nCount )
@@ -1251,6 +1260,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() )