summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-19 13:43:23 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-20 08:14:13 +0000
commitfe3fd05966a668c1cdf53e8221b8614e9a07de65 (patch)
tree4c6c105b78d0cb9c45431c2fecd2583d6a2aa85c /accessibility
parent1d5c39192e81f950289dbdd7991a0e8a67c0aabc (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')
-rw-r--r--accessibility/inc/accessibility/extended/textwindowaccessibility.hxx3
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx24
2 files changed, 4 insertions, 23 deletions
diff --git a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
index ab1e0890d44c..01e8e3cd608f 100644
--- a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
+++ b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
@@ -642,9 +642,6 @@ private:
const css::uno::Sequence< OUString >& RequestedAttributes,
tPropValMap& rRunAttrSeq);
- static css::uno::Sequence< css::beans::PropertyValue >
- convertHashMapToSequence(tPropValMap& rAttrSeq);
-
css::uno::Reference< css::accessibility::XAccessible > m_xAccessible;
::TextEngine & m_rEngine;
::TextView & m_rView;
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,