summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-03 15:09:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-03 15:46:18 +0100
commitea3277265af9aab9a297151d5e1f3adfb1c823ef (patch)
tree4ea76837ed1ed578b5610616d52b2c99520182f4
parent5a67883ed4fd63bf0fed2d210fb0777a2008b170 (diff)
Resolves: fdo#76206 show 'Delete table' instead of 'Delete row'
on deleting a full table Change-Id: I03af8bcbae41e78229163a945a74387f53787ca5
-rw-r--r--sw/inc/fesh.hxx3
-rw-r--r--sw/inc/swundo.hxx3
-rw-r--r--sw/source/core/frmedt/fetab.cxx11
-rw-r--r--sw/source/core/uibase/shells/tabsh.cxx2
-rw-r--r--sw/source/core/undo/undo.hrc3
-rw-r--r--sw/source/core/undo/undo.src5
6 files changed, 19 insertions, 8 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 0108500d3568..2c4e5749f4d2 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -588,7 +588,8 @@ public:
bool InsertRow( sal_uInt16 nCnt, bool bBehind );
bool InsertCol( sal_uInt16 nCnt, bool bBehind ); // 0 == at the end.
sal_Bool DeleteCol();
- sal_Bool DeleteRow();
+ sal_Bool DeleteTable();
+ sal_Bool DeleteRow(bool bCompleteTable = false);
sal_Bool DeleteTblSel(); ///< Current selection, may be whole table.
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 5d92ea80dbef..5c5f197fe53b 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -167,7 +167,8 @@ enum SwUndoId
UNDO_UI_DELETE_INVISIBLECNTNT,
UNDO_UI_REPLACE_STYLE,
UNDO_UI_DELETE_PAGE_BREAK,
- UNDO_UI_TEXT_CORRECTION
+ UNDO_UI_TEXT_CORRECTION,
+ UNDO_UI_TABLE_DELETE
};
#endif
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 2d0227bfbbc7..fa3ca95312ed 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -334,7 +334,12 @@ sal_Bool SwFEShell::DeleteCol()
return bRet;
}
-sal_Bool SwFEShell::DeleteRow()
+sal_Bool SwFEShell::DeleteTable()
+{
+ return DeleteRow(true);
+}
+
+sal_Bool SwFEShell::DeleteRow(bool bCompleteTable)
{
// check if Point/Mark of current cursor are in a table
SwFrm *pFrm = GetCurrFrm();
@@ -441,9 +446,9 @@ sal_Bool SwFEShell::DeleteRow()
}
// now delete the lines
- StartUndo(UNDO_ROW_DELETE);
+ StartUndo(bCompleteTable ? UNDO_UI_TABLE_DELETE : UNDO_ROW_DELETE);
bRet = GetDoc()->DeleteRowCol( aBoxes );
- EndUndo(UNDO_ROW_DELETE);
+ EndUndo(bCompleteTable ? UNDO_UI_TABLE_DELETE : UNDO_ROW_DELETE);
}
else
bRet = sal_False;
diff --git a/sw/source/core/uibase/shells/tabsh.cxx b/sw/source/core/uibase/shells/tabsh.cxx
index 319f75f3794f..4080e9525302 100644
--- a/sw/source/core/uibase/shells/tabsh.cxx
+++ b/sw/source/core/uibase/shells/tabsh.cxx
@@ -1039,7 +1039,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
rSh.StartAction();
rSh.StartUndo();
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_TABLE_SELECT_ALL);
- rSh.DeleteRow();
+ rSh.DeleteTable();
rSh.EndUndo();
rSh.EndAction();
}
diff --git a/sw/source/core/undo/undo.hrc b/sw/source/core/undo/undo.hrc
index 9dcccbf97bd9..639409f4c10d 100644
--- a/sw/source/core/undo/undo.hrc
+++ b/sw/source/core/undo/undo.hrc
@@ -162,7 +162,8 @@
#define STR_REPLACE_STYLE (UI_UNDO_BEGIN + 12)
#define STR_DELETE_PAGE_BREAK (UI_UNDO_BEGIN + 13)
#define STR_TEXT_CORRECTION (UI_UNDO_BEGIN + 14)
-#define UI_UNDO_END STR_TEXT_CORRECTION
+#define STR_UNDO_TABLE_DELETE (UI_UNDO_BEGIN + 15)
+#define UI_UNDO_END STR_UNDO_TABLE_DELETE
#define UNDO_MORE_STRINGS_BEGIN (UI_UNDO_END + 1)
#define STR_OCCURRENCES_OF (UNDO_MORE_STRINGS_BEGIN)
diff --git a/sw/source/core/undo/undo.src b/sw/source/core/undo/undo.src
index 8db59db1a5c9..f2f969b3c1e2 100644
--- a/sw/source/core/undo/undo.src
+++ b/sw/source/core/undo/undo.src
@@ -651,5 +651,8 @@ String STR_UNDO_FLYFRMFMT_DESCRITPTION
{
Text[ en-US ] = "Change object description of $1";
};
-
+String STR_UNDO_TABLE_DELETE
+{
+ Text [ en-US ] = "Delete table" ;
+};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */