Kaydet (Commit) c409fd2e authored tarafından Arnaud Versini's avatar Arnaud Versini Kaydeden (comit) Noel Grandin

accessibility: simplify getSelection when possible

Change-Id: I187716bca329da0aeae9fec9f48a45a9df386130
Reviewed-on: https://gerrit.libreoffice.org/50688Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 775b1286
...@@ -60,15 +60,15 @@ namespace accessibility ...@@ -60,15 +60,15 @@ namespace accessibility
, css::accessibility::XAccessible , css::accessibility::XAccessible
> AccessibleTextHelper_BASE; > AccessibleTextHelper_BASE;
// implementation of a table cell of GridControl // implementation of a table cell of GridControl
class AccessibleGridControlTableCell :public AccessibleGridControlCell class AccessibleGridControlTableCell final :public AccessibleGridControlCell
,public AccessibleTextHelper_BASE ,public AccessibleTextHelper_BASE
,public ::comphelper::OCommonAccessibleText ,public ::comphelper::OCommonAccessibleText
{ {
protected: private:
// OCommonAccessibleText // OCommonAccessibleText
virtual OUString implGetText() override; virtual OUString implGetText() override;
virtual css::lang::Locale implGetLocale() override; virtual css::lang::Locale implGetLocale() override;
virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override final;
virtual tools::Rectangle implGetBoundingBox() override; virtual tools::Rectangle implGetBoundingBox() override;
virtual tools::Rectangle implGetBoundingBoxOnScreen() override; virtual tools::Rectangle implGetBoundingBoxOnScreen() override;
......
...@@ -92,7 +92,7 @@ namespace accessibility ...@@ -92,7 +92,7 @@ namespace accessibility
// OCommonAccessibleText // OCommonAccessibleText
virtual OUString implGetText() override; virtual OUString implGetText() override;
virtual css::lang::Locale implGetLocale() override; virtual css::lang::Locale implGetLocale() override;
virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override final;
public: public:
/** Ctor() /** Ctor()
......
...@@ -53,8 +53,8 @@ typedef ::cppu::WeakAggComponentImplHelper6< css::accessibility::XAccessible ...@@ -53,8 +53,8 @@ typedef ::cppu::WeakAggComponentImplHelper6< css::accessibility::XAccessible
/** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry /** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry
*/ */
class VCLXAccessibleListItem final : public ::cppu::BaseMutex, class VCLXAccessibleListItem final : public ::cppu::BaseMutex,
public ::comphelper::OCommonAccessibleText, public ::comphelper::OCommonAccessibleText,
public VCLXAccessibleListItem_BASE public VCLXAccessibleListItem_BASE
{ {
private: private:
OUString m_sEntryText; OUString m_sEntryText;
......
...@@ -53,7 +53,7 @@ protected: ...@@ -53,7 +53,7 @@ protected:
// OCommonAccessibleText // OCommonAccessibleText
virtual OUString implGetText() final override; virtual OUString implGetText() final override;
virtual css::lang::Locale implGetLocale() override; virtual css::lang::Locale implGetLocale() override;
virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override final;
public: public:
VCLXAccessibleMenuItem( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr ); VCLXAccessibleMenuItem( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr );
...@@ -79,9 +79,9 @@ public: ...@@ -79,9 +79,9 @@ public:
virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override; virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
virtual sal_Int32 SAL_CALL getCharacterCount() final override; virtual sal_Int32 SAL_CALL getCharacterCount() final override;
virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override; virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
virtual OUString SAL_CALL getSelectedText() override; virtual OUString SAL_CALL getSelectedText() override final;
virtual sal_Int32 SAL_CALL getSelectionStart() override; virtual sal_Int32 SAL_CALL getSelectionStart() override final;
virtual sal_Int32 SAL_CALL getSelectionEnd() override; virtual sal_Int32 SAL_CALL getSelectionEnd() override final;
virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
virtual OUString SAL_CALL getText() final override; virtual OUString SAL_CALL getText() final override;
virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
......
...@@ -253,19 +253,19 @@ namespace accessibility ...@@ -253,19 +253,19 @@ namespace accessibility
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
return OCommonAccessibleText::getSelectedText( ); return OUString();
} }
sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionStart( ) sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionStart( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
return OCommonAccessibleText::getSelectionStart( ); return 0;
} }
sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionEnd( ) sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionEnd( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
return OCommonAccessibleText::getSelectionEnd( ); return 0;
} }
sal_Bool SAL_CALL AccessibleGridControlTableCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) sal_Bool SAL_CALL AccessibleGridControlTableCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{ {
......
...@@ -564,21 +564,21 @@ namespace accessibility ...@@ -564,21 +564,21 @@ namespace accessibility
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive(); EnsureIsAlive();
return OCommonAccessibleText::getSelectedText( ); return OUString();
} }
sal_Int32 SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectionStart( ) sal_Int32 SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectionStart( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive(); EnsureIsAlive();
return OCommonAccessibleText::getSelectionStart( ); return 0;
} }
sal_Int32 SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectionEnd( ) sal_Int32 SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectionEnd( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive(); EnsureIsAlive();
return OCommonAccessibleText::getSelectionEnd( ); return 0;
} }
sal_Bool SAL_CALL AccessibleIconChoiceCtrlEntry::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) sal_Bool SAL_CALL AccessibleIconChoiceCtrlEntry::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{ {
......
...@@ -1026,21 +1026,21 @@ namespace accessibility ...@@ -1026,21 +1026,21 @@ namespace accessibility
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive(); EnsureIsAlive();
return OCommonAccessibleText::getSelectedText( ); return OUString();
} }
sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionStart( ) sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionStart( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive(); EnsureIsAlive();
return OCommonAccessibleText::getSelectionStart( ); return 0;
} }
sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionEnd( ) sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionEnd( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive(); EnsureIsAlive();
return OCommonAccessibleText::getSelectionEnd( ); return 0;
} }
sal_Bool SAL_CALL AccessibleListBoxEntry::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) sal_Bool SAL_CALL AccessibleListBoxEntry::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{ {
......
...@@ -465,7 +465,7 @@ OUString SAL_CALL VCLXAccessibleListItem::getSelectedText() ...@@ -465,7 +465,7 @@ OUString SAL_CALL VCLXAccessibleListItem::getSelectedText()
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
return OCommonAccessibleText::getSelectedText(); return OUString();
} }
sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionStart() sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionStart()
...@@ -473,7 +473,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionStart() ...@@ -473,7 +473,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionStart()
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
return OCommonAccessibleText::getSelectionStart(); return 0;
} }
sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionEnd() sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionEnd()
...@@ -481,7 +481,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionEnd() ...@@ -481,7 +481,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionEnd()
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
return OCommonAccessibleText::getSelectionEnd(); return 0;
} }
sal_Bool SAL_CALL VCLXAccessibleListItem::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) sal_Bool SAL_CALL VCLXAccessibleListItem::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
......
...@@ -281,7 +281,7 @@ OUString VCLXAccessibleMenuItem::getSelectedText() ...@@ -281,7 +281,7 @@ OUString VCLXAccessibleMenuItem::getSelectedText()
{ {
OExternalLockGuard aGuard( this ); OExternalLockGuard aGuard( this );
return OCommonAccessibleText::getSelectedText(); return OUString();
} }
...@@ -289,7 +289,7 @@ sal_Int32 VCLXAccessibleMenuItem::getSelectionStart() ...@@ -289,7 +289,7 @@ sal_Int32 VCLXAccessibleMenuItem::getSelectionStart()
{ {
OExternalLockGuard aGuard( this ); OExternalLockGuard aGuard( this );
return OCommonAccessibleText::getSelectionStart(); return 0;
} }
...@@ -297,7 +297,7 @@ sal_Int32 VCLXAccessibleMenuItem::getSelectionEnd() ...@@ -297,7 +297,7 @@ sal_Int32 VCLXAccessibleMenuItem::getSelectionEnd()
{ {
OExternalLockGuard aGuard( this ); OExternalLockGuard aGuard( this );
return OCommonAccessibleText::getSelectionEnd(); return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment