summaryrefslogtreecommitdiffstats
path: root/sw/source/core/swg/SwXMLTextBlocks.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/swg/SwXMLTextBlocks.cxx')
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 3bb108cbf22e..e264548e3c37 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -295,9 +295,11 @@ ErrCode SwXMLTextBlocks::StartPutBlock( const OUString& rShort, const OUString&
{
m_xRoot = m_xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::READWRITE );
- uno::Reference< beans::XPropertySet > xRootProps( m_xRoot, uno::UNO_QUERY_THROW );
- OUString aMime( SotExchange::GetFormatMimeType( SotClipboardFormatId::STARWRITER_8 ) );
- xRootProps->setPropertyValue( "MediaType", uno::Any( aMime ) );
+ if (auto xRootProps = m_xRoot.query<beans::XPropertySet>() )
+ {
+ OUString aMime( SotExchange::GetFormatMimeType( SotClipboardFormatId::STARWRITER_8 ) );
+ xRootProps->setPropertyValue( "MediaType", uno::Any( aMime ) );
+ }
}
catch (const uno::Exception&)
{