[Libreoffice-commits] core.git: svx/source
Caolán McNamara
caolanm at redhat.com
Tue Feb 4 04:32:21 PST 2014
svx/source/svdraw/svdograf.cxx | 41 +++++++++++++++++------------------------
1 file changed, 17 insertions(+), 24 deletions(-)
New commits:
commit 3f4a461c57e5d07b7d0a03befe8f264fcd2ca8f7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Feb 4 12:31:06 2014 +0000
clean up now that pGraphic ==NULL is an early return
Change-Id: I9d8e03eeb63ab2086fc354f546419b33d7b34411
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 7a752b1..bc94271 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())
{
More information about the Libreoffice-commits
mailing list