summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-04-16 13:52:02 +0200
committerPetr Mladek <pmladek@suse.cz>2013-05-06 17:36:35 +0200
commit2557c2796c0c4c533e31a28ca59fe3296e582f0a (patch)
tree5a8c750fc33d69e44ce2914adab69e3bb522546e /toolkit
parent8443407096ac4e6848c38874aaebcef01c585f4f (diff)
rhbz#867808 Do not throw RuntimeException by pointer
(cherry picked from commit e46564a0a6a74da90785a1b910d33e2b5bfdcfd9, plus 63b4633cf7b0da9eba63e752cec72cb10ed9d93e "Related: rhbz#867808 if one person threw by pointer..." and 336353a87e6003e685aab87ea74a158546e1f297 "Related rhbz#867808: More apparently bogus 'throw new ...' in C++ code") Signed-off-by: Petr Mladek <pmladek@suse.cz> Conflicts: bridges/test/java_uno/nativethreadpool/testnativethreadpoolclient.cxx bridges/test/java_uno/nativethreadpool/testnativethreadpoolserver.cxx sdext/source/presenter/PresenterController.cxx stoc/source/registry_tdprovider/functiondescription.cxx stoc/source/registry_tdprovider/methoddescription.cxx toolkit/source/awt/vclxwindow1.cxx Change-Id: I22b7d3d642e7ee0488d6b726a331d328065bbee7 Reviewed-on: https://gerrit.libreoffice.org/3418 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> Signed-off-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/stylesettings.cxx2
-rw-r--r--toolkit/source/awt/vclxwindow1.cxx14
2 files changed, 7 insertions, 9 deletions
diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx
index 97d5e2997bca..fc0fbaa5b173 100644
--- a/toolkit/source/awt/stylesettings.cxx
+++ b/toolkit/source/awt/stylesettings.cxx
@@ -116,7 +116,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 f38a95cb6dda..77af1b2b00e4 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -46,10 +46,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 = ::rtl::OUString("not a work window");
- throw pException;
+ com::sun::star::uno::Exception aException;
+ aException.Message = ::rtl::OUString("not a work window");
+ throw aException;
}
// use sal_Int64 here to accomodate all int types
@@ -77,10 +76,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 = ::rtl::OUString("incorrect window handle type");
- throw pException;
+ com::sun::star::uno::Exception aException;
+ aException.Message = ::rtl::OUString("incorrect window handle type");
+ throw aException;
}
// create system parent data
SystemParentData aSysParentData;