summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unotext.cxx
diff options
context:
space:
mode:
authorGabor Kelemen <kelemen.gabor2@nisz.hu>2019-08-08 18:12:26 +0200
committerLászló Németh <nemeth@numbertext.org>2019-08-09 09:37:31 +0200
commit45509a5eec0d946d06f249d391dee361e91808c6 (patch)
treebcfb81756215e4bec810dbbf641c58375e93555d /sw/source/core/unocore/unotext.cxx
parent29bd64dd93150cfbec646f5af7c75996fd15d8e5 (diff)
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@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/unocore/unotext.cxx')
-rw-r--r--sw/source/core/unocore/unotext.cxx11
1 files changed, 8 insertions, 3 deletions
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;
}