diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-12 22:02:15 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-14 15:37:17 +0200 |
commit | 176e8cf09a527438ec9b2b20ba2df23fa45226bc (patch) | |
tree | 76897d74143771a9ee9249c49bbe91da9ffa0433 /toolkit | |
parent | 328d6aae9e2b7a73f6672800629230f5b46d15b1 (diff) |
Use exception ctors, instead of setting members later
Avoids overwriting source location in message
Change-Id: Ia0290c7dd1ab3ea1357712a27ecab75c7b583dd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157893
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow1.cxx | 8 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrol.cxx | 5 |
2 files changed, 3 insertions, 10 deletions
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx index 7b7b7192f9db..edc78f7d9258 100644 --- a/toolkit/source/awt/vclxwindow1.cxx +++ b/toolkit/source/awt/vclxwindow1.cxx @@ -39,9 +39,7 @@ void VCLXWindow::SetSystemParent_Impl(const css::uno::Any& rHandle) VclPtr<vcl::Window> pWindow = GetWindow(); if (pWindow->GetType() != WindowType::WORKWINDOW) { - css::uno::RuntimeException aException; - aException.Message = "not a work window"; - throw aException; + throw css::uno::RuntimeException("not a work window"); } // use sal_Int64 here to accommodate all int types @@ -67,9 +65,7 @@ void VCLXWindow::SetSystemParent_Impl(const css::uno::Any& rHandle) } if (bThrow) { - css::uno::RuntimeException aException; - aException.Message = "incorrect window handle type"; - throw aException; + throw css::uno::RuntimeException("incorrect window handle type"); } // create system parent data SystemParentData aSysParentData; diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index c47048b3a4b6..0880455581ea 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1074,10 +1074,7 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer ::osl::ClearableMutexGuard aGuard( GetMutex() ); if ( !mxModel.is() ) { - RuntimeException aException; - aException.Message = "createPeer: no model!"; - aException.Context = static_cast<XAggregation*>(static_cast<cppu::OWeakAggObject*>(this)); - throw aException; + throw RuntimeException("createPeer: no model!", getXWeak()); } if( getPeer().is() ) |