diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-19 13:43:23 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-20 08:14:13 +0000 |
commit | fe3fd05966a668c1cdf53e8221b8614e9a07de65 (patch) | |
tree | 4c6c105b78d0cb9c45431c2fecd2583d6a2aa85c /accessibility/source | |
parent | 1d5c39192e81f950289dbdd7991a0e8a67c0aabc (diff) |
add mapKeysToSequence/mapValuesToSequence methods to comphelper
and use them
Change-Id: If4dc9df63db37185228aeaaab2979498d61304ec
Reviewed-on: https://gerrit.libreoffice.org/20055
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'accessibility/source')
-rw-r--r-- | accessibility/source/extended/textwindowaccessibility.cxx | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index b21c77169dd0..fbf2cd7d0f29 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -23,6 +23,7 @@ #include <unotools/accessiblestatesethelper.hxx> #include <vcl/window.hxx> #include <toolkit/helper/convert.hxx> +#include <comphelper/sequence.hxx> #include <algorithm> #include <vector> @@ -1101,7 +1102,7 @@ Document::retrieveCharacterAttributes( aCharAttrSeq[ pValues->Name ] = *pValues; } - css::uno::Sequence< css::beans::PropertyValue > aRes = convertHashMapToSequence( aCharAttrSeq ); + css::uno::Sequence< css::beans::PropertyValue > aRes = comphelper::mapValuesToSequence( aCharAttrSeq ); // sort the attributes sal_Int32 nLength = aRes.getLength(); @@ -1143,24 +1144,7 @@ Document::retrieveDefaultAttributes( tPropValMap aDefAttrSeq; retrieveDefaultAttributesImpl( pParagraph, RequestedAttributes, aDefAttrSeq ); - return convertHashMapToSequence( aDefAttrSeq ); -} - -// static -css::uno::Sequence< css::beans::PropertyValue > -Document::convertHashMapToSequence(tPropValMap& rAttrSeq) -{ - css::uno::Sequence< css::beans::PropertyValue > aValues( rAttrSeq.size() ); - css::beans::PropertyValue* pValues = aValues.getArray(); - ::sal_Int32 i = 0; - for ( tPropValMap::const_iterator aIter = rAttrSeq.begin(); - aIter != rAttrSeq.end(); - ++aIter ) - { - pValues[i] = aIter->second; - ++i; - } - return aValues; + return comphelper::mapValuesToSequence( aDefAttrSeq ); } void Document::retrieveRunAttributesImpl( @@ -1233,7 +1217,7 @@ Document::retrieveRunAttributes( tPropValMap aRunAttrSeq; retrieveRunAttributesImpl( pParagraph, Index, RequestedAttributes, aRunAttrSeq ); - return convertHashMapToSequence( aRunAttrSeq ); + return comphelper::mapValuesToSequence( aRunAttrSeq ); } void Document::changeParagraphText(Paragraph * pParagraph, |