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 /extensions | |
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 'extensions')
4 files changed, 8 insertions, 13 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index e3c0f5cb1548..fd5820fce1ee 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -558,10 +558,10 @@ namespace abp if ( aException.Message.isEmpty() ) { // prepend some context info - SQLContext aDetailedError; - aDetailedError.Message = compmodule::ModuleRes(RID_STR_NOCONNECTION); - aDetailedError.Details = compmodule::ModuleRes(RID_STR_PLEASECHECKSETTINGS); - aDetailedError.NextException = aError; + SQLContext aDetailedError(compmodule::ModuleRes(RID_STR_NOCONNECTION), // message + {}, {}, 0, + aError, // next exception + compmodule::ModuleRes(RID_STR_PLEASECHECKSETTINGS)); // details // handle (aka display) the new context info xInteractions->handle( new OInteractionRequest( Any( aDetailedError ) ) ); } diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 95a3801573df..17ec948ed017 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -575,9 +575,8 @@ namespace dbp { // an SQLException (or derivee) was thrown ... // prepend an extra SQLContext explaining what we were doing - SQLContext aContext; - aContext.Message = compmodule::ModuleRes(RID_STR_COULDNOTOPENTABLE); - aContext.NextException = aSQLException; + SQLContext aContext(compmodule::ModuleRes(RID_STR_COULDNOTOPENTABLE), {}, {}, 0, + aSQLException, {}); // create an interaction handler to display this exception Reference< XInteractionHandler > xHandler = getInteractionHandler(m_xAssistant.get()); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 4265a8bc2dee..119f270e5d51 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2422,9 +2422,7 @@ namespace pcr if ( aParser.GetProtocol() != INetProtocol::NotValid ) sDataSourceName = aParser.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); OUString sInfo(PcrRes(RID_STR_UNABLETOCONNECT).replaceAll("$name$", sDataSourceName)); - SQLContext aContext; - aContext.Message = sInfo; - aContext.NextException = aError.get(); + SQLContext aContext(sInfo, {}, {}, 0, aError.get(), {}); impl_displaySQLError_nothrow( aContext ); } diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index 68143835edae..c46cc95cbe2b 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -414,9 +414,7 @@ namespace pcr sErrorMessage = sErrorMessage.replaceFirst("#", sCommand); } - SQLContext aContext; - aContext.Message = sErrorMessage; - aContext.NextException = aErrorInfo.get(); + SQLContext aContext(sErrorMessage, {}, {}, 0, aErrorInfo.get(), {}); ::dbtools::showError(aContext, m_xDialog->GetXWindow(), m_xContext); } |