summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-08 17:55:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-08 21:11:50 +0200
commitf4883ff377369e36ad9f080b0c5f027023707297 (patch)
tree864c6a2b736129c04642f657749c680999826d4f /svx/source/svdraw
parentcacb19b479f83dc0411f165edab9fd13f05b0afb (diff)
tdf#150845 fix crash in writer Form->TextObject
regression from commit 8611f6e259b807b4f19c8dc0eab86ca648891ce3 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu May 27 10:27:46 2021 +0200 ref-count SdrObject Change-Id: I66370566562a1275c21c24523a505704508d3d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139703 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdcrtv.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index a73c5fe531af..1aa9d1d2d54e 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -337,14 +337,14 @@ void SdrCreateView::SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent)
{
mnCurrentInvent=nInvent;
mnCurrentIdent=nIdent;
+ rtl::Reference<SdrObject> pObj = (nIdent == SdrObjKind::NONE) ? nullptr :
+ SdrObjFactory::MakeNewObject(
+ *GetModel(),
+ nInvent,
+ nIdent);
- if(nIdent != SdrObjKind::NONE)
+ if(pObj)
{
- rtl::Reference<SdrObject> pObj =
- SdrObjFactory::MakeNewObject(
- *GetModel(),
- nInvent,
- nIdent);
// Using text tool, mouse cursor is usually I-Beam,
// crosshairs with tiny I-Beam appears only on MouseButtonDown.
if(IsTextTool())