diff options
Diffstat (limited to 'drawinglayer/source/primitive2d/controlprimitive2d.cxx')
-rw-r--r-- | drawinglayer/source/primitive2d/controlprimitive2d.cxx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx index 600bb4be8a3f..c3b030dcf1ac 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -45,33 +45,33 @@ namespace drawinglayer::primitive2d { void ControlPrimitive2D::createXControl() { - if(!mxXControl.is() && getControlModel().is()) - { - uno::Reference< beans::XPropertySet > xSet(getControlModel(), uno::UNO_QUERY); + if(!(!mxXControl.is() && getControlModel().is())) + return; - if(xSet.is()) - { - uno::Any aValue(xSet->getPropertyValue("DefaultControl")); - OUString aUnoControlTypeName; + uno::Reference< beans::XPropertySet > xSet(getControlModel(), uno::UNO_QUERY); - if(aValue >>= aUnoControlTypeName) - { - if(!aUnoControlTypeName.isEmpty()) - { - uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - uno::Reference< awt::XControl > xXControl( - xContext->getServiceManager()->createInstanceWithContext(aUnoControlTypeName, xContext), uno::UNO_QUERY); + if(!xSet.is()) + return; - if(xXControl.is()) - { - xXControl->setModel(getControlModel()); + uno::Any aValue(xSet->getPropertyValue("DefaultControl")); + OUString aUnoControlTypeName; - // remember XControl - mxXControl = xXControl; - } - } - } - } + if(!(aValue >>= aUnoControlTypeName)) + return; + + if(aUnoControlTypeName.isEmpty()) + return; + + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + uno::Reference< awt::XControl > xXControl( + xContext->getServiceManager()->createInstanceWithContext(aUnoControlTypeName, xContext), uno::UNO_QUERY); + + if(xXControl.is()) + { + xXControl->setModel(getControlModel()); + + // remember XControl + mxXControl = xXControl; } } |