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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 3 | ||||
-rw-r--r-- | svx/source/form/filtnav.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/formcontroller.cxx | 11 | ||||
-rw-r--r-- | svx/source/form/formcontrolling.cxx | 6 |
4 files changed, 8 insertions, 16 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index cb8ccf91955f..7e9dfb35bff7 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -2971,8 +2971,7 @@ bool DbFilterField::commitControl() else { - SQLException aError; - aError.Message = aErrorMsg; + SQLException aError(aErrorMsg, {}, {}, 0, {}); displayException(aError, VCLUnoHelper::GetInterface(m_pWindow->GetParent())); // TODO: transport the title diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 7ac5dc4d7982..ae16670d093c 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1151,9 +1151,7 @@ IMPL_LINK(FmFilterNavigator, EditedEntryHdl, const IterString&, rIterString, boo else { // display the error and return sal_False - SQLContext aError; - aError.Message = SvxResId(RID_STR_SYNTAXERROR); - aError.Details = aErrorMsg; + SQLContext aError(SvxResId(RID_STR_SYNTAXERROR), {}, {}, 0, {}, aErrorMsg); displayException(aError, VCLUnoHelper::GetInterface(m_xTopLevel)); return false; diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 3a241c4d315c..68e9b1f5274c 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3524,9 +3524,7 @@ namespace void displayErrorSetFocus(const OUString& _rMessage, const Reference<XControl>& _rxFocusControl, const css::uno::Reference<css::awt::XWindow>& rDialogParent) { - SQLContext aError; - aError.Message = SvxResId(RID_STR_WRITEERROR); - aError.Details = _rMessage; + SQLContext aError(SvxResId(RID_STR_WRITEERROR), {}, {}, 0, {}, _rMessage); displayException(aError, rDialogParent); if ( _rxFocusControl.is() ) @@ -3926,11 +3924,8 @@ sal_Bool SAL_CALL FormController::confirmDelete(const RowChangeEvent& aEvent) rtl::Reference<OInteractionDisapprove> pDisapprove = new OInteractionDisapprove; // the request - SQLWarning aWarning; - aWarning.Message = sTitle; - SQLWarning aDetails; - aDetails.Message = SvxResId(RID_STR_DELETECONFIRM); - aWarning.NextException <<= aDetails; + SQLWarning aDetails(SvxResId(RID_STR_DELETECONFIRM), {}, {}, 0, {}); + SQLWarning aWarning(sTitle, {}, {}, 0, css::uno::Any(aDetails)); rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest( Any( aWarning ) ); diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx index 81edd4862129..89d2182fefee 100644 --- a/svx/source/form/formcontrolling.cxx +++ b/svx/source/form/formcontrolling.cxx @@ -338,14 +338,14 @@ namespace svx } catch ( const SQLException& ) { - m_xFormOperations->getController()->removeSQLErrorListener( const_cast< FormControllerHelper* >(this) ); aError = ::cppu::getCaughtException(); + m_xFormOperations->getController()->removeSQLErrorListener( const_cast< FormControllerHelper* >(this) ); } catch( const Exception& ) { + aError = ::cppu::getCaughtException(); m_xFormOperations->getController()->removeSQLErrorListener( const_cast< FormControllerHelper* >(this) ); - SQLException aFallbackError; - aFallbackError.Message = ::comphelper::anyToString( ::cppu::getCaughtException() ); + SQLException aFallbackError(::comphelper::anyToString(aError), {}, {}, 0, {}); aError <<= aFallbackError; } |