svtools/source/misc/ehdl.cxx | 4 +--- uui/source/iahndl.cxx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)
New commits: commit 26b97ba18e72f7c25c836177d895d429162a0120 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue Aug 15 14:52:46 2017 +0200 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 <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits