From 40c78e72656f5373c72bc725724071295c36fd62 Mon Sep 17 00:00:00 2001 From: Caolán McNamara <caolanm@redhat.com> Date: Tue, 28 Jan 2014 13:48:06 +0000 Subject: coverity#705872 Dereference before null check Change-Id: Ia964362f757372862b3f2e5a0a9581171616251b --- sd/source/ui/view/PresentationViewShellBase.cxx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/PresentationViewShellBase.cxx b/sd/source/ui/view/PresentationViewShellBase.cxx index 05d5228a478c..f0e1f52e2302 100644 --- a/sd/source/ui/view/PresentationViewShellBase.cxx +++ b/sd/source/ui/view/PresentationViewShellBase.cxx @@ -69,18 +69,15 @@ PresentationViewShellBase::PresentationViewShellBase ( : ViewShellBase (_pFrame, pOldShell) { // Hide the automatic (non-context sensitive) tool bars. - if (_pFrame!=NULL) + Reference<beans::XPropertySet> xFrameSet ( + _pFrame->GetFrame().GetFrameInterface(), + UNO_QUERY); + if (xFrameSet.is()) { - Reference<beans::XPropertySet> xFrameSet ( - _pFrame->GetFrame().GetFrameInterface(), - UNO_QUERY); - if (xFrameSet.is()) + Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY); + if (xLayouterSet.is()) { - Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY); - if (xLayouterSet.is()) - { - xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False)); - } + xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False)); } } } -- cgit