diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-12-10 11:23:38 +0000 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-12-10 12:44:42 +0000 |
commit | 8d52045853cecb716138d51b8b6ad0272a86af86 (patch) | |
tree | 1f53755d1db21f5237b5d2e92b07055da53b9fe5 /accessibility | |
parent | 289124284f98bbea442871455cf7da5fe9ef3aae (diff) |
tdf#93430: Return the right offsets for runs
MultiLineEdit is a special control which can have
more text portions with different text attributes.
Change-Id: Iab51dba0d0344fad4358f4961c968c031b1660b6
Reviewed-on: https://gerrit.libreoffice.org/31813
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessibleedit.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx index cdba0b2cc44b..f9763202405a 100644 --- a/accessibility/source/standard/vclxaccessibleedit.cxx +++ b/accessibility/source/standard/vclxaccessibleedit.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> +#include <com/sun/star/accessibility/AccessibleTextType.hpp> #include <cppuhelper/typeprovider.hxx> #include <comphelper/sequence.hxx> #include <comphelper/string.hxx> @@ -475,6 +476,20 @@ css::accessibility::TextSegment VCLXAccessibleEdit::getTextAtIndex( sal_Int32 nI { OExternalLockGuard aGuard( this ); + // Override general text component behavior: MultiLineEdit can have more text portions + if ( aTextType == AccessibleTextType::ATTRIBUTE_RUN ) + { + VclPtr<VclMultiLineEdit> pMulitLineEdit = GetAsDynamic< VclMultiLineEdit >(); + if ( pMulitLineEdit ) + { + ExtTextEngine* pTextEngine = pMulitLineEdit->GetTextEngine(); + TextPaM aCursor( 0, nIndex ); + TextSegment aResult; + pTextEngine->GetTextPortionRange( aCursor, aResult.SegmentStart, aResult.SegmentEnd ); + return aResult; + } + } + return VCLXAccessibleTextComponent::getTextAtIndex( nIndex, aTextType ); } |