[Libreoffice-commits] core.git: compilerplugins/clang
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 14 19:24:52 UTC 2020
compilerplugins/clang/duplicate-defines.cxx | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
New commits:
commit b5ed969212e267445e2e2e076321f52b1374b6d2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Dec 18 14:28:58 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jan 14 20:24:22 2020 +0100
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 at collabora.co.uk>
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: */
More information about the Libreoffice-commits
mailing list