summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-25 09:28:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-25 14:54:13 +0200
commite79db65efb48f2f4e82945fc850bc38c8923e22d (patch)
tree7ba6b5b58ca3a0169aa5d03ec101c83e6be241c4 /filter
parent3866b859ee715da9eb124bc6fa8d2193d6af2442 (diff)
allow comphelper::OEnumerationByName to use a vector too for names
so we can skip some allocation. Use a std::variant to preserve existing functionality Change-Id: If01ebb04f7895fd52fa3f5d90648868fd38dc39e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/config/cache/basecontainer.cxx5
-rw-r--r--filter/source/config/cache/filterfactory.cxx3
2 files changed, 3 insertions, 5 deletions
diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx
index dbbb9bcc23da..0dee9d4ba25a 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -344,7 +344,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::crea
{
OSL_FAIL("not pure virtual ... but not really implemented .-)");
- return new ::comphelper::OEnumerationByName(this, css::uno::Sequence< OUString >());
+ return new ::comphelper::OEnumerationByName(this, {});
}
@@ -383,8 +383,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::crea
Further its easier to work directly with the return value
instead of checking of NULL returns! */
- css::uno::Sequence< OUString > lSubSet = comphelper::containerToSequence(lKeys);
- return new ::comphelper::OEnumerationByName(this, lSubSet);
+ return new ::comphelper::OEnumerationByName(this, std::move(lKeys));
}
diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx
index 54225db86d7c..e16ac3a2678d 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -185,8 +185,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea
// pack list of item names as an enum list
// Attention: Do not return empty reference for empty list!
// The outside check "hasMoreElements()" should be enough, to detect this state :-)
- css::uno::Sequence< OUString > lSet = comphelper::containerToSequence(lEnumSet);
- return new ::comphelper::OEnumerationByName(this, lSet);
+ return new ::comphelper::OEnumerationByName(this, std::move(lEnumSet));
}