summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorArnaud Versini <Arnaud.Versini@libreoffice.org>2017-11-12 18:40:19 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-13 07:12:38 +0100
commit99872adcfbcee7bb2e6b2f35c05cb34bb8be76ee (patch)
treec643bbd2e6dec95cfd6a44372d769a3a6ce38d77 /comphelper
parentc8c5072a2f20d58807c233a1b62ded406931db78 (diff)
Remove OAccessibleTextHelper::getCharacter and getTextRange
Change-Id: Ib32e3ca6ba55ab99820a54023041247cea96ab0c Reviewed-on: https://gerrit.libreoffice.org/44652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/accessibletexthelper.cxx35
1 files changed, 7 insertions, 28 deletions
diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx
index 38ad66679b1b..9f1cccea85ba 100644
--- a/comphelper/source/misc/accessibletexthelper.cxx
+++ b/comphelper/source/misc/accessibletexthelper.cxx
@@ -223,17 +223,14 @@ namespace comphelper
}
- sal_Unicode OCommonAccessibleText::getCharacter( sal_Int32 nIndex )
+ sal_Unicode OCommonAccessibleText::implGetCharacter( const OUString& rText, sal_Int32 nIndex )
{
- OUString sText( implGetText() );
-
- if ( !implIsValidIndex( nIndex, sText.getLength() ) )
+ if ( !implIsValidIndex( nIndex, rText.getLength() ) )
throw IndexOutOfBoundsException();
- return sText[nIndex];
+ return rText[nIndex];
}
-
OUString OCommonAccessibleText::getSelectedText()
{
OUString sText;
@@ -244,7 +241,7 @@ namespace comphelper
try
{
- sText = getTextRange( nStartIndex, nEndIndex );
+ sText = implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
catch ( IndexOutOfBoundsException& )
{
@@ -276,20 +273,18 @@ namespace comphelper
}
- OUString OCommonAccessibleText::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
+ OUString OCommonAccessibleText::implGetTextRange( const OUString& rText, sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
- OUString sText( implGetText() );
- if ( !implIsValidRange( nStartIndex, nEndIndex, sText.getLength() ) )
+ if ( !implIsValidRange( nStartIndex, nEndIndex, rText.getLength() ) )
throw IndexOutOfBoundsException();
sal_Int32 nMinIndex = std::min( nStartIndex, nEndIndex );
sal_Int32 nMaxIndex = std::max( nStartIndex, nEndIndex );
- return sText.copy( nMinIndex, nMaxIndex - nMinIndex );
+ return rText.copy( nMinIndex, nMaxIndex - nMinIndex );
}
-
TextSegment OCommonAccessibleText::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
OUString sText( implGetText() );
@@ -760,14 +755,6 @@ namespace comphelper
// XAccessibleText
- sal_Unicode OAccessibleTextHelper::getCharacter( sal_Int32 nIndex )
- {
- OExternalLockGuard aGuard( this );
-
- return OCommonAccessibleText::getCharacter( nIndex );
- }
-
-
OUString OAccessibleTextHelper::getSelectedText()
{
OExternalLockGuard aGuard( this );
@@ -792,14 +779,6 @@ namespace comphelper
}
- OUString OAccessibleTextHelper::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
- {
- OExternalLockGuard aGuard( this );
-
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
- }
-
-
TextSegment OAccessibleTextHelper::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
OExternalLockGuard aGuard( this );