From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- sc/util/number-defines-consecutively.awk | 56 +++++++++++++++ sc/util/sc.component | 114 +++++++++++++++++++++++++++++++ sc/util/scd.component | 30 ++++++++ sc/util/scfilt.component | 35 ++++++++++ sc/util/vbaobj.component | 52 ++++++++++++++ 5 files changed, 287 insertions(+) create mode 100755 sc/util/number-defines-consecutively.awk create mode 100644 sc/util/sc.component create mode 100644 sc/util/scd.component create mode 100644 sc/util/scfilt.component create mode 100644 sc/util/vbaobj.component (limited to 'sc/util') diff --git a/sc/util/number-defines-consecutively.awk b/sc/util/number-defines-consecutively.awk new file mode 100755 index 000000000..6712490ea --- /dev/null +++ b/sc/util/number-defines-consecutively.awk @@ -0,0 +1,56 @@ +#!/usr/bin/awk -f +# +# -*- Mode: awk; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# Consecutively number a series of defines, for example sc/inc/globstr.hrc +# Duplicated values are renumbered but preserved, i.e. for ...START and ...END +# definitions, and commented with "XXX was duplicate". +# To insert and renumber use a higher value for the inserted definition than +# any other used, for example 9999. +# WARNING: this does not expect other defines in between and would mess around +# with them. + +BEGIN { + id = 0; + lastline = "" +} + +{ + if ($1 ~ /#define/ && lastline !~ /#ifndef/) + { + n = split( $0, a, / +/, s); + if (dup[a[3]]) + { + dupmsg = " // XXX was duplicate " a[3] " of " dup[a[3]]; + a[3] = map[a[3]]; + } + else + { + dup[a[3]] = a[2]; + dupmsg = ""; + ++id; + map[a[3]] = id; + a[3] = id; + } + lastline = s[0]; + for (i=1; i<=n; ++i) + { + lastline = lastline a[i] s[i]; + } + lastline = lastline dupmsg; + } + else + { + lastline = $0; + } + print lastline; +} + +# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/util/sc.component b/sc/util/sc.component new file mode 100644 index 000000000..d813ff25c --- /dev/null +++ b/sc/util/sc.component @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sc/util/scd.component b/sc/util/scd.component new file mode 100644 index 000000000..15a38dd56 --- /dev/null +++ b/sc/util/scd.component @@ -0,0 +1,30 @@ + + + + + + + + + + + diff --git a/sc/util/scfilt.component b/sc/util/scfilt.component new file mode 100644 index 000000000..552893535 --- /dev/null +++ b/sc/util/scfilt.component @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/sc/util/vbaobj.component b/sc/util/vbaobj.component new file mode 100644 index 000000000..5ce466bab --- /dev/null +++ b/sc/util/vbaobj.component @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3