tdf#157613 make sure surface is not a null pointer
[LibreOffice.git] / bin / find-unused-configkeys.sh
blob9a159da23ebc73d342f0df632f610de5f3f2021d
1 #!/usr/bin/env bash
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # find group, set and key names in officecfg that are not used in the code base
10 # caveat: only effective for reasonably unique strings
12 for filename in $(find officecfg/ -name "*xcs"); do
13 for gs in group set node-ref; do
14 for gname in $(git grep -h "<$gs" "$filename" | awk -F'oor:name="' '{print $2}' | awk -F'"' '{print $1}') ; do
15 if [ $(git grep "$gname" | grep -v ^officecfg | wc -l) -eq 0 ] ;
16 then
17 # group, set or node-ref names may serve as oor:node-type templates
18 if [ $(git grep "$gname" officecfg | grep oor:node-type | wc -l ) -eq 0 ] ;
19 then
20 echo "$gname group in "$filename" appears only in officecfg";
23 done
24 done
26 for pname in $(git grep -h "<prop" "$filename" | awk -F'oor:name="' '{print $2}' | awk -F'"' '{print $1}') ; do
27 if [ $(git grep "$pname" | grep -v ^officecfg | wc -l) -eq 0 ] ;
28 then
29 echo "$pname property in "$filename" appears only in officecfg";
31 done
33 done