summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-06-05 11:46:34 +0200
committerPhilippe Jung <phil.jung@free.fr>2015-06-05 13:38:03 +0000
commit55bcba1e0aba237a873ee1f788761045a8eff846 (patch)
treedbf32ec77638faf92c08a04545796098f486560a /sw
parent275f0c7b250d448a8e2658ee2f26d4010628237b (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/16097 Reviewed-by: Philippe Jung <phil.jung@free.fr> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-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
4 files changed, 82 insertions, 4 deletions
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 2368d9dada44..03b94c1f28ae 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 b1a6fc0c8c8d..13aa5dfce92b 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() )