summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starmath/source/edit.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index bf0544aec870..61721a2ee91a 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -28,6 +28,7 @@
#include <editeng/editview.hxx>
#include <editeng/editeng.hxx>
#include <editeng/editstat.hxx>
+#include <o3tl/make_unique.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/stritem.hxx>
#include <sfx2/viewfrm.hxx>
@@ -961,9 +962,10 @@ void SmEditWindow::Flush()
SmViewShell *pViewSh = rCmdBox.GetView();
if (pViewSh)
{
+ std::unique_ptr<SfxStringItem> pTextToFlush = o3tl::make_unique<SfxStringItem>(SID_TEXT, GetText());
pViewSh->GetViewFrame()->GetDispatcher()->ExecuteList(
SID_TEXT, SfxCallMode::RECORD,
- { new SfxStringItem(SID_TEXT, GetText()) });
+ { pTextToFlush.get() });
}
}
if (aCursorMoveIdle.IsActive())