diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-09-30 20:47:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-10-03 10:12:41 +0200 |
commit | d9e322d60f65ff20631dab87baa5a2c7c71daaa2 (patch) | |
tree | d481e5a4728363b3866b5b5f6dbe64a2780b04a6 /sd/source/ui | |
parent | 64fc701388d1dcf8ae36ba2cc73eb5416a7c3374 (diff) |
replace ErrorInfo with simpler mechanism
Instead of returning ErrCode class everywhere, return a new
class ErrrCodeMsg, which combines an ErrCode with the other
parameters that are used to control the error reporting.
I do not change everything that uses ErrCode here, I started
from SfxBaseController/SfxMedium and worked outwards.
This change serves two purposes
(1) Replace the extremely whacky ErrorInfo mechanism we were
using to smuggle information into the error handler reporting
mechanism with a very straightforward approach of just combining it
into the error class.
(2) Allow us to capture the source location that produced the error,
which makes debugging the source of a problem soooo much easier.
Change-Id: I978b8f00c9851b41a216c7ebdef2ef94251d5519
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/viewshe2.cxx | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 0a4f7d5e587b..e35ee5c3e518 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -421,7 +421,7 @@ SfxFrame* SdModule::CreateFromTemplate(const OUString& rTemplatePath, const Refe std::unique_ptr<SfxItemSet> pSet(new SfxAllItemSet( SfxGetpApp()->GetPool() )); pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) ); - ErrCode lErr = SfxGetpApp()->LoadTemplate( xDocShell, rTemplatePath, std::move(pSet) ); + ErrCodeMsg lErr = SfxGetpApp()->LoadTemplate( xDocShell, rTemplatePath, std::move(pSet) ); SfxObjectShell* pDocShell = xDocShell; diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 64b266f42060..28a4c102b3c0 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -423,8 +423,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) } else { - ErrorHandler::HandleError(* new StringErrorInfo(ERRCODE_SFX_OLEGENERAL, - "" ) ); + ErrorHandler::HandleError(ErrCodeMsg(ERRCODE_SFX_OLEGENERAL)); } } else diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index fd4d2649b4fd..b7ae44f2c3e1 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -779,7 +779,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb) if (aErrCode != ERRCODE_NONE && !bAbort) { - ErrorHandler::HandleError(* new StringErrorInfo(aErrCode, OUString() ) ); + ErrorHandler::HandleError(ErrCodeMsg(aErrCode)); } return aErrCode == ERRCODE_NONE; |