diff options
author | Arnaud Versini <Arnaud.Versini@libreoffice.org> | 2017-11-12 18:40:19 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-13 07:12:38 +0100 |
commit | 99872adcfbcee7bb2e6b2f35c05cb34bb8be76ee (patch) | |
tree | c643bbd2e6dec95cfd6a44372d769a3a6ce38d77 /accessibility | |
parent | c8c5072a2f20d58807c233a1b62ded406931db78 (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 'accessibility')
14 files changed, 67 insertions, 20 deletions
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 ); |