diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-05-07 14:18:51 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-05-09 00:17:59 +0200 |
commit | 6aef5a1e880262354cf739e461a12a0ef9573fef (patch) | |
tree | c80d02d75206bcfc5acbfd4d0518443071fbb370 /winaccessibility | |
parent | cad788328ec6ef4b3071cf9002dfac12347562da (diff) |
tdf#118418 implement scrollSubstringTo() for Qt & windows
Use new accessibility scroll type compatible with IAccessible2.
Change-Id: I0967d1c56425e1e860db34f4b9c17427e531fe02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93636
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'winaccessibility')
-rw-r--r-- | winaccessibility/source/UAccCOM/AccTextBase.cxx | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx index 6717ce6fed7f..caf3af18b38b 100644 --- a/winaccessibility/source/UAccCOM/AccTextBase.cxx +++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx @@ -28,6 +28,7 @@ #include <vcl/svapp.hxx> #include <o3tl/char16_t2wchar_t.hxx> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/AccessibleTextType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> @@ -895,9 +896,51 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::scrollSubstringToPoint(long, lon return E_NOTIMPL; } -COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::scrollSubstringTo(long, long, IA2ScrollType) +COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::scrollSubstringTo(long startIndex, long endIndex, IA2ScrollType type) { + SolarMutexGuard g; + + ENTER_PROTECTED_BLOCK + + // #CHECK XInterface# + if(!pRXText.is()) + return E_FAIL; + + AccessibleScrollType lUnoType; + + switch(type) + { + case IA2_SCROLL_TYPE_TOP_LEFT: + lUnoType = AccessibleScrollType_SCROLL_TOP_LEFT; + break; + case IA2_SCROLL_TYPE_BOTTOM_RIGHT: + lUnoType = AccessibleScrollType_SCROLL_BOTTOM_RIGHT; + break; + case IA2_SCROLL_TYPE_TOP_EDGE: + lUnoType = AccessibleScrollType_SCROLL_TOP_EDGE; + break; + case IA2_SCROLL_TYPE_BOTTOM_EDGE: + lUnoType = AccessibleScrollType_SCROLL_BOTTOM_EDGE; + break; + case IA2_SCROLL_TYPE_LEFT_EDGE: + lUnoType = AccessibleScrollType_SCROLL_LEFT_EDGE; + break; + case IA2_SCROLL_TYPE_RIGHT_EDGE: + lUnoType = AccessibleScrollType_SCROLL_RIGHT_EDGE; + break; + case IA2_SCROLL_TYPE_ANYWHERE: + lUnoType = AccessibleScrollType_SCROLL_ANYWHERE; + break; + default: + return E_NOTIMPL; + } + + if( GetXInterface()->scrollSubstringTo(startIndex, endIndex, lUnoType) ) + return S_OK; + return E_NOTIMPL; + + LEAVE_PROTECTED_BLOCK } /** |