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
, css::accessibility::XAccessible
> AccessibleTextHelper_BASE;
// implementation of a table cell of GridControl
class AccessibleGridControlTableCell :public AccessibleGridControlCell
class AccessibleGridControlTableCell final :public AccessibleGridControlCell
,public AccessibleTextHelper_BASE
,public ::comphelper::OCommonAccessibleText
{
protected:
private:
// OCommonAccessibleText
virtual OUString implGetText() 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 implGetBoundingBoxOnScreen() override;
......
......@@ -92,7 +92,7 @@ namespace accessibility
// OCommonAccessibleText
virtual OUString implGetText() 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:
/** Ctor()
......
......@@ -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
*/
class VCLXAccessibleListItem final : public ::cppu::BaseMutex,
public ::comphelper::OCommonAccessibleText,
public VCLXAccessibleListItem_BASE
public ::comphelper::OCommonAccessibleText,
public VCLXAccessibleListItem_BASE
{
private:
OUString m_sEntryText;
......
......@@ -53,7 +53,7 @@ protected:
// OCommonAccessibleText
virtual OUString implGetText() final 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:
VCLXAccessibleMenuItem( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr );
......@@ -79,9 +79,9 @@ public:
virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
virtual sal_Int32 SAL_CALL getCharacterCount() final override;
virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
virtual OUString SAL_CALL getSelectedText() override;
virtual sal_Int32 SAL_CALL getSelectionStart() override;
virtual sal_Int32 SAL_CALL getSelectionEnd() override;
virtual OUString SAL_CALL getSelectedText() override final;
virtual sal_Int32 SAL_CALL getSelectionStart() override final;
virtual sal_Int32 SAL_CALL getSelectionEnd() override final;
virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
virtual OUString SAL_CALL getText() final override;
virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
......
......@@ -253,19 +253,19 @@ namespace accessibility
{
SolarMutexGuard aSolarGuard;
return OCommonAccessibleText::getSelectedText( );
return OUString();
}
sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionStart( )
{
SolarMutexGuard aSolarGuard;
return OCommonAccessibleText::getSelectionStart( );
return 0;
}
sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionEnd( )
{
SolarMutexGuard aSolarGuard;
return OCommonAccessibleText::getSelectionEnd( );
return 0;
}
sal_Bool SAL_CALL AccessibleGridControlTableCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
......
......@@ -564,21 +564,21 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
return OCommonAccessibleText::getSelectedText( );
return OUString();
}
sal_Int32 SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectionStart( )
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
return OCommonAccessibleText::getSelectionStart( );
return 0;
}
sal_Int32 SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectionEnd( )
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
return OCommonAccessibleText::getSelectionEnd( );
return 0;
}
sal_Bool SAL_CALL AccessibleIconChoiceCtrlEntry::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
......
......@@ -1026,21 +1026,21 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
return OCommonAccessibleText::getSelectedText( );
return OUString();
}
sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionStart( )
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
return OCommonAccessibleText::getSelectionStart( );
return 0;
}
sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionEnd( )
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
return OCommonAccessibleText::getSelectionEnd( );
return 0;
}
sal_Bool SAL_CALL AccessibleListBoxEntry::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
......
......@@ -465,7 +465,7 @@ OUString SAL_CALL VCLXAccessibleListItem::getSelectedText()
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
return OCommonAccessibleText::getSelectedText();
return OUString();
}
sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionStart()
......@@ -473,7 +473,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionStart()
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
return OCommonAccessibleText::getSelectionStart();
return 0;
}
sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionEnd()
......@@ -481,7 +481,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getSelectionEnd()
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
return OCommonAccessibleText::getSelectionEnd();
return 0;
}
sal_Bool SAL_CALL VCLXAccessibleListItem::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
......
......@@ -281,7 +281,7 @@ OUString VCLXAccessibleMenuItem::getSelectedText()
{
OExternalLockGuard aGuard( this );
return OCommonAccessibleText::getSelectedText();
return OUString();
}
......@@ -289,7 +289,7 @@ sal_Int32 VCLXAccessibleMenuItem::getSelectionStart()
{
OExternalLockGuard aGuard( this );
return OCommonAccessibleText::getSelectionStart();
return 0;
}
......@@ -297,7 +297,7 @@ sal_Int32 VCLXAccessibleMenuItem::getSelectionEnd()
{
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