diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-16 16:09:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-17 08:21:21 +0000 |
commit | f5a16eae7607a37d29a4524d8c91e0bc10a465c9 (patch) | |
tree | 9c54a0bcaf5e2e76812b5e811840d29d95aa46d5 /bin | |
parent | c20dc4433546522a75d7b756162a65637e285887 (diff) |
remove unused defines from HRC files in svtools
Change-Id: I5d8a6a4fd232ef10644ae45174a07b30af789205
Reviewed-on: https://gerrit.libreoffice.org/35277
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-in-hrc-files.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/find-unused-defines-in-hrc-files.py b/bin/find-unused-defines-in-hrc-files.py index 7313152417c9..024f7a5797ef 100755 --- a/bin/find-unused-defines-in-hrc-files.py +++ b/bin/find-unused-defines-in-hrc-files.py @@ -108,6 +108,7 @@ with a.stdout as txt: b = subprocess.Popen(["git", "grep", "-w", idName], stdout=subprocess.PIPE) found_reason_to_exclude = False with b.stdout as txt2: + cnt = 0 for line2 in txt2: line2 = line2.strip() # otherwise the comparisons below will not work # check if we found one in actual code @@ -137,7 +138,9 @@ with a.stdout as txt: 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 if "reportdesign/" in line2 and idName.startswith("RID_STR_"): found_reason_to_exclude = True - + # if we see more than 2 lines then it's probably one of the BASE/START/BEGIN things + cnt = cnt + 2 + if cnt > 3: found_reason_to_exclude = True if not found_reason_to_exclude: sys.stdout.write(idName + '\n') # otherwise the previous line of output will be incorrectly mixed into the below git output, because of buffering |