Kaydet (Commit) 43d8bf8b authored tarafından Arnaud Versini's avatar Arnaud Versini Kaydeden (comit) Arnaud Versini

accessibility : move ensureIsAlive outside of implGetText and implGetLocale

Change-Id: Ib52a19045cde1b6d9d3f3b5d76c5c59d162a3fa6
Reviewed-on: https://gerrit.libreoffice.org/57153
Tested-by: Jenkins
Reviewed-by: 's avatarArnaud Versini <arnaud.versini@libreoffice.org>
üst d7ab10b6
......@@ -50,13 +50,11 @@ namespace accessibility
// implementation of a table cell
OUString AccessibleBrowseBoxTableCell::implGetText()
{
ensureIsAlive();
return mpBrowseBox->GetAccessibleCellText( getRowPos(), static_cast< sal_uInt16 >( getColumnPos() ) );
}
css::lang::Locale AccessibleBrowseBoxTableCell::implGetLocale()
{
ensureIsAlive();
return mpBrowseBox->GetAccessible()->getAccessibleContext()->getLocale();
}
......@@ -219,6 +217,7 @@ namespace accessibility
sal_Bool SAL_CALL AccessibleBrowseBoxTableCell::setCaretPosition ( sal_Int32 nIndex )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
throw IndexOutOfBoundsException();
......@@ -228,12 +227,14 @@ namespace accessibility
sal_Unicode SAL_CALL AccessibleBrowseBoxTableCell::getCharacter( sal_Int32 nIndex )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex );
}
css::uno::Sequence< css::beans::PropertyValue > SAL_CALL AccessibleBrowseBoxTableCell::getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
OUString sText( implGetText() );
......@@ -245,6 +246,7 @@ namespace accessibility
sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getCharacterCount( )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return implGetText().getLength();
}
......@@ -252,24 +254,28 @@ namespace accessibility
OUString SAL_CALL AccessibleBrowseBoxTableCell::getSelectedText( )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::getSelectedText( );
}
sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getSelectionStart( )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::getSelectionStart( );
}
sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getSelectionEnd( )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::getSelectionEnd( );
}
sal_Bool SAL_CALL AccessibleBrowseBoxTableCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
throw IndexOutOfBoundsException();
......@@ -279,36 +285,42 @@ namespace accessibility
OUString SAL_CALL AccessibleBrowseBoxTableCell::getText( )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return implGetText( );
}
OUString SAL_CALL AccessibleBrowseBoxTableCell::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::implGetTextRange( implGetText(), nStartIndex, nEndIndex );
}
css::accessibility::TextSegment SAL_CALL AccessibleBrowseBoxTableCell::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::getTextAtIndex( nIndex ,aTextType);
}
css::accessibility::TextSegment SAL_CALL AccessibleBrowseBoxTableCell::getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::getTextBeforeIndex( nIndex ,aTextType);
}
css::accessibility::TextSegment SAL_CALL AccessibleBrowseBoxTableCell::getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return OCommonAccessibleText::getTextBehindIndex( nIndex ,aTextType);
}
sal_Bool SAL_CALL AccessibleBrowseBoxTableCell::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
OUString sText = implGetText();
checkIndex_Impl( nStartIndex, sText );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment