diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-10 10:02:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-10 20:43:38 +0200 |
commit | 474a9171e7e996116037bb9ca6c985d0a3d6c0c3 (patch) | |
tree | 7ca10ffc1a6514817ff173e41d1ac04251b69c9a /sw/source/core/unocore | |
parent | b0ede91f5e64767bd3ba9f427687e1faf2297e0c (diff) |
loplugin:buriedassign in sw
limited this only fixing assignments inside "if" statements, since other
things are harder to change
Change-Id: If3188a3e3d5fcd94123211c97fee097ece5e2797
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95990
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index d453f1c79709..ba02dfcda14f 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -3067,10 +3067,14 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) { SolarMutexGuard g; - SwFrameFormat* pFormat; if(IsDescriptor()) + { attachToRange(xTextRange); - else if(nullptr != (pFormat = GetFrameFormat())) + return; + } + + SwFrameFormat* pFormat = GetFrameFormat(); + if( pFormat ) { SwDoc* pDoc = pFormat->GetDoc(); SwUnoInternalPaM aIntPam(*pDoc); @@ -3091,7 +3095,6 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) aAnchor.SetAnchor( aIntPam.Start() ); aSet.Put(aAnchor); pDoc->SetFlyFrameAttr( *pFormat, aSet ); - } } |