[Libreoffice-commits] core.git: xmloff/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 20 09:58:03 UTC 2021
xmloff/source/style/xmlexppr.cxx | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
New commits:
commit 37d5cdef8d4678eed03909bd5459d52cd0a19ed7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 19 12:31:30 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 20 11:57:26 2021 +0200
no need to allocate Sequence separately in FilterPropertiesInfo_Impl
Change-Id: I8a10d2c0a31624cfefa485ae1a7d080f96d2b83e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119218
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index aeda6e081405..44bab345afe2 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -18,6 +18,7 @@
*/
#include <memory>
+#include <optional>
#include <string_view>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/xml/AttributeData.hpp>
@@ -158,7 +159,7 @@ class FilterPropertiesInfo_Impl
{
FilterPropertyInfoList_Impl aPropInfos;
- std::unique_ptr<Sequence<OUString>> pApiNames;
+ std::optional<Sequence<OUString>> mxApiNames;
public:
FilterPropertiesInfo_Impl();
@@ -183,13 +184,13 @@ void FilterPropertiesInfo_Impl::AddProperty(
{
aPropInfos.emplace_back(rApiName, nIndex);
- OSL_ENSURE( !pApiNames, "performance warning: API names already retrieved" );
- pApiNames.reset();
+ OSL_ENSURE( !mxApiNames, "performance warning: API names already retrieved" );
+ mxApiNames.reset();
}
const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
{
- if( !pApiNames )
+ if( !mxApiNames )
{
// we have to do three things:
// 1) sort API names,
@@ -232,8 +233,8 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
}
// construct sequence
- pApiNames.reset( new Sequence < OUString >( aPropInfos.size() ) );
- OUString *pNames = pApiNames->getArray();
+ mxApiNames.emplace( aPropInfos.size() );
+ OUString *pNames = mxApiNames->getArray();
for (auto const& propInfo : aPropInfos)
{
@@ -242,7 +243,7 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
}
}
- return *pApiNames;
+ return *mxApiNames;
}
void FilterPropertiesInfo_Impl::FillPropertyStateArray(
More information about the Libreoffice-commits
mailing list