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/source/propctrlr | |
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/source/propctrlr')
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/formlinkdialog.cxx | 4 |
2 files changed, 2 insertions, 6 deletions
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); } |