diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-05 10:54:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-06 07:41:36 +0100 |
commit | 0c1ca08318bd370280e124ea05d9bf0d2535d3e1 (patch) | |
tree | be8a131324a78b1c6459838a2cd691e182bfc6cf /bin | |
parent | 30b18e9c1ce5578ce22cb75e38f489eb25c4b7c7 (diff) |
remove unused defines
In particular, the STR_SVT_MIMETYPE defines are dead
since
commit 1b694dad643334ec1bab3f823dcd68f44a05ebe3
Date: Thu Aug 24 22:14:27 2017 +0200
loplugin:unusedmethods
Change-Id: I641ec0a14efedc55c9d6a4de4a28784c273602e9
Reviewed-on: https://gerrit.libreoffice.org/47464
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/find-unused-defines.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/find-unused-defines.py b/bin/find-unused-defines.py index 2c08cc6cd342..ad96c0c24118 100755 --- a/bin/find-unused-defines.py +++ b/bin/find-unused-defines.py @@ -119,6 +119,12 @@ with a.stdout as txt: cnt = 0 for line2 in txt2: line2 = line2.strip() # otherwise the comparisons below will not work + # ignore if/undef magic, does not indicate an actual use (most of the time) + if "ifdef" in line2: continue + if "undef" in line2: continue + # ignore commented out code + if line2.startswith("//"): continue + if line2.startswith("/*"): continue # check if we found one in actual code if idName.startswith("SID_"): if not ".hrc:" in line2 and not ".src:" in line2 and not ".sdi:" in line2: found_reason_to_exclude = True @@ -143,8 +149,6 @@ with a.stdout as txt: if "sw/source/uibase/inc/ribbar.hrc:" in line2 and "STR_IMGBTN_" in idName: found_reason_to_exclude = True if "sw/source/core/undo/undo.hrc:" in line2: found_reason_to_exclude = True if "sw/inc/poolfmt.hrc:" in line2: found_reason_to_exclude = True - # not sure about these, looks suspicious - if "sd/source/ui/app/strings.src:" in line2 and idName.endswith("_TOOLBOX"): found_reason_to_exclude = True # used via a macro that hides them from search if "dbaccess/" in line2 and idName.startswith("PROPERTY_ID_"): found_reason_to_exclude = True if "reportdesign/" in line2 and idName.startswith("HID_RPT_PROP_"): found_reason_to_exclude = True |