diff options
Diffstat (limited to 'sfx2/source/doc/guisaveas.cxx')
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index bcbd7679bef5..8688abd73117 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -225,20 +225,20 @@ public: { try { - uno::Reference< lang::XMultiServiceFactory > xDocSettingsSupplier( xModel, uno::UNO_QUERY_THROW ); - m_xDocumentSettings.set( - xDocSettingsSupplier->createInstance( u"com.sun.star.document.Settings"_ustr ), - uno::UNO_QUERY_THROW ); - - try + uno::Reference< lang::XMultiServiceFactory > xDocSettingsSupplier( xModel, uno::UNO_QUERY ); + if (xModel) { - OUString aLoadReadonlyString( u"LoadReadonly"_ustr ); - m_xDocumentSettings->getPropertyValue( aLoadReadonlyString ) >>= m_bPreserveReadOnly; - m_xDocumentSettings->setPropertyValue( aLoadReadonlyString, uno::Any( bReadOnly ) ); - m_bReadOnlySupported = true; + m_xDocumentSettings.set( + xDocSettingsSupplier->createInstance( u"com.sun.star.document.Settings"_ustr ), + uno::UNO_QUERY ); + if (m_xDocumentSettings) + { + OUString aLoadReadonlyString( u"LoadReadonly"_ustr ); + m_xDocumentSettings->getPropertyValue( aLoadReadonlyString ) >>= m_bPreserveReadOnly; + m_xDocumentSettings->setPropertyValue( aLoadReadonlyString, uno::Any( bReadOnly ) ); + m_bReadOnlySupported = true; + } } - catch( const uno::Exception& ) - {} } catch( const uno::Exception& ) {} |