From ce3e3185f9ef64b44e26593a8300ae912b6fe68e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 24 Mar 2017 12:28:21 +0200 Subject: remove unhandled SID commands in starmath checked that none of these are present in any .xcu files. Change-Id: Ife5ac45ca4e71fed9515941c20853b9ab811e057 Reviewed-on: https://gerrit.libreoffice.org/35619 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- bin/find-unused-defines-in-hrc-files.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/find-unused-defines-in-hrc-files.py b/bin/find-unused-defines-in-hrc-files.py index 94ec2170fe22..a7adbf29fa20 100755 --- a/bin/find-unused-defines-in-hrc-files.py +++ b/bin/find-unused-defines-in-hrc-files.py @@ -134,7 +134,10 @@ with a.stdout as txt: for line2 in txt2: line2 = line2.strip() # otherwise the comparisons below will not work # check if we found one in actual code - if not ".hrc:" in line2 and not ".src:" in line2: found_reason_to_exclude = True + if idName.startswith("SID_"): + if not ".hrc:" in line2 and not ".src:" in line2 and not ".sdi:" in line2: found_reason_to_exclude = True + else: + if not ".hrc:" in line2 and not ".src:" in line2: found_reason_to_exclude = True if idName.startswith("RID_"): # is the constant being used as an identifier by entries in .src files? if ".src:" in line2 and "Identifier = " in line2: found_reason_to_exclude = True @@ -163,9 +166,9 @@ with a.stdout as txt: if "forms/" in line2 and idName.startswith("PROPERTY_"): found_reason_to_exclude = True if "svx/source/tbxctrls/extrusioncontrols.hrc:" in line2 and idName.startswith("DIRECTION_"): found_reason_to_exclude = True if "svx/source/tbxctrls/extrusioncontrols.hrc:" in line2 and idName.startswith("FROM_"): 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 we see more than a few lines then it's probably one of the BASE/START/BEGIN things + cnt = cnt + 1 + if cnt > 4: 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 -- cgit