framework/source/loadenv/loadenv.cxx | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
New commits: commit bb73961ed0a5f4e09a9b761a02547490a46a06bd Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sun Oct 17 16:48:21 2021 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Mon Oct 18 16:41:46 2021 +0200 Simplify Sequences init + remove dup block + typos in framework Change-Id: Ife80915c402ff25aa4752a5e1b68337eca3dd85f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123721 Tested-by: Julien Nabet <serval2...@yahoo.fr> Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index a4b7e6557004..25639461f0ad 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -606,29 +606,26 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString& OUString sType = xDetect->queryTypeByURL(sURL); - css::uno::Sequence< css::beans::NamedValue > lQuery(1); css::uno::Reference< css::frame::XLoaderFactory > xLoaderFactory; css::uno::Reference< css::container::XEnumeration > xSet; - css::uno::Sequence< OUString > lTypesReg(1); // (iii) If a FrameLoader service (or at least // a Filter) can be found, which supports // this URL - it must be a loadable content. // Because both items are registered for types // it's enough to check for frame loaders only. - // Mos of our filters are handled by our global + // Most of our filters are handled by our global // default loader. But there exist some specialized // loader, which does not work on top of filters! // So it's not enough to search on the filter configuration. // Further it's not enough to search for types! // Because there exist some types, which are referenced by - // other objects... but not by filters nor frame loaders! - - OUString sPROP_TYPES(PROP_TYPES); - - lTypesReg[0] = sType; - lQuery[0].Name = sPROP_TYPES; - lQuery[0].Value <<= lTypesReg; + // other objects... but neither by filters nor frame loaders! + css::uno::Sequence< OUString > lTypesReg { sType }; + css::uno::Sequence< css::beans::NamedValue > lQuery + { + css::beans::NamedValue(PROP_TYPES, makeAny(lTypesReg)) + }; xLoaderFactory = css::frame::FrameLoaderFactory::create(xContext); xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery); @@ -640,10 +637,6 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString& // E.g. ContentHandler. // Such contents can be handled ... but not loaded. - lTypesReg[0] = sType; - lQuery[0].Name = sPROP_TYPES; - lQuery[0].Value <<= lTypesReg; - xLoaderFactory = css::frame::ContentHandlerFactory::create(xContext); xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery); // at least one registered content handler is enough!