summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-12-10 11:57:35 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-12-10 12:38:17 +0100
commitb4fda935deaec67ccadf937d6a9604e60e0f51ea (patch)
tree04d87a2f5e592530d9da04cc183cbd669412b476 /sfx2
parent884b294df69be608ef4ff73a7927118098266dfc (diff)
Keep original error
Fix several SetError implementations, to make sure that original errors are not rewritten, but OTOH warnings could be replaced by errors. Change-Id: Ic5e71b791ff3426ff1144778a610ab77fcbf24d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160530 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx3
-rw-r--r--sfx2/source/doc/objmisc.cxx2
2 files changed, 3 insertions, 2 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 411c980b6e09..319615bacd20 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -508,7 +508,8 @@ ErrCodeMsg const & SfxMedium::GetLastStorageCreationState() const
void SfxMedium::SetError(ErrCodeMsg nError)
{
- pImpl->m_eError = nError;
+ if (pImpl->m_eError == ERRCODE_NONE || (pImpl->m_eError.IsWarning() && nError.IsError()))
+ pImpl->m_eError = nError;
}
void SfxMedium::SetWarningError(const ErrCodeMsg& nWarningError)
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 5b7aa98df38e..08a8ec0797b8 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -215,7 +215,7 @@ std::vector<InfobarData>& SfxObjectShell::getPendingInfobars()
void SfxObjectShell::SetError(const ErrCodeMsg& lErr)
{
- if (pImpl->lErr==ERRCODE_NONE)
+ if (pImpl->lErr == ERRCODE_NONE || (pImpl->lErr.IsWarning() && lErr.IsError()))
{
pImpl->lErr=lErr;
}