[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source tools/source

Caolán McNamara caolanm at redhat.com
Thu Apr 3 07:46:43 PDT 2014


 sw/inc/fesh.hxx                        |    3 ++-
 sw/inc/swundo.hxx                      |    3 ++-
 sw/source/core/frmedt/fetab.cxx        |   11 ++++++++---
 sw/source/core/uibase/shells/tabsh.cxx |    2 +-
 sw/source/core/undo/undo.hrc           |    3 ++-
 sw/source/core/undo/undo.src           |    5 ++++-
 tools/source/rc/rc.cxx                 |    1 +
 7 files changed, 20 insertions(+), 8 deletions(-)

New commits:
commit ea3277265af9aab9a297151d5e1f3adfb1c823ef
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 3 15:09:39 2014 +0100

    Resolves: fdo#76206 show 'Delete table' instead of 'Delete row'
    
    on deleting a full table
    
    Change-Id: I03af8bcbae41e78229163a945a74387f53787ca5

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 0108500..2c4e574 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 5d92ea8..5c5f197 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 2d0227b..fa3ca95 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 319f75f..4080e95 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 9dcccbf..639409f 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 8db59db..f2f969b 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: */
commit 5a67883ed4fd63bf0fed2d210fb0777a2008b170
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 3 15:23:43 2014 +0100

    coverity#1079187 Uninitialized pointer read
    
    Change-Id: Ie3044bebc7921b0fa98f9a9a01f99ef0f2d05eb8

diff --git a/tools/source/rc/rc.cxx b/tools/source/rc/rc.cxx
index f3e966d..5700f15 100644
--- a/tools/source/rc/rc.cxx
+++ b/tools/source/rc/rc.cxx
@@ -25,6 +25,7 @@
 #include <tools/rcid.h>
 
 Resource::Resource( const ResId& rResId )
+    : m_pResMgr(NULL)
 {
     GetRes( rResId.SetRT( RSC_RESOURCE ) );
 }


More information about the Libreoffice-commits mailing list