diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/smarttags/SmartTagMgr.cxx | 22 | ||||
-rw-r--r-- | svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx | 15 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 5 | ||||
-rw-r--r-- | svx/source/xml/xmleohlp.cxx | 14 | ||||
-rw-r--r-- | svx/source/xml/xmlxtimp.cxx | 5 |
5 files changed, 38 insertions, 23 deletions
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index 084311205109..86322fcc1234 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -242,7 +242,9 @@ void SmartTagMgr::WriteConfiguration( const bool* pIsLabelTextWithSmartTags, { try { - Reference< util::XChangesBatch >( mxConfigurationSettings, UNO_QUERY_THROW )->commitChanges(); + Reference< util::XChangesBatch > xChanges( mxConfigurationSettings, UNO_QUERY ); + if (xChanges) + xChanges->commitChanges(); } catch ( css::uno::Exception& ) { @@ -446,10 +448,11 @@ void SmartTagMgr::RegisterListener() { Reference<deployment::XExtensionManager> xExtensionManager( deployment::ExtensionManager::get( mxContext ) ); - Reference< util::XModifyBroadcaster > xMB ( xExtensionManager, UNO_QUERY_THROW ); - - Reference< util::XModifyListener > xListener( this ); - xMB->addModifyListener( xListener ); + if (xExtensionManager) + { + Reference< util::XModifyListener > xListener( this ); + xExtensionManager->addModifyListener( xListener ); + } } catch ( uno::Exception& ) { @@ -458,9 +461,12 @@ void SmartTagMgr::RegisterListener() // register as listener at configuration try { - Reference<util::XChangesNotifier> xCN( mxConfigurationSettings, UNO_QUERY_THROW ); - Reference< util::XChangesListener > xListener( this ); - xCN->addChangesListener( xListener ); + Reference<util::XChangesNotifier> xCN( mxConfigurationSettings, UNO_QUERY ); + if (xCN) + { + Reference< util::XChangesListener > xListener( this ); + xCN->addChangesListener( xListener ); + } } catch ( uno::Exception& ) { diff --git a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx index 5496f4d4ae9a..a15d81f01be8 100644 --- a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx +++ b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx @@ -101,13 +101,16 @@ void StylesPreviewToolBoxControl::InitializeStyles( if (xCellStyles->hasByName(sStyleName)) { css::uno::Reference<css::beans::XPropertySet> xStyle( - xCellStyles->getByName(sStyleName), css::uno::UNO_QUERY_THROW); - OUString sName; - xStyle->getPropertyValue(u"DisplayName"_ustr) >>= sName; - if (!sName.isEmpty()) + xCellStyles->getByName(sStyleName), css::uno::UNO_QUERY); + if (xStyle) { - m_aDefaultStyles.push_back( - std::pair<OUString, OUString>(sStyleName, sName)); + OUString sName; + xStyle->getPropertyValue(u"DisplayName"_ustr) >>= sName; + if (!sName.isEmpty()) + { + m_aDefaultStyles.push_back( + std::pair<OUString, OUString>(sStyleName, sName)); + } } } } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 95631463bd21..31e0fdc3f109 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2832,8 +2832,9 @@ SvxLineWindow_Impl::SvxLineWindow_Impl(SvxFrameToolBoxControl* pControl, weld::W { try { - Reference< lang::XServiceInfo > xServices(m_xFrame->getController()->getModel(), UNO_QUERY_THROW); - m_bIsWriter = xServices->supportsService(u"com.sun.star.text.TextDocument"_ustr); + Reference< lang::XServiceInfo > xServices(m_xFrame->getController()->getModel(), UNO_QUERY); + if (xServices) + m_bIsWriter = xServices->supportsService(u"com.sun.star.text.TextDocument"_ustr); } catch(const uno::Exception& ) { diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index beb39da14ff8..d931e2a15105 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -373,12 +373,16 @@ void SvXMLEmbeddedObjectHelper::ImplReadObject( // TODO/LATER: what to do when other types of objects are based on substream persistence? // This is an ole object - uno::Reference< beans::XPropertySet > xProps( xStm, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue( - u"MediaType"_ustr, - uno::Any( u"application/vnd.sun.star.oleobject"_ustr ) ); + uno::Reference< beans::XPropertySet > xProps( xStm, uno::UNO_QUERY ); + if (xProps) + { + xProps->setPropertyValue( + u"MediaType"_ustr, + uno::Any( u"application/vnd.sun.star.oleobject"_ustr ) ); + - xStm->getOutputStream()->closeOutput(); + xStm->getOutputStream()->closeOutput(); + } } catch ( uno::Exception& ) { diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index a6d2b80194b4..a2ce48ddc713 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -476,8 +476,9 @@ bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer, try { - uno::Reference< io::XSeekable > xSeek( aParserInput.aInputStream, uno::UNO_QUERY_THROW ); - xSeek->seek( 0 ); + uno::Reference< io::XSeekable > xSeek( aParserInput.aInputStream, uno::UNO_QUERY ); + if (xSeek) + xSeek->seek( 0 ); } catch (const uno::Exception&) { |