diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-16 13:59:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-16 14:00:40 +0100 |
commit | 63b4633cf7b0da9eba63e752cec72cb10ed9d93e (patch) | |
tree | d70a29ab9ddb1c64eaa4d82d0773b6c1ae9ac9b7 /toolkit | |
parent | 2ae513cc22e1cb9cc2679488537672ec48bda55e (diff) |
Related: rhbz#867808 if one person threw by pointer...
then its guaranteed that someone else did too, review
newed Exceptions
Change-Id: Ie1ad78895e443a20a8663666cd6c8d3e5deb0727
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/stylesettings.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow1.cxx | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx index 7b29cdb5e818..a09f95f7af2e 100644 --- a/toolkit/source/awt/stylesettings.cxx +++ b/toolkit/source/awt/stylesettings.cxx @@ -113,7 +113,7 @@ namespace toolkit { Window* pWindow = i_rOwningWindow.GetWindow(); if ( !pWindow ) - throw new RuntimeException(); + throw RuntimeException(); pWindow->AddEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) ); } diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx index 30740d99bf1a..12022d13cff5 100644 --- a/toolkit/source/awt/vclxwindow1.cxx +++ b/toolkit/source/awt/vclxwindow1.cxx @@ -42,10 +42,9 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle ) Window *pWindow = GetWindow(); if ( pWindow->GetType() != WINDOW_WORKWINDOW ) { - ::com::sun::star::uno::Exception *pException = - new ::com::sun::star::uno::RuntimeException; - pException->Message = OUString("not a work window"); - throw pException; + com::sun::star::uno::Exception aException; + aException.Message = OUString("not a work window"); + throw aException; } // use sal_Int64 here to accommodate all int types @@ -73,10 +72,9 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle ) } if( bThrow ) { - ::com::sun::star::uno::Exception *pException = - new ::com::sun::star::uno::RuntimeException; - pException->Message = OUString("incorrect window handle type"); - throw pException; + com::sun::star::uno::Exception aException; + aException.Message = OUString("incorrect window handle type"); + throw aException; } // create system parent data SystemParentData aSysParentData; |