diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-17 15:42:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-18 11:03:02 +0200 |
commit | 7fc6063914432d58d86cfcbd728d967e7c86ebfd (patch) | |
tree | f71fe9f99edaa4e896c78cdf32e34b516194d748 /xmloff/source/core | |
parent | db83c41d460103df5d80f5bd99816575c4ead5cd (diff) |
use more Reference::query instead of UNO_QUERY_THROW
since querying with exceptions is consideably more expensive
Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/core')
-rw-r--r-- | xmloff/source/core/XMLEmbeddedObjectImportContext.cxx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index 980dd8e0572d..f55edf062e74 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -122,14 +122,8 @@ void XMLEmbeddedObjectImportContext::SetComponent( Reference< XComponent > const SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(xFilter.get()); mxFastHandler = pFastHandler; - try - { - Reference < XModifiable2 > xModifiable2( rComp, UNO_QUERY_THROW ); + if (auto xModifiable2 = rComp.query<XModifiable2>() ) xModifiable2->disableSetModified(); - } - catch( Exception& ) - { - } Reference < XImporter > xImporter( mxFastHandler, UNO_QUERY ); xImporter->setTargetDocument( rComp ); @@ -242,15 +236,11 @@ void XMLEmbeddedObjectImportContext::endFastElement(sal_Int32 nElement) mxFastHandler->endFastElement( nElement ); mxFastHandler->endDocument(); - try + if (auto xModifiable2 = xComp.query<XModifiable2>() ) { - Reference < XModifiable2 > xModifiable2( xComp, UNO_QUERY_THROW ); xModifiable2->enableSetModified(); xModifiable2->setModified( true ); // trigger new replacement image generation } - catch( Exception& ) - { - } } void XMLEmbeddedObjectImportContext::characters( const OUString& rChars ) |