From 99872adcfbcee7bb2e6b2f35c05cb34bb8be76ee Mon Sep 17 00:00:00 2001 From: Arnaud Versini Date: Sun, 12 Nov 2017 18:40:19 +0100 Subject: Remove OAccessibleTextHelper::getCharacter and getTextRange Change-Id: Ib32e3ca6ba55ab99820a54023041247cea96ab0c Reviewed-on: https://gerrit.libreoffice.org/44652 Tested-by: Jenkins Reviewed-by: Noel Grandin --- comphelper/source/misc/accessibletexthelper.cxx | 35 +++++-------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'comphelper/source') 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 ); -- cgit