diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-04 12:31:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-04 12:31:06 +0000 |
commit | 3f4a461c57e5d07b7d0a03befe8f264fcd2ca8f7 (patch) | |
tree | fece3a30609b1f8b05d7e75e9aa4a21df004747d | |
parent | 59238ef422468756c4fb67d4a00bb8c5ad31ffbc (diff) |
clean up now that pGraphic ==NULL is an early return
Change-Id: I9d8e03eeb63ab2086fc354f546419b33d7b34411
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 7a752b1b2f3a..bc942710f733 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -287,36 +287,29 @@ void SdrGrafObj::onGraphicChanged() if (!pGraphic || pGraphic->IsSwappedOut()) // don't force swap-in for this return; - OUString aName; - OUString aTitle; - OUString aDesc; + const SvgDataPtr& rSvgDataPtr = pGraphic->GetGraphic().getSvgData(); - if(pGraphic) - { - const SvgDataPtr& rSvgDataPtr = pGraphic->GetGraphic().getSvgData(); + if (!rSvgDataPtr.get()) + return; - if(rSvgDataPtr.get()) - { - const drawinglayer::primitive2d::Primitive2DSequence aSequence(rSvgDataPtr->getPrimitive2DSequence()); + const drawinglayer::primitive2d::Primitive2DSequence aSequence(rSvgDataPtr->getPrimitive2DSequence()); - if(aSequence.hasElements()) - { - drawinglayer::geometry::ViewInformation2D aViewInformation2D; - drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D aProcessor(aViewInformation2D); + if (!aSequence.hasElements()) + return; - aProcessor.process(aSequence); + drawinglayer::geometry::ViewInformation2D aViewInformation2D; + drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D aProcessor(aViewInformation2D); - const drawinglayer::primitive2d::ObjectInfoPrimitive2D* pResult = aProcessor.getResult(); + aProcessor.process(aSequence); - if(pResult) - { - aName = pResult->getName(); - aTitle = pResult->getTitle(); - aDesc = pResult->getDesc(); - } - } - } - } + const drawinglayer::primitive2d::ObjectInfoPrimitive2D* pResult = aProcessor.getResult(); + + if (!pResult) + return; + + OUString aName = pResult->getName(); + OUString aTitle = pResult->getTitle(); + OUString aDesc = pResult->getDesc(); if(!aName.isEmpty()) { |