summaryrefslogtreecommitdiff
path: root/accessibility/source
diff options
context:
space:
mode:
authorArnaud Versini <Arnaud.Versini@libreoffice.org>2017-11-12 14:23:52 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-13 07:09:02 +0100
commit8d4a44d176fc7e80d6c5f13b1e73069967b9593b (patch)
treed84e75d33d6c2a157142450cb8fc3a0bacd6a55a /accessibility/source
parent102acb3675fed4e4e61a98722e279b9d8bc18ad2 (diff)
Remove OCommonAccessibleText::getText and getCharacterCount.
No need to create helper for those methods. Change-Id: I0505fe8141b1bad852b7f30aeb69628fb6a90071 Reviewed-on: https://gerrit.libreoffice.org/44649 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'accessibility/source')
-rw-r--r--accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx2
-rw-r--r--accessibility/source/extended/AccessibleGridControlTableCell.cxx2
-rw-r--r--accessibility/source/extended/accessibleiconchoicectrlentry.cxx7
-rw-r--r--accessibility/source/extended/accessiblelistboxentry.cxx4
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx8
-rw-r--r--accessibility/source/standard/vclxaccessiblelistitem.cxx16
-rw-r--r--accessibility/source/standard/vclxaccessiblemenuitem.cxx14
-rw-r--r--accessibility/source/standard/vclxaccessiblestatusbaritem.cxx15
-rw-r--r--accessibility/source/standard/vclxaccessibletabpage.cxx19
-rw-r--r--accessibility/source/standard/vclxaccessibletextcomponent.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibletoolboxitem.cxx15
11 files changed, 68 insertions, 36 deletions
diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx
index 0ac264bfbd6c..daff8477b051 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx
@@ -246,7 +246,7 @@ namespace accessibility
{
SolarMethodGuard aGuard(getMutex());
- return OCommonAccessibleText::getCharacterCount( );
+ return implGetText().getLength();
}
OUString SAL_CALL AccessibleBrowseBoxTableCell::getSelectedText( )
diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
index 71f378492c0b..42709cc5bb4a 100644
--- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
@@ -253,7 +253,7 @@ namespace accessibility
{
SolarMutexGuard aSolarGuard;
- return OCommonAccessibleText::getCharacterCount( );
+ return implGetText().getLength();
}
OUString SAL_CALL AccessibleGridControlTableCell::getSelectedText( )
diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index 0c0c859c3741..3e9c1adf0b9a 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -422,7 +422,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- if ( ( 0 > _nIndex ) || ( getCharacterCount() <= _nIndex ) )
+ if ( ( 0 > _nIndex ) || ( implGetText().getLength() <= _nIndex ) )
throw IndexOutOfBoundsException();
awt::Rectangle aBounds( 0, 0, 0, 0 );
@@ -470,8 +470,9 @@ namespace accessibility
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
+ EnsureIsAlive();
- OUString sText = getText();
+ OUString sText = implGetText();
if ( ( 0 > nStartIndex ) || ( sText.getLength() <= nStartIndex )
|| ( 0 > nEndIndex ) || ( sText.getLength() <= nEndIndex ) )
throw IndexOutOfBoundsException();
@@ -555,7 +556,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return OCommonAccessibleText::getCharacterCount( );
+ return implGetText().getLength();;
}
OUString SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectedText( )
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 04de08a958cf..2d760b43b987 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -686,7 +686,7 @@ namespace accessibility
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- OUString sText = getText();
+ OUString sText = implGetText();
if ( ( 0 > nStartIndex ) || ( sText.getLength() <= nStartIndex )
|| ( 0 > nEndIndex ) || ( sText.getLength() <= nEndIndex ) )
throw IndexOutOfBoundsException();
@@ -1019,7 +1019,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return OCommonAccessibleText::getCharacterCount( );
+ return implGetText().getLength();
}
OUString SAL_CALL AccessibleListBoxEntry::getSelectedText( )
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 3a1d4860292d..ef69c9bc7045 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -328,7 +328,7 @@ Paragraph::getCharacterBounds(::sal_Int32 nIndex)
::sal_Int32 SAL_CALL Paragraph::getCharacterCount()
{
checkDisposed();
- return OCommonAccessibleText::getCharacterCount();
+ return implGetText().getLength();;
}
// virtual
@@ -637,8 +637,7 @@ void Paragraph::implGetSelection(::sal_Int32 & rStartIndex,
void Paragraph::implGetParagraphBoundary( css::i18n::Boundary& rBoundary,
::sal_Int32 nIndex )
{
- OUString sText( implGetText() );
- ::sal_Int32 nLength = sText.getLength();
+ ::sal_Int32 nLength = implGetText().getLength();
if ( implIsValidIndex( nIndex, nLength ) )
{
@@ -656,8 +655,7 @@ void Paragraph::implGetParagraphBoundary( css::i18n::Boundary& rBoundary,
void Paragraph::implGetLineBoundary( css::i18n::Boundary& rBoundary,
::sal_Int32 nIndex )
{
- OUString sText( implGetText() );
- ::sal_Int32 nLength = sText.getLength();
+ ::sal_Int32 nLength = implGetText().getLength();
if ( implIsValidIndex( nIndex, nLength ) || nIndex == nLength )
{
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx
index 68be49dfe4ef..ae25d8c8d1b1 100644
--- a/accessibility/source/standard/vclxaccessiblelistitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx
@@ -242,7 +242,7 @@ OUString SAL_CALL VCLXAccessibleListItem::getAccessibleName( )
::osl::MutexGuard aGuard( m_aMutex );
// entry text == accessible name
- return implGetText();
+ return m_sEntryText;
}
Reference< XAccessibleRelationSet > SAL_CALL VCLXAccessibleListItem::getAccessibleRelationSet( )
@@ -390,7 +390,7 @@ sal_Bool SAL_CALL VCLXAccessibleListItem::setCaretPosition( sal_Int32 nIndex )
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nIndex, nIndex, m_sEntryText.getLength() ) )
throw IndexOutOfBoundsException();
return false;
@@ -409,8 +409,7 @@ Sequence< PropertyValue > SAL_CALL VCLXAccessibleListItem::getCharacterAttribute
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- OUString sText( implGetText() );
- if ( !implIsValidIndex( nIndex, sText.getLength() ) )
+ if ( !implIsValidIndex( nIndex, m_sEntryText.getLength() ) )
throw IndexOutOfBoundsException();
return Sequence< PropertyValue >();
@@ -421,8 +420,7 @@ awt::Rectangle SAL_CALL VCLXAccessibleListItem::getCharacterBounds( sal_Int32 nI
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- OUString sText( implGetText() );
- if ( !implIsValidIndex( nIndex, sText.getLength() ) )
+ if ( !implIsValidIndex( nIndex, m_sEntryText.getLength() ) )
throw IndexOutOfBoundsException();
awt::Rectangle aBounds( 0, 0, 0, 0 );
@@ -443,7 +441,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getCharacterCount()
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- return OCommonAccessibleText::getCharacterCount();
+ return m_sEntryText.getLength();
}
sal_Int32 SAL_CALL VCLXAccessibleListItem::getIndexAtPoint( const awt::Point& aPoint )
@@ -495,7 +493,7 @@ sal_Bool SAL_CALL VCLXAccessibleListItem::setSelection( sal_Int32 nStartIndex, s
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nStartIndex, nEndIndex, m_sEntryText.getLength() ) )
throw IndexOutOfBoundsException();
return false;
@@ -506,7 +504,7 @@ OUString SAL_CALL VCLXAccessibleListItem::getText()
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- return implGetText();
+ return m_sEntryText;
}
OUString SAL_CALL VCLXAccessibleListItem::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
index 2c6eb138f6eb..0de9911c10a1 100644
--- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
@@ -203,7 +203,7 @@ sal_Bool VCLXAccessibleMenuItem::setCaretPosition( sal_Int32 nIndex )
OExternalLockGuard aGuard( this );
- if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nIndex, nIndex, m_sItemText.getLength() ) )
throw IndexOutOfBoundsException();
return false;
@@ -222,9 +222,7 @@ Sequence< PropertyValue > VCLXAccessibleMenuItem::getCharacterAttributes( sal_In
{
OExternalLockGuard aGuard( this );
- OUString sText( implGetText() );
-
- if ( !implIsValidIndex( nIndex, sText.getLength() ) )
+ if ( !implIsValidIndex( nIndex, m_sItemText.getLength() ) )
throw IndexOutOfBoundsException();
vcl::Font aFont = Application::GetSettings().GetStyleSettings().GetMenuFont();
@@ -239,7 +237,7 @@ awt::Rectangle VCLXAccessibleMenuItem::getCharacterBounds( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
- if ( !implIsValidIndex( nIndex, implGetText().getLength() ) )
+ if ( !implIsValidIndex( nIndex, m_sItemText.getLength() ) )
throw IndexOutOfBoundsException();
awt::Rectangle aBounds( 0, 0, 0, 0 );
@@ -260,7 +258,7 @@ sal_Int32 VCLXAccessibleMenuItem::getCharacterCount()
{
OExternalLockGuard aGuard( this );
- return OCommonAccessibleText::getCharacterCount();
+ return m_sItemText.getLength();
}
@@ -312,7 +310,7 @@ sal_Bool VCLXAccessibleMenuItem::setSelection( sal_Int32 nStartIndex, sal_Int32
{
OExternalLockGuard aGuard( this );
- if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nStartIndex, nEndIndex, m_sItemText.getLength() ) )
throw IndexOutOfBoundsException();
return false;
@@ -323,7 +321,7 @@ OUString VCLXAccessibleMenuItem::getText()
{
OExternalLockGuard aGuard( this );
- return implGetText();
+ return m_sItemText;
}
diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
index 7b0ce47daa84..6e5c285f21e4 100644
--- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
+++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
@@ -439,6 +439,19 @@ OUString VCLXAccessibleStatusBarItem::getToolTipText( )
// XAccessibleText
+OUString VCLXAccessibleStatusBarItem::getText()
+{
+ OExternalLockGuard aGuard( this );
+
+ return GetItemText();
+}
+
+sal_Int32 VCLXAccessibleStatusBarItem::getCharacterCount()
+{
+ OExternalLockGuard aGuard( this );
+
+ return GetItemText().getLength();
+}
sal_Int32 VCLXAccessibleStatusBarItem::getCaretPosition()
{
@@ -452,7 +465,7 @@ sal_Bool VCLXAccessibleStatusBarItem::setCaretPosition( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
- if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nIndex, nIndex, GetItemText().getLength() ) )
throw IndexOutOfBoundsException();
return false;
diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx
index 8fc4030209f8..25e15204b5f3 100644
--- a/accessibility/source/standard/vclxaccessibletabpage.cxx
+++ b/accessibility/source/standard/vclxaccessibletabpage.cxx
@@ -517,6 +517,17 @@ OUString VCLXAccessibleTabPage::getToolTipText( )
// XAccessibleText
+OUString VCLXAccessibleTabPage::getText()
+{
+ OExternalLockGuard aGuard( this );
+
+ return GetPageText();
+}
+
+sal_Int32 VCLXAccessibleTabPage::getCharacterCount()
+{
+ return GetPageText().getLength();
+}
sal_Int32 VCLXAccessibleTabPage::getCaretPosition()
{
@@ -530,7 +541,7 @@ sal_Bool VCLXAccessibleTabPage::setCaretPosition( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
- if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nIndex, nIndex, GetPageText().getLength() ) )
throw IndexOutOfBoundsException();
return false;
@@ -542,7 +553,7 @@ Sequence< PropertyValue > VCLXAccessibleTabPage::getCharacterAttributes( sal_Int
OExternalLockGuard aGuard( this );
Sequence< PropertyValue > aValues;
- OUString sText( implGetText() );
+ OUString sText( GetPageText() );
if ( !implIsValidIndex( nIndex, sText.getLength() ) )
throw IndexOutOfBoundsException();
@@ -564,7 +575,7 @@ awt::Rectangle VCLXAccessibleTabPage::getCharacterBounds( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
- if ( !implIsValidIndex( nIndex, implGetText().getLength() ) )
+ if ( !implIsValidIndex( nIndex, GetPageText().getLength() ) )
throw IndexOutOfBoundsException();
awt::Rectangle aBounds( 0, 0, 0, 0 );
@@ -604,7 +615,7 @@ sal_Bool VCLXAccessibleTabPage::setSelection( sal_Int32 nStartIndex, sal_Int32 n
{
OExternalLockGuard aGuard( this );
- if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nStartIndex, nEndIndex, GetPageText().getLength() ) )
throw IndexOutOfBoundsException();
return false;
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
index 08a84c35db37..d222b2d20848 100644
--- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx
+++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
@@ -255,7 +255,7 @@ sal_Int32 VCLXAccessibleTextComponent::getCharacterCount()
{
OExternalLockGuard aGuard( this );
- return OCommonAccessibleText::getCharacterCount();
+ return implGetText().getLength();;
}
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index 52a64acc05a2..cadf10c3f0fc 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -421,6 +421,19 @@ Reference< XAccessibleStateSet > SAL_CALL VCLXAccessibleToolBoxItem::getAccessib
// XAccessibleText
+OUString VCLXAccessibleToolBoxItem::getText()
+{
+ OExternalLockGuard aGuard( this );
+
+ return GetText();
+}
+
+sal_Int32 VCLXAccessibleToolBoxItem::getCharacterCount()
+{
+ return GetText().getLength();
+}
+
+
sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getCaretPosition()
{
return -1;
@@ -430,7 +443,7 @@ sal_Bool SAL_CALL VCLXAccessibleToolBoxItem::setCaretPosition( sal_Int32 nIndex
{
OExternalLockGuard aGuard( this );
- if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
+ if ( !implIsValidRange( nIndex, nIndex, GetText().getLength() ) )
throw IndexOutOfBoundsException();
return false;