summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-06 09:41:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-06 13:32:42 +0100
commite6341e0f613237020fef9e2028e123022ff2ce38 (patch)
tree88e71245ac409ec02bec92f32fcc1627bf492d46 /sw
parent7e0e92d6ea01b7e942bc344075b96fe3bedc2b6d (diff)
cid#1458160 Dereference before null check
since... commit 6e2ed4ea934851f82611c3352b9551046fda89d0 Date: Mon Jan 20 11:55:02 2020 +0300 sw: set unique name for fontwork object and style on insertion Change-Id: I0030425c77bba9a8fe720002114c2b9076c93c4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88078 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/frmedt/fefly1.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 51f2f7f04c75..ae5ed8246007 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -935,8 +935,8 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
}
// insert drawing object into the document creating a new <SwDrawFrameFormat> instance
SwDrawFrameFormat* pFormat = GetDoc()->getIDocumentContentOperations().InsertDrawObj( aPam, rDrawObj, rFlyAttrSet );
- pFormat->SetName(GetDoc()->GetUniqueShapeName());
- rDrawObj.SetName(pFormat->GetName());
+ OUString sShapeName = GetDoc()->GetUniqueShapeName();
+ rDrawObj.SetName(sShapeName);
// move object to visible layer
SwContact* pContact = static_cast<SwContact*>(rDrawObj.GetUserCall());
@@ -945,8 +945,9 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
pContact->MoveObjToVisibleLayer( &rDrawObj );
}
- if ( pFormat )
+ if (pFormat)
{
+ pFormat->SetName(sShapeName);
// select drawing object
Imp()->GetDrawView()->MarkObj( &rDrawObj, Imp()->GetPageView() );
}