diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-10-01 12:37:25 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-10-02 12:22:25 +0200 |
commit | 1019fc891964b97c1d43e7113a7d64e5d8d56084 (patch) | |
tree | 493859eccd06317e24eef56eb9f03c4cd17d656c /winaccessibility/source | |
parent | 0e204fa43128b98e3331f306648ae5eb5af862a2 (diff) |
Move GetkeyBindingStrByXkeyBinding to comphelper
So that it is available to other a11y implementations as well
Change-Id: Ib82c4861cf9e0e90c64703b13c46548a080ffd10
Reviewed-on: https://gerrit.libreoffice.org/61198
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'winaccessibility/source')
-rw-r--r-- | winaccessibility/source/UAccCOM/AccActionBase.cxx | 21 | ||||
-rw-r--r-- | winaccessibility/source/UAccCOM/AccActionBase.h | 2 | ||||
-rw-r--r-- | winaccessibility/source/UAccCOM/MAccessible.cxx | 3 |
3 files changed, 5 insertions, 21 deletions
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx index 660e084edf81..514824cd4bdc 100644 --- a/winaccessibility/source/UAccCOM/AccActionBase.cxx +++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx @@ -30,6 +30,7 @@ #include <vcl/svapp.hxx> #include <o3tl/char16_t2wchar_t.hxx> +#include <comphelper/AccessibleImplementationHelper.hxx> #include "AccessibleKeyStroke.h" @@ -175,7 +176,8 @@ STDMETHODIMP CAccActionBase::get_keyBinding( for( int index = 0;index < nCount;index++ ) { - auto const wString = GetkeyBindingStrByXkeyBinding( binding.get()->getAccessibleKeyBinding(index) ); + auto const wString = comphelper::GetkeyBindingStrByXkeyBinding( + binding.get()->getAccessibleKeyBinding(index)); (*keyBinding)[index] = SysAllocString(o3tl::toW(wString.getStr())); } @@ -216,21 +218,4 @@ STDMETHODIMP CAccActionBase::put_XInterface(hyper pXInterface) LEAVE_PROTECTED_BLOCK } -/** - * Helper function used for converting keybinding to string. - * - * @param keySet the key stroke sequence. - */ -OUString CAccActionBase::GetkeyBindingStrByXkeyBinding( const Sequence< KeyStroke > &keySet ) -{ - OUStringBuffer buf; - for( int iIndex = 0;iIndex < keySet.getLength();iIndex++ ) - { - KeyStroke stroke = keySet[iIndex]; - buf.append('\n'); - buf.append(stroke.KeyChar); - } - return buf.makeStringAndClear(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/UAccCOM/AccActionBase.h b/winaccessibility/source/UAccCOM/AccActionBase.h index 56a4980842d8..e804c3a14945 100644 --- a/winaccessibility/source/UAccCOM/AccActionBase.h +++ b/winaccessibility/source/UAccCOM/AccActionBase.h @@ -64,8 +64,6 @@ public: // Override of IUNOXWrapper. STDMETHOD(put_XInterface)(hyper pXInterface) override; - static OUString GetkeyBindingStrByXkeyBinding( const css::uno::Sequence< css::awt::KeyStroke > &keySet ); - protected: css::uno::Reference<css::accessibility::XAccessibleAction> pRXAct; diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 9ec187480861..1f6e36531d17 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -45,6 +45,7 @@ #include <vcl/svapp.hxx> #include <o3tl/char16_t2wchar_t.hxx> +#include <comphelper/AccessibleImplementationHelper.hxx> #include <com/sun/star/accessibility/XAccessibleText.hpp> #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> @@ -650,7 +651,7 @@ STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKe long nCount = binding->getAccessibleKeyBindingCount(); if(nCount >= 1) { - wString = CAccAction::GetkeyBindingStrByXkeyBinding( binding->getAccessibleKeyBinding(0) ); + wString = comphelper::GetkeyBindingStrByXkeyBinding( binding->getAccessibleKeyBinding(0) ); } } } |