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

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 9 07:38:25 UTC 2019


 sw/inc/strings.hrc                 |    1 +
 sw/source/core/unocore/unotext.cxx |   11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 45509a5eec0d946d06f249d391dee361e91808c6
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Thu Aug 8 18:12:26 2019 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Fri Aug 9 09:37:31 2019 +0200

    tdf#107317 Make undo insert text box to shape display proper message
    
    Instead of Insert $1 -> Insert text box
    
    Change-Id: I2131c3e7a88f005830fd755acc50fd71168fca10
    Reviewed-on: https://gerrit.libreoffice.org/77173
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    Tested-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 59bab4121472..232e673fbd5e 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -525,6 +525,7 @@
 #define STR_UNDO_INDEX_ENTRY_INSERT             NC_("STR_UNDO_INDEX_ENTRY_INSERT", "Insert index entry")
 #define STR_UNDO_INDEX_ENTRY_DELETE             NC_("STR_UNDO_INDEX_ENTRY_DELETE", "Delete index entry")
 #define STR_FIELD                               NC_("STR_FIELD", "field")
+#define STR_UNDO_INSERT_TEXTBOX                 NC_("STR_UNDO_INSERT_TEXTBOX", "text box")
 /*undo: STR_PARAGRAPHS, string.text*/
 #define STR_PARAGRAPHS                          NC_("STR_PARAGRAPHS", "Paragraphs")
 #define STR_FRAME                               NC_("STR_FRAME", "frame")
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index a9dd85aed58a..e7ac0b634f1e 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -71,6 +71,8 @@
 #include <fmtanchr.hxx>
 #include <fmtcntnt.hxx>
 #include <ndtxt.hxx>
+#include <SwRewriter.hxx>
+#include <strings.hrc>
 
 using namespace ::com::sun::star;
 
@@ -1437,7 +1439,10 @@ SwXText::insertTextContentWithProperties(
         throw  uno::RuntimeException();
     }
 
-    m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT, nullptr);
+    SwRewriter aRewriter;
+    aRewriter.AddRule(UndoArg1, SwResId(STR_UNDO_INSERT_TEXTBOX));
+
+    m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT, &aRewriter);
 
     // now attach the text content here
     insertTextContent( xInsertPosition, xTextContent, false );
@@ -1459,12 +1464,12 @@ SwXText::insertTextContentWithProperties(
         catch (const uno::Exception& e)
         {
             css::uno::Any anyEx = cppu::getCaughtException();
-            m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);
+            m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, &aRewriter);
             throw lang::WrappedTargetRuntimeException( e.Message,
                             uno::Reference< uno::XInterface >(), anyEx );
         }
     }
-    m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);
+    m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, &aRewriter);
     return xInsertPosition;
 }
 


More information about the Libreoffice-commits mailing list