diff options
-rwxr-xr-x | .git-hooks/pre-commit | 2 | ||||
-rw-r--r-- | solenv/clang-format/ClangFormat.pm | 25 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 1 |
3 files changed, 15 insertions, 13 deletions
diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index e25532bb0662..e859919fa566 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -133,7 +133,7 @@ sub check_style($) chomp $filename; if ($filename =~ /\.($src)$/ and !exists($blacklist_names->{$filename})) { - if (! -x $clang_format) + if (!defined($clang_format)) { my $version = ClangFormat::get_wanted_version(); my $opt_lo = ClangFormat::get_own_directory(); diff --git a/solenv/clang-format/ClangFormat.pm b/solenv/clang-format/ClangFormat.pm index 024fe7c1f87f..5aba53fd285c 100644 --- a/solenv/clang-format/ClangFormat.pm +++ b/solenv/clang-format/ClangFormat.pm @@ -65,24 +65,27 @@ sub find() { my $version = get_wanted_version(); my $opt_lo = get_own_directory(); - my $clang_format = $ENV{CLANG_FORMAT}; - if (!(defined($clang_format) && is_matching_clang_format_version($clang_format, $version))) + my $clang_format; + if (!(defined($ENV{CLANG_FORMAT}) && is_matching_clang_format_version($ENV{CLANG_FORMAT}, $version))) { - $clang_format = "$opt_lo/clang-format"; - if (!is_matching_clang_format_version($clang_format, $version)) + my @dirs = split /:/, $ENV{PATH}; + unshift(@dirs, $opt_lo); + + foreach my $dir (@dirs) { - foreach my $dir (split /:/, $ENV{PATH}) + if (is_matching_clang_format_version("$dir/clang-format", $version)) { - if (is_matching_clang_format_version("$dir/clang-format", $version)) - { - $clang_format = "$dir/clang-format"; - last; - } + $clang_format = "$dir/clang-format"; + last; } } } + else + { + $clang_format = $ENV{CLANG_FORMAT}; + } - if ($^O eq "cygwin") + if ($^O eq "cygwin" && defined($clang_format)) { $clang_format = `cygpath -m '$clang_format'`; chomp $clang_format; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 791ec265b0bd..473bcddf8abf 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -54,7 +54,6 @@ #include <editeng/paravertalignitem.hxx> #include <editeng/blinkitem.hxx> #include <editeng/charhiddenitem.hxx> -#include <svx/fmglob.hxx> #include <svx/svdouno.hxx> #include <filter/msfilter/rtfutil.hxx> #include <sfx2/sfxbasemodel.hxx> |