[Libreoffice-commits] core.git: accessibility/inc accessibility/source comphelper/source editeng/source include/comphelper
Arnaud Versini
Arnaud.Versini at libreoffice.org
Mon Nov 13 06:13:21 UTC 2017
accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx | 2
accessibility/inc/standard/vclxaccessibletabpage.hxx | 3
accessibility/inc/standard/vclxaccessibletoolboxitem.hxx | 2
accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx | 4 -
accessibility/source/extended/AccessibleGridControlTableCell.cxx | 4 -
accessibility/source/extended/accessibleiconchoicectrlentry.cxx | 4 -
accessibility/source/extended/accessiblelistboxentry.cxx | 4 -
accessibility/source/extended/textwindowaccessibility.cxx | 4 -
accessibility/source/standard/vclxaccessiblelistitem.cxx | 4 -
accessibility/source/standard/vclxaccessiblemenuitem.cxx | 4 -
accessibility/source/standard/vclxaccessiblestatusbaritem.cxx | 17 ++++
accessibility/source/standard/vclxaccessibletabpage.cxx | 16 ++++
accessibility/source/standard/vclxaccessibletextcomponent.cxx | 4 -
accessibility/source/standard/vclxaccessibletoolboxitem.cxx | 15 ++++
comphelper/source/misc/accessibletexthelper.cxx | 35 ++--------
editeng/source/accessibility/AccessibleEditableTextPara.cxx | 4 -
include/comphelper/accessibletexthelper.hxx | 9 --
17 files changed, 78 insertions(+), 57 deletions(-)
New commits:
commit 99872adcfbcee7bb2e6b2f35c05cb34bb8be76ee
Author: Arnaud Versini <Arnaud.Versini at libreoffice.org>
Date: Sun Nov 12 18:40:19 2017 +0100
Remove OAccessibleTextHelper::getCharacter and getTextRange
Change-Id: Ib32e3ca6ba55ab99820a54023041247cea96ab0c
Reviewed-on: https://gerrit.libreoffice.org/44652
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx
index 44c63d4c5d39..db008f98897d 100644
--- a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx
+++ b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx
@@ -126,6 +126,8 @@ public:
virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
virtual OUString SAL_CALL getText() override;
virtual sal_Int32 SAL_CALL getCharacterCount() override;
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
+ virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override;
};
diff --git a/accessibility/inc/standard/vclxaccessibletabpage.hxx b/accessibility/inc/standard/vclxaccessibletabpage.hxx
index a116fab701c5..495f4a36412a 100644
--- a/accessibility/inc/standard/vclxaccessibletabpage.hxx
+++ b/accessibility/inc/standard/vclxaccessibletabpage.hxx
@@ -123,6 +123,7 @@ public:
// XAccessibleText
virtual OUString SAL_CALL getText() override;
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
virtual sal_Int32 SAL_CALL getCharacterCount() override;
virtual sal_Int32 SAL_CALL getCaretPosition() override;
virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
@@ -131,7 +132,7 @@ public:
virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
-
+ virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override;
};
#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABPAGE_HXX
diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
index a7f3e940d3a1..010c32a3a9d3 100644
--- a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
+++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
@@ -115,6 +115,7 @@ public:
// XAccessibleText
virtual OUString SAL_CALL getText() override;
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
virtual sal_Int32 SAL_CALL getCharacterCount() override;
virtual sal_Int32 SAL_CALL getCaretPosition() override;
virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
@@ -123,6 +124,7 @@ public:
virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
+ virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
// XAccessibleComponent
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx
index daff8477b051..55f392879752 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx
@@ -229,7 +229,7 @@ namespace accessibility
{
SolarMethodGuard aGuard(getMutex());
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
css::uno::Sequence< css::beans::PropertyValue > SAL_CALL AccessibleBrowseBoxTableCell::getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& )
{
@@ -286,7 +286,7 @@ namespace accessibility
{
SolarMethodGuard aGuard(getMutex());
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
+ return OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
css::accessibility::TextSegment SAL_CALL AccessibleBrowseBoxTableCell::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
index 42709cc5bb4a..f0d726aae6b8 100644
--- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
@@ -236,7 +236,7 @@ namespace accessibility
{
SolarMutexGuard aSolarGuard;
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
css::uno::Sequence< css::beans::PropertyValue > SAL_CALL AccessibleGridControlTableCell::getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& )
{
@@ -293,7 +293,7 @@ namespace accessibility
{
SolarMutexGuard aSolarGuard;
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
+ return OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
css::accessibility::TextSegment SAL_CALL AccessibleGridControlTableCell::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index 3e9c1adf0b9a..b8d07cfd5136 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -536,7 +536,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
css::uno::Sequence< css::beans::PropertyValue > SAL_CALL AccessibleIconChoiceCtrlEntry::getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& )
{
@@ -603,7 +603,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
+ return OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
css::accessibility::TextSegment SAL_CALL AccessibleIconChoiceCtrlEntry::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 2d760b43b987..19e87ea15fa0 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -999,7 +999,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
css::uno::Sequence< css::beans::PropertyValue > SAL_CALL AccessibleListBoxEntry::getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& )
{
@@ -1066,7 +1066,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
+ return OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
css::accessibility::TextSegment SAL_CALL AccessibleListBoxEntry::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index ef69c9bc7045..4a3b61a6bf3f 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -301,7 +301,7 @@ sal_Bool SAL_CALL Paragraph::setCaretPosition(::sal_Int32 nIndex)
::sal_Unicode SAL_CALL Paragraph::getCharacter(::sal_Int32 nIndex)
{
checkDisposed();
- return OCommonAccessibleText::getCharacter(nIndex);
+ return OCommonAccessibleText::implGetCharacter(implGetText(), nIndex);
}
// virtual
@@ -386,7 +386,7 @@ OUString SAL_CALL Paragraph::getTextRange(::sal_Int32 nStartIndex,
::sal_Int32 nEndIndex)
{
checkDisposed();
- return OCommonAccessibleText::getTextRange(nStartIndex, nEndIndex);
+ return OCommonAccessibleText::implGetTextRange(implGetText(), nStartIndex, nEndIndex);
}
// virtual
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx
index ae25d8c8d1b1..6cfe7f82b42c 100644
--- a/accessibility/source/standard/vclxaccessiblelistitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx
@@ -401,7 +401,7 @@ sal_Unicode SAL_CALL VCLXAccessibleListItem::getCharacter( sal_Int32 nIndex )
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( m_sEntryText, nIndex );
}
Sequence< PropertyValue > SAL_CALL VCLXAccessibleListItem::getCharacterAttributes( sal_Int32 nIndex, const Sequence< OUString >& )
@@ -512,7 +512,7 @@ OUString SAL_CALL VCLXAccessibleListItem::getTextRange( sal_Int32 nStartIndex, s
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
+ return OCommonAccessibleText::implGetTextRange( m_sEntryText, nStartIndex, nEndIndex );
}
css::accessibility::TextSegment SAL_CALL VCLXAccessibleListItem::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
index 0de9911c10a1..812add0d491f 100644
--- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
@@ -214,7 +214,7 @@ sal_Unicode VCLXAccessibleMenuItem::getCharacter( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
@@ -329,7 +329,7 @@ OUString VCLXAccessibleMenuItem::getTextRange( sal_Int32 nStartIndex, sal_Int32
{
OExternalLockGuard aGuard( this );
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
+ return OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
index 6e5c285f21e4..a187779020b4 100644
--- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
+++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
@@ -446,6 +446,14 @@ OUString VCLXAccessibleStatusBarItem::getText()
return GetItemText();
}
+OUString VCLXAccessibleStatusBarItem::getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex)
+{
+ OExternalLockGuard aGuard( this );
+
+ return OCommonAccessibleText::implGetTextRange(GetItemText(), nStartIndex, nEndIndex);
+}
+
+
sal_Int32 VCLXAccessibleStatusBarItem::getCharacterCount()
{
OExternalLockGuard aGuard( this );
@@ -453,6 +461,13 @@ sal_Int32 VCLXAccessibleStatusBarItem::getCharacterCount()
return GetItemText().getLength();
}
+sal_Unicode VCLXAccessibleStatusBarItem::getCharacter( sal_Int32 nIndex )
+{
+ OExternalLockGuard aGuard( this );
+
+ return OCommonAccessibleText::implGetCharacter( GetItemText(), nIndex );
+}
+
sal_Int32 VCLXAccessibleStatusBarItem::getCaretPosition()
{
OExternalLockGuard aGuard( this );
@@ -558,7 +573,7 @@ sal_Bool VCLXAccessibleStatusBarItem::copyText( sal_Int32 nStartIndex, sal_Int32
Reference< datatransfer::clipboard::XClipboard > xClipboard = m_pStatusBar->GetClipboard();
if ( xClipboard.is() )
{
- OUString sText( getTextRange( nStartIndex, nEndIndex ) );
+ OUString sText( implGetTextRange( GetItemText(), nStartIndex, nEndIndex ) );
vcl::unohelper::TextDataObject* pDataObj = new vcl::unohelper::TextDataObject( sText );
diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx
index 25e15204b5f3..b7ceddf4fea4 100644
--- a/accessibility/source/standard/vclxaccessibletabpage.cxx
+++ b/accessibility/source/standard/vclxaccessibletabpage.cxx
@@ -524,6 +524,20 @@ OUString VCLXAccessibleTabPage::getText()
return GetPageText();
}
+OUString VCLXAccessibleTabPage::getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex)
+{
+ OExternalLockGuard aGuard( this );
+
+ return OCommonAccessibleText::implGetTextRange(GetPageText(), nStartIndex, nEndIndex);
+}
+
+sal_Unicode VCLXAccessibleTabPage::getCharacter( sal_Int32 nIndex )
+{
+ OExternalLockGuard aGuard( this );
+
+ return OCommonAccessibleText::implGetCharacter( GetPageText(), nIndex );
+}
+
sal_Int32 VCLXAccessibleTabPage::getCharacterCount()
{
return GetPageText().getLength();
@@ -633,7 +647,7 @@ sal_Bool VCLXAccessibleTabPage::copyText( sal_Int32 nStartIndex, sal_Int32 nEndI
Reference< datatransfer::clipboard::XClipboard > xClipboard = m_pTabControl->GetClipboard();
if ( xClipboard.is() )
{
- OUString sText( getTextRange( nStartIndex, nEndIndex ) );
+ OUString sText( implGetTextRange( GetPageText(), nStartIndex, nEndIndex ) );
vcl::unohelper::TextDataObject* pDataObj = new vcl::unohelper::TextDataObject( sText );
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
index d222b2d20848..11ceeacae924 100644
--- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx
+++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
@@ -157,7 +157,7 @@ sal_Unicode VCLXAccessibleTextComponent::getCharacter( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
@@ -319,7 +319,7 @@ OUString VCLXAccessibleTextComponent::getTextRange( sal_Int32 nStartIndex, sal_I
{
OExternalLockGuard aGuard( this );
- return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
+ return OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index cadf10c3f0fc..1c96c9b1ef2d 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -433,6 +433,19 @@ sal_Int32 VCLXAccessibleToolBoxItem::getCharacterCount()
return GetText().getLength();
}
+sal_Unicode VCLXAccessibleToolBoxItem::getCharacter( sal_Int32 nIndex )
+{
+ OExternalLockGuard aGuard( this );
+
+ return OCommonAccessibleText::implGetCharacter( GetText(), nIndex );
+}
+
+OUString VCLXAccessibleToolBoxItem::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
+{
+ OExternalLockGuard aGuard( this );
+
+ return OCommonAccessibleText::implGetTextRange( GetText(), nStartIndex, nEndIndex );
+}
sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getCaretPosition()
{
@@ -525,7 +538,7 @@ sal_Bool SAL_CALL VCLXAccessibleToolBoxItem::copyText( sal_Int32 nStartIndex, sa
Reference< datatransfer::clipboard::XClipboard > xClipboard = m_pToolBox->GetClipboard();
if ( xClipboard.is() )
{
- OUString sText( OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex ) );
+ OUString sText( OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex ) );
vcl::unohelper::TextDataObject* pDataObj = new vcl::unohelper::TextDataObject( sText );
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 );
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index a423246e4069..aa1b476356cb 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1191,7 +1191,7 @@ namespace accessibility
DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
"AccessibleEditableTextPara::getCharacter: index value overflow");
- return OCommonAccessibleText::getCharacter( nIndex );
+ return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
uno::Sequence< beans::PropertyValue > SAL_CALL AccessibleEditableTextPara::getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& rRequestedAttributes )
@@ -1463,7 +1463,7 @@ namespace accessibility
DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
"AccessibleEditableTextPara::getTextRange: paragraph index value overflow");
- return OCommonAccessibleText::getTextRange(nStartIndex, nEndIndex);
+ return OCommonAccessibleText::implGetTextRange(implGetText(), nStartIndex, nEndIndex);
}
void AccessibleEditableTextPara::_correctValues( uno::Sequence< PropertyValue >& rValues)
diff --git a/include/comphelper/accessibletexthelper.hxx b/include/comphelper/accessibletexthelper.hxx
index 95ca38cf5673..e522448132cd 100644
--- a/include/comphelper/accessibletexthelper.hxx
+++ b/include/comphelper/accessibletexthelper.hxx
@@ -53,6 +53,8 @@ namespace comphelper
static bool implIsValidBoundary( css::i18n::Boundary const & rBoundary, sal_Int32 nLength );
static bool implIsValidIndex( sal_Int32 nIndex, sal_Int32 nLength );
static bool implIsValidRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex, sal_Int32 nLength );
+ static sal_Unicode implGetCharacter( const OUString& rText, sal_Int32 nIndex );
+ static OUString implGetTextRange( const OUString& rTest, sal_Int32 nStartIndex, sal_Int32 nEndIndex );
virtual OUString implGetText() = 0;
virtual css::lang::Locale implGetLocale() = 0;
virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) = 0;
@@ -67,17 +69,12 @@ namespace comphelper
@throws css::lang::IndexOutOfBoundsException
@throws css::uno::RuntimeException
*/
- sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex );
- /// @throws css::uno::RuntimeException
OUString SAL_CALL getSelectedText();
/// @throws css::uno::RuntimeException
sal_Int32 SAL_CALL getSelectionStart();
/// @throws css::uno::RuntimeException
sal_Int32 SAL_CALL getSelectionEnd();
/// @throws css::lang::IndexOutOfBoundsException
- /// @throws css::uno::RuntimeException
- OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex );
- /// @throws css::lang::IndexOutOfBoundsException
/// @throws css::lang::IllegalArgumentException
/// @throws css::uno::RuntimeException
css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType );
@@ -134,11 +131,9 @@ namespace comphelper
DECLARE_XTYPEPROVIDER( )
// XAccessibleText
- virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) 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 getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
More information about the Libreoffice-commits
mailing list