summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-15 14:52:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-15 18:32:13 +0200
commit26b97ba18e72f7c25c836177d895d429162a0120 (patch)
tree4a0bb10ee6141ddafd68d36abda8c64646035ca8
parentcad80f35f4944ebd23ea7818e7a3e9e825b55b28 (diff)
tdf#111696 No macro security dialog with High setting
Regression from commit 528632660b72b105345945c13c5b68060d94a91b "convert ErrCode to strong typedef" Why this is necessary I don't know. Only the change in ehdl.cxx is necessary to fix the reported bug, bug fixing the other one too because it operates in the same way. I know that the other arrays that get passed here look like: { NC_("RID_UUI_ERRHDL", "....."), ErrCode(sal_uInt32(ERRCODE_UUI_IO_ABORT) & ERRCODE_RES_MASK) }, but RID_ERRHDL in svtools/inc/errtxt.hrc does not, it looks like: { NC_("RID_ERRHDL", "...."), ErrCode(ERRCODE_SFX_MACROS_SUPPORT_DISABLED) }, I'm guessing that somehow before my conversion somehow the code was stripping the top bits off the error codes? And why we need to strip the top half of the error code off at all is also a mystery. Change-Id: Iebca026ddf80e24ed74802410693adf90ea36047 Reviewed-on: https://gerrit.libreoffice.org/41172 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svtools/source/misc/ehdl.cxx4
-rw-r--r--uui/source/iahndl.cxx2
2 files changed, 2 insertions, 4 deletions
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 429eb5957a10..c5184c8c40eb 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -215,11 +215,9 @@ bool SfxErrorHandler::GetErrorString(ErrCode lErrId, OUString &rStr) const
bool bRet = false;
rStr = RID_ERRHDL_CLASS;
- ErrCode nErrId((sal_uInt16)(sal_uInt32)lErrId);
-
for (const ErrMsgCode* pItem = pIds; pItem->second; ++pItem)
{
- if (pItem->second == nErrId)
+ if (pItem->second.GetRest() == lErrId.GetRest())
{
rStr = rStr.replaceAll("$(ERROR)", Translate::get(pItem->first, rResLocale));
bRet = true;
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 5b4447bd83f2..4b61c00c8979 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1255,7 +1255,7 @@ bool ErrorResource::getString(ErrCode nErrorCode, OUString &rString) const
{
for (const std::pair<const char*, ErrCode>* pStringArray = m_pStringArray; pStringArray->first != nullptr; ++pStringArray)
{
- if (ErrCode(nErrorCode.GetRest()) == pStringArray->second)
+ if (nErrorCode.GetRest() == pStringArray->second.GetRest())
{
rString = Translate::get(pStringArray->first, m_rResLocale);
return true;