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 /dbaccess/source/ui/tabledesign/TableController.cxx | |
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 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index db2fcf48fbbf..7e13ba566bb2 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -1164,15 +1164,11 @@ void OTableController::alterColumns() } catch (const SQLException&) { + const auto caughtException = ::cppu::getCaughtException(); OUString sError( DBA_RES( STR_TABLEDESIGN_COULD_NOT_DROP_COL ) ); sError = sError.replaceFirst( "$column$", rColumnName ); - SQLException aNewException; - aNewException.Message = sError; - aNewException.SQLState = "S1000"; - aNewException.NextException = ::cppu::getCaughtException(); - - throw aNewException; + throw SQLException(sError, {}, "S1000", 0, caughtException); } } } |