summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-03-11 19:01:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-12 08:40:33 +0100
commit6fb716d58c1285a1abbfa6683c2f4bfaeb89e2c6 (patch)
treef3159d6f987bde82dc593ae4bf9aa0c90aecc4db /sd/source
parent344353495c60dcdc69f7975ec4e51a753ebfb81f (diff)
simplify some service factory code
no need to get the factory from the component context and then get the context from the service factory Change-Id: I7675728992fbb5202bc42e27b86b2dba571c62c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131394 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/core/drawdoc.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index f1a9a55cedcd..796bbe1a477b 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -1113,16 +1113,15 @@ void SdDrawDocument::InitLayoutVector()
const Sequence< OUString > aFiles(
officecfg::Office::Impress::Misc::LayoutListFiles::get() );
- OUString sFilename;
+ if (aFiles.getLength() == 0)
+ return;
+ const Reference<XDocumentBuilder> xDocBuilder = DocumentBuilder::create( xContext );
+
for( const auto& rFile : aFiles )
{
- sFilename = comphelper::getExpandedUri(xContext, rFile);
+ OUString sFilename = comphelper::getExpandedUri(xContext, rFile);
// load layout file into DOM
- Reference< XMultiServiceFactory > xServiceFactory(
- xContext->getServiceManager() , UNO_QUERY_THROW );
- const Reference<XDocumentBuilder> xDocBuilder(
- DocumentBuilder::create( comphelper::getComponentContext (xServiceFactory) ));
try
{
@@ -1152,16 +1151,14 @@ void SdDrawDocument::InitObjectVector()
const Sequence< OUString > aFiles(
officecfg::Office::Impress::Misc::PresObjListFiles::get() );
- OUString sFilename;
+ if (aFiles.getLength() == 0)
+ return;
+ const Reference<XDocumentBuilder> xDocBuilder = DocumentBuilder::create( xContext );
for( const auto& rFile : aFiles )
{
- sFilename = comphelper::getExpandedUri(xContext, rFile);
+ OUString sFilename = comphelper::getExpandedUri(xContext, rFile);
// load presentation object file into DOM
- Reference< XMultiServiceFactory > xServiceFactory(
- xContext->getServiceManager() , UNO_QUERY_THROW );
- const Reference<XDocumentBuilder> xDocBuilder(
- DocumentBuilder::create( comphelper::getComponentContext (xServiceFactory) ));
try
{