diff options
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessibletextcomponent.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx index 44dee58c31e8..4430fa195254 100644 --- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx +++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx @@ -50,8 +50,9 @@ using namespace ::comphelper; VCLXAccessibleTextComponent::VCLXAccessibleTextComponent( VCLXWindow* pVCLXWindow ) :VCLXAccessibleComponent( pVCLXWindow ) { - if ( GetWindow() ) - m_sText = OutputDevice::GetNonMnemonicString( GetWindow()->GetText() ); + VclPtr<vcl::Window> pWindow = GetWindow(); + if ( pWindow ) + m_sText = OutputDevice::GetNonMnemonicString( pWindow->GetText() ); } @@ -88,8 +89,9 @@ void VCLXAccessibleTextComponent::ProcessWindowEvent( const VclWindowEvent& rVcl OUString VCLXAccessibleTextComponent::implGetText() { OUString aText; - if ( GetWindow() ) - aText = OutputDevice::GetNonMnemonicString( GetWindow()->GetText() ); + VclPtr<vcl::Window> pWindow = GetWindow(); + if ( pWindow ) + aText = OutputDevice::GetNonMnemonicString( pWindow->GetText() ); return aText; } @@ -166,12 +168,13 @@ Sequence< PropertyValue > VCLXAccessibleTextComponent::getCharacterAttributes( s if ( !implIsValidIndex( nIndex, sText.getLength() ) ) throw IndexOutOfBoundsException(); - if ( GetWindow() ) + VclPtr<vcl::Window> pWindow = GetWindow(); + if ( pWindow ) { - vcl::Font aFont = GetWindow()->GetControlFont(); + vcl::Font aFont = pWindow->GetControlFont(); - Color nBackColor = GetWindow()->GetControlBackground(); - Color nColor = GetWindow()->GetControlForeground(); + Color nBackColor = pWindow->GetControlBackground(); + Color nColor = pWindow->GetControlForeground(); // MT: Code with default font was introduced with the IA2 CWS, but I am not convinced that this is the correct font... // Decide what to do when we have a concrete issue. @@ -348,9 +351,10 @@ sal_Bool VCLXAccessibleTextComponent::copyText( sal_Int32 nStartIndex, sal_Int32 bool bReturn = false; - if ( GetWindow() ) + VclPtr<vcl::Window> pWindow = GetWindow(); + if ( pWindow ) { - Reference< datatransfer::clipboard::XClipboard > xClipboard = GetWindow()->GetClipboard(); + Reference< datatransfer::clipboard::XClipboard > xClipboard = pWindow->GetClipboard(); if ( xClipboard.is() ) { OUString sText( getTextRange( nStartIndex, nEndIndex ) ); |