diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-06-04 21:59:50 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-06-05 00:03:04 +0200 |
commit | f97a7b965be154824e108802b386e3132b0a237a (patch) | |
tree | 9745de77af342b478a721e0f0a9c47c8251529fe /svx | |
parent | af27b57521075b35234daed4a6a7b554ed434df7 (diff) |
Simplify vector intialization in svx/svdmodel
Change-Id: Ieaed80e4621084baf531b794323b2742ccd80310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152594
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 82c9a92fa503..4e1ea3c78ac5 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1834,23 +1834,15 @@ void SdrModel::ReadUserDataSequenceValue(const beans::PropertyValue* pValue) } } -template <typename T> -static void addPair(std::vector< std::pair< OUString, uno::Any > >& aUserData, const OUString& name, const T val) -{ - aUserData.push_back(std::pair< OUString, uno::Any >(name, uno::Any(val))); -} - void SdrModel::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rValues) { - std::vector< std::pair< OUString, uno::Any > > aUserData; - addPair(aUserData, "AnchoredTextOverflowLegacy", - GetCompatibilityFlag(SdrCompatibilityFlag::AnchoredTextOverflowLegacy)); - addPair(aUserData, "LegacySingleLineFontwork", - GetCompatibilityFlag(SdrCompatibilityFlag::LegacySingleLineFontwork)); - addPair(aUserData, "ConnectorUseSnapRect", - GetCompatibilityFlag(SdrCompatibilityFlag::ConnectorUseSnapRect)); - addPair(aUserData, "IgnoreBreakAfterMultilineField", - GetCompatibilityFlag(SdrCompatibilityFlag::IgnoreBreakAfterMultilineField)); + std::vector< std::pair< OUString, uno::Any > > aUserData + { + { "AnchoredTextOverflowLegacy", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::AnchoredTextOverflowLegacy)) }, + { "LegacySingleLineFontwork", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::LegacySingleLineFontwork)) }, + { "ConnectorUseSnapRect", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::ConnectorUseSnapRect)) }, + { "IgnoreBreakAfterMultilineField", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::IgnoreBreakAfterMultilineField)) } + }; const sal_Int32 nOldLength = rValues.getLength(); rValues.realloc(nOldLength + aUserData.size()); |