diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-10 12:53:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-11 06:55:41 +0000 |
commit | 78b4a1fb01af9ad3b3395a22f6e396be914b553e (patch) | |
tree | 846fdaea907a70fdc274a1e76642ed5e06622c0d /toolkit | |
parent | 071e23fee07b92b8f07800cda3ca7e66afe818ae (diff) |
update vclwidget loplugin to find ref-dropping assigment
Look for places where we are accidentally assigning a returned-by-value
VclPtr<T> to a T*, which generally ends up in a use-after-free.
Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9
Reviewed-on: https://gerrit.libreoffice.org/30749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/stylesettings.cxx | 10 | ||||
-rw-r--r-- | toolkit/source/awt/vclxaccessiblecomponent.cxx | 8 | ||||
-rw-r--r-- | toolkit/source/awt/vclxcontainer.cxx | 12 | ||||
-rw-r--r-- | toolkit/source/awt/vclxsystemdependentwindow.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtabpagecontainer.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 18 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 31 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow1.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 12 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrol.cxx | 2 |
10 files changed, 53 insertions, 52 deletions
diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx index 8eb7fbce65a5..8410554d2612 100644 --- a/toolkit/source/awt/stylesettings.cxx +++ b/toolkit/source/awt/stylesettings.cxx @@ -102,7 +102,7 @@ namespace toolkit WindowStyleSettings::WindowStyleSettings(::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow ) :m_pData( new WindowStyleSettings_Data(i_rListenerMutex, i_rOwningWindow ) ) { - vcl::Window* pWindow = i_rOwningWindow.GetWindow(); + VclPtr<vcl::Window> pWindow = i_rOwningWindow.GetWindow(); if ( !pWindow ) throw RuntimeException(); pWindow->AddEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) ); @@ -118,7 +118,7 @@ namespace toolkit { StyleMethodGuard aGuard( *m_pData ); - vcl::Window* pWindow = m_pData->pOwningWindow->GetWindow(); + VclPtr<vcl::Window> pWindow = m_pData->pOwningWindow->GetWindow(); OSL_ENSURE( pWindow, "WindowStyleSettings::dispose: window has been reset before we could revoke the listener!" ); if ( pWindow ) pWindow->RemoveEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) ); @@ -142,7 +142,7 @@ namespace toolkit void lcl_setStyleColor( WindowStyleSettings_Data& i_rData, void (StyleSettings::*i_pSetter)( Color const & ), const sal_Int32 i_nColor ) { - vcl::Window* pWindow = i_rData.pOwningWindow->GetWindow(); + VclPtr<vcl::Window> pWindow = i_rData.pOwningWindow->GetWindow(); AllSettings aAllSettings = pWindow->GetSettings(); StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); (aStyleSettings.*i_pSetter)( Color( i_nColor ) ); @@ -161,7 +161,7 @@ namespace toolkit void lcl_setStyleFont( WindowStyleSettings_Data& i_rData, void (StyleSettings::*i_pSetter)( vcl::Font const &), vcl::Font const & (StyleSettings::*i_pGetter)() const, const FontDescriptor& i_rFont ) { - vcl::Window* pWindow = i_rData.pOwningWindow->GetWindow(); + VclPtr<vcl::Window> pWindow = i_rData.pOwningWindow->GetWindow(); AllSettings aAllSettings = pWindow->GetSettings(); StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); const vcl::Font aNewFont = VCLUnoHelper::CreateFont( i_rFont, (aStyleSettings.*i_pGetter)() ); @@ -751,7 +751,7 @@ namespace toolkit void SAL_CALL WindowStyleSettings::setHighContrastMode( sal_Bool _highcontrastmode ) throw (RuntimeException, std::exception) { StyleMethodGuard aGuard( *m_pData ); - vcl::Window* pWindow = m_pData->pOwningWindow->GetWindow(); + VclPtr<vcl::Window> pWindow = m_pData->pOwningWindow->GetWindow(); AllSettings aAllSettings = pWindow->GetSettings(); StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); aStyleSettings.SetHighContrastMode( _highcontrastmode ); diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 20c39d111cfb..a02db4444e1e 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -696,7 +696,7 @@ awt::Rectangle VCLXAccessibleComponent::implGetBounds() throw (uno::RuntimeExcep { awt::Rectangle aBounds ( 0, 0, 0, 0 ); - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { Rectangle aRect = pWindow->GetWindowExtentsRelative( nullptr ); @@ -773,7 +773,7 @@ sal_Int32 SAL_CALL VCLXAccessibleComponent::getForeground( ) throw (uno::Runtim OExternalLockGuard aGuard( this ); sal_Int32 nColor = 0; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { if ( pWindow->IsControlForeground() ) @@ -800,7 +800,7 @@ sal_Int32 SAL_CALL VCLXAccessibleComponent::getBackground( ) throw (uno::Runtim OExternalLockGuard aGuard( this ); sal_Int32 nColor = 0; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { if ( pWindow->IsControlBackground() ) @@ -819,7 +819,7 @@ uno::Reference< awt::XFont > SAL_CALL VCLXAccessibleComponent::getFont( ) throw OExternalLockGuard aGuard( this ); uno::Reference< awt::XFont > xFont; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { uno::Reference< awt::XDevice > xDev( pWindow->GetComponentInterface(), uno::UNO_QUERY ); diff --git a/toolkit/source/awt/vclxcontainer.cxx b/toolkit/source/awt/vclxcontainer.cxx index 7ec45d791f51..0bd1ecdcdf43 100644 --- a/toolkit/source/awt/vclxcontainer.cxx +++ b/toolkit/source/awt/vclxcontainer.cxx @@ -85,7 +85,7 @@ css::uno::Sequence< css::uno::Reference< css::awt::XWindow > > VCLXContainer::ge // Request container interface from all children css::uno::Sequence< css::uno::Reference< css::awt::XWindow > > aSeq; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { sal_uInt16 nChildren = pWindow->GetChildCount(); @@ -111,7 +111,7 @@ void VCLXContainer::enableDialogControl( sal_Bool bEnable ) throw(css::uno::Runt { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { WinBits nStyle = pWindow->GetStyle(); @@ -136,7 +136,7 @@ void VCLXContainer::setTabOrder( const css::uno::Sequence< css::uno::Reference< for ( sal_uInt32 n = 0; n < nCount; n++ ) { // css::style::TabStop - vcl::Window* pWin = VCLUnoHelper::GetWindow( pComps[n] ); + VclPtr<vcl::Window> pWin = VCLUnoHelper::GetWindow( pComps[n] ); // May be NULL if a css::uno::Sequence is originated from TabController and is missing a peer! if ( pWin ) { @@ -179,7 +179,7 @@ void VCLXContainer::setGroup( const css::uno::Sequence< css::uno::Reference< css vcl::Window* pPrevRadio = nullptr; for ( sal_uInt32 n = 0; n < nCount; n++ ) { - vcl::Window* pWin = VCLUnoHelper::GetWindow( pComps[n] ); + VclPtr<vcl::Window> pWin = VCLUnoHelper::GetWindow( pComps[n] ); if ( pWin ) { vcl::Window* pSortBehind = pPrevWin; @@ -243,9 +243,9 @@ throw(css::uno::RuntimeException, std::exception) sal_Int32 nVal =0; Value >>= nVal; Size aSize( nVal, nVal ); - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); MapMode aMode( MapUnit::MapAppFont ); - toolkit::ScrollableInterface* pScrollable = dynamic_cast< toolkit::ScrollableInterface* >( pWindow ); + toolkit::ScrollableInterface* pScrollable = dynamic_cast< toolkit::ScrollableInterface* >( pWindow.get() ); if ( pWindow && pScrollable ) { OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() ); diff --git a/toolkit/source/awt/vclxsystemdependentwindow.cxx b/toolkit/source/awt/vclxsystemdependentwindow.cxx index 18e4a0224122..6baa157cab9e 100644 --- a/toolkit/source/awt/vclxsystemdependentwindow.cxx +++ b/toolkit/source/awt/vclxsystemdependentwindow.cxx @@ -69,10 +69,10 @@ css::uno::Any VCLXSystemDependentWindow::getWindowHandle( const css::uno::Sequen // TODO, check the process id css::uno::Any aRet; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { - const SystemEnvData* pSysData = static_cast<SystemChildWindow *>(pWindow)->GetSystemData(); + const SystemEnvData* pSysData = static_cast<SystemChildWindow *>(pWindow.get())->GetSystemData(); if( pSysData ) { #if defined(_WIN32) diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index 2e862e3b6a18..7e8b451dd7d8 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -185,8 +185,8 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const css::container::Conta Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY ); sal_Int16 nPageID = xP->getTabPageID(); - vcl::Window* pWindow = VCLUnoHelper::GetWindow(xControl->getPeer()); - TabPage* pPage = static_cast<TabPage*>(pWindow); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xControl->getPeer()); + TabPage* pPage = static_cast<TabPage*>(pWindow.get()); pTabCtrl->InsertPage(nPageID,pPage->GetText()); pPage->Hide(); diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index b3469f2e9ef3..12948c3e8d67 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1506,7 +1506,7 @@ css::uno::Reference< css::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessage css::uno::Reference< css::awt::XWindow > xWindow( xMsgBox, css::uno::UNO_QUERY ); if ( xMsgBox.is() && xWindow.is() ) { - vcl::Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow ) { SolarMutexGuard aGuard; @@ -1522,7 +1522,7 @@ css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL V { SolarMutexGuard g; - vcl::Window * pWindow = VCLUnoHelper::GetWindow( window ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( window ); if( pWindow ) return pWindow->GetDragGestureRecognizer(); @@ -1534,7 +1534,7 @@ css::uno::Reference< css::datatransfer::dnd::XDragSource > SAL_CALL VCLXToolkit: { SolarMutexGuard g; - vcl::Window * pWindow = VCLUnoHelper::GetWindow( window ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( window ); if( pWindow ) return pWindow->GetDragSource(); @@ -1546,7 +1546,7 @@ css::uno::Reference< css::datatransfer::dnd::XDropTarget > SAL_CALL VCLXToolkit: { SolarMutexGuard g; - vcl::Window * pWindow = VCLUnoHelper::GetWindow( window ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( window ); if( pWindow ) return pWindow->GetDropTarget(); @@ -1986,7 +1986,7 @@ void SAL_CALL VCLXToolkit::keyPress( const css::awt::KeyEvent & aKeyEvent ) if( !xWindow.is() ) throw css::uno::RuntimeException( "invalid event source" ); - vcl::Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); if( !pWindow ) throw css::uno::RuntimeException( "invalid event source" ); @@ -2001,7 +2001,7 @@ void SAL_CALL VCLXToolkit::keyRelease( const css::awt::KeyEvent & aKeyEvent ) if( !xWindow.is() ) throw css::uno::RuntimeException( "invalid event source" ); - vcl::Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); if( !pWindow ) throw css::uno::RuntimeException( "invalid event source" ); @@ -2017,7 +2017,7 @@ void SAL_CALL VCLXToolkit::mousePress( const css::awt::MouseEvent & aMouseEvent if( !xWindow.is() ) throw css::uno::RuntimeException( "invalid event source" ); - vcl::Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); if( !pWindow ) throw css::uno::RuntimeException( "invalid event source" ); @@ -2032,7 +2032,7 @@ void SAL_CALL VCLXToolkit::mouseRelease( const css::awt::MouseEvent & aMouseEven if( !xWindow.is() ) throw css::uno::RuntimeException( "invalid event source" ); - vcl::Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); if( !pWindow ) throw css::uno::RuntimeException( "invalid event source" ); @@ -2047,7 +2047,7 @@ void SAL_CALL VCLXToolkit::mouseMove( const css::awt::MouseEvent & aMouseEvent ) if( !xWindow.is() ) throw css::uno::RuntimeException( "invalid event source" ); - vcl::Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); if( !pWindow ) throw css::uno::RuntimeException( "invalid event source" ); diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 2f21102e5a4b..f8b90098c78f 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -876,7 +876,7 @@ Size VCLXWindow::ImplCalcWindowSize( const Size& rOutSz ) const { Size aSz = rOutSz; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { sal_Int32 nLeft, nTop, nRight, nBottom; @@ -1001,7 +1001,7 @@ void VCLXWindow::setVisible( sal_Bool bVisible ) throw(css::uno::RuntimeExceptio { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { mpImpl->setDirectVisible( bVisible ); @@ -1013,7 +1013,7 @@ void VCLXWindow::setEnable( sal_Bool bEnable ) throw(css::uno::RuntimeException, { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { pWindow->Enable( bEnable, false ); // #95824# without children! @@ -1179,10 +1179,10 @@ sal_Bool VCLXWindow::isChild( const css::uno::Reference< css::awt::XWindowPeer > SolarMutexGuard aGuard; bool bIsChild = false; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { - vcl::Window* pPeerWindow = VCLUnoHelper::GetWindow( rxPeer ); + VclPtr<vcl::Window> pPeerWindow = VCLUnoHelper::GetWindow( rxPeer ); bIsChild = pPeerWindow && pWindow->IsChild( pPeerWindow ); } @@ -1389,7 +1389,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const css::uno::Any& { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( !pWindow ) return; @@ -1401,7 +1401,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const css::uno::Any& { case BASEPROPERTY_REFERENCE_DEVICE: { - Control* pControl = dynamic_cast< Control* >( pWindow ); + Control* pControl = dynamic_cast< Control* >( pWindow.get() ); OSL_ENSURE( pControl, "VCLXWindow::setProperty( RefDevice ): need a Control for this!" ); if ( !pControl ) break; @@ -2238,7 +2238,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(css::uno::RuntimeExcep { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( !pWindow ) return; @@ -2247,7 +2247,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(css::uno::RuntimeExcep OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mpImpl->mxViewGraphics ); if (!pDev) pDev = pWindow->GetParent(); - TabPage* pTabPage = dynamic_cast< TabPage* >( pWindow ); + TabPage* pTabPage = dynamic_cast< TabPage* >( pWindow.get() ); if ( pTabPage ) { Point aPos( nX, nY ); @@ -2406,7 +2406,7 @@ void SAL_CALL VCLXWindow::enableDocking( sal_Bool bEnable ) throw (css::uno::Run { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) pWindow->EnableDocking( bEnable ); } @@ -2415,7 +2415,7 @@ sal_Bool SAL_CALL VCLXWindow::isFloating( ) throw (css::uno::RuntimeException, { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if( pWindow ) return vcl::Window::GetDockingManager()->IsFloating( pWindow ); else @@ -2426,7 +2426,7 @@ void SAL_CALL VCLXWindow::setFloatingMode( sal_Bool bFloating ) throw (css::uno: { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if( pWindow ) vcl::Window::GetDockingManager()->SetFloatingMode( pWindow, bFloating ); } @@ -2435,7 +2435,7 @@ sal_Bool SAL_CALL VCLXWindow::isLocked( ) throw (css::uno::RuntimeException, st { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if( pWindow ) return vcl::Window::GetDockingManager()->IsLocked( pWindow ); else @@ -2446,7 +2446,7 @@ void SAL_CALL VCLXWindow::lock( ) throw (css::uno::RuntimeException, std::excep { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if( pWindow && !vcl::Window::GetDockingManager()->IsFloating( pWindow ) ) vcl::Window::GetDockingManager()->Lock( pWindow ); } @@ -2455,10 +2455,11 @@ void SAL_CALL VCLXWindow::unlock( ) throw (css::uno::RuntimeException, std::exc { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if( pWindow && !vcl::Window::GetDockingManager()->IsFloating( pWindow ) ) vcl::Window::GetDockingManager()->Unlock( pWindow ); } + void SAL_CALL VCLXWindow::startPopupMode( const css::awt::Rectangle& ) throw (css::uno::RuntimeException, std::exception) { // TODO: remove interface in the next incompatible build diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx index cbace5c381c5..e706418db73b 100644 --- a/toolkit/source/awt/vclxwindow1.cxx +++ b/toolkit/source/awt/vclxwindow1.cxx @@ -37,7 +37,7 @@ void VCLXWindow::SetSystemParent_Impl( const css::uno::Any& rHandle ) { // does only work for WorkWindows - vcl::Window *pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow->GetType() != WINDOW_WORKWINDOW ) { css::uno::RuntimeException aException; @@ -91,7 +91,7 @@ void VCLXWindow::SetSystemParent_Impl( const css::uno::Any& rHandle ) #endif // set system parent - static_cast<WorkWindow*>(pWindow)->SetPluginParent( &aSysParentData ); + static_cast<WorkWindow*>(pWindow.get())->SetPluginParent( &aSysParentData ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index a4b87e7f7783..4c3b6041c9c7 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -423,7 +423,7 @@ void VCLXButton::setLabel( const OUString& rLabel ) throw(css::uno::RuntimeExcep { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) pWindow->SetText( rLabel ); } @@ -847,7 +847,7 @@ void VCLXCheckBox::setLabel( const OUString& rLabel ) throw(css::uno::RuntimeExc { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) pWindow->SetText( rLabel ); } @@ -1213,7 +1213,7 @@ void VCLXRadioButton::setLabel( const OUString& rLabel ) throw(css::uno::Runtime { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) pWindow->SetText( rLabel ); } @@ -1410,7 +1410,7 @@ void VCLXSpinField::enableRepeat( sal_Bool bRepeat ) throw(css::uno::RuntimeExce { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) { WinBits nStyle = pWindow->GetStyle(); @@ -2185,7 +2185,7 @@ void VCLXMessageBox::setCaptionText( const OUString& rText ) throw(css::uno::Run { SolarMutexGuard aGuard; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) pWindow->SetText( rText ); } @@ -2195,7 +2195,7 @@ OUString VCLXMessageBox::getCaptionText() throw(css::uno::RuntimeException, std: SolarMutexGuard aGuard; OUString aText; - vcl::Window* pWindow = GetWindow(); + VclPtr<vcl::Window> pWindow = GetWindow(); if ( pWindow ) aText = pWindow->GetText(); return aText; diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index adb398993403..3bf3d5d51d43 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -641,7 +641,7 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent VCLXWindow* pPeer; { SolarMutexGuard g; - vcl::Window* pVclPeer = VCLUnoHelper::GetWindow( getPeer() ); + VclPtr<vcl::Window> pVclPeer = VCLUnoHelper::GetWindow( getPeer() ); pPeer = pVclPeer ? pVclPeer->GetWindowPeer() : nullptr; } VclListenerLock aNoVclEventMultiplexing( pPeer ); |