diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-18 14:28:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-14 20:24:22 +0100 |
commit | b5ed969212e267445e2e2e076321f52b1374b6d2 (patch) | |
tree | a854b2f3759a94fb30c37963ecf3543a25768415 /compilerplugins | |
parent | de20525d6ff2078d25f2c8fffada6245e0824a77 (diff) |
update and enable loplugin:duplicate-defines
Change-Id: I713b9985b2a69fe3c84069f19c772969e2631e46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85571
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/duplicate-defines.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/compilerplugins/clang/duplicate-defines.cxx b/compilerplugins/clang/duplicate-defines.cxx index 21caf90a96dd..ba4a69d2f867 100644 --- a/compilerplugins/clang/duplicate-defines.cxx +++ b/compilerplugins/clang/duplicate-defines.cxx @@ -73,12 +73,21 @@ void DuplicateDefines::MacroDefined(const Token& rMacroNameTok, const MacroDirec return; if (aMacroName == "rtl") return; - // we replicate this macro in all the .hrc files - if (aMacroName == "NC_") + // we replicate these macros in all the .hrc files + if (aMacroName == "NC_" || aMacroName == "NNC_") return; // TODO no obvious fix for these if (aMacroName == "FID_SEARCH_NOW" || aMacroName == "FID_SVX_START" || aMacroName == "FN_PARAM") return; + // ignore for now, requires adding too many includes to sw/ + if (aMacroName == "MM50") + return; + + // ignore for now, we have the same define in svx and sw, but I can't remove one of them because + // they reference strings in different resource bundles + if (aMacroName == "STR_UNDO_COL_DELETE" || aMacroName == "STR_UNDO_ROW_DELETE" + || aMacroName == "STR_TABLE_NUMFORMAT" || aMacroName == "STR_DELETE") + return; if (!m_aDefMap.emplace(aMacroName, Entry{ aLoc }).second) { @@ -99,7 +108,7 @@ void DuplicateDefines::MacroUndefined(const Token& rMacroNameTok, const MacroDef m_aDefMap.erase(aMacroName); } -loplugin::Plugin::Registration<DuplicateDefines> X("duplicatedefines", false); +loplugin::Plugin::Registration<DuplicateDefines> X("duplicatedefines", true); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |