[Libreoffice-commits] core.git: sc/util

Eike Rathke erack at redhat.com
Wed Oct 28 13:42:31 UTC 2015


 sc/util/number-defines-consecutively.awk |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 384d9e4132be7d7c41a992e6d5cb7c0f59a79ffe
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Oct 28 14:38:10 2015 +0100

    preserve and renumber duplicate values
    
    Change-Id: I5c805fb7d60d8bae7109e3910f7bb0b5dd142909

diff --git a/sc/util/number-defines-consecutively.awk b/sc/util/number-defines-consecutively.awk
index 6297dcd..6712490 100755
--- a/sc/util/number-defines-consecutively.awk
+++ b/sc/util/number-defines-consecutively.awk
@@ -10,6 +10,10 @@
 #
 
 # 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.
 
@@ -25,13 +29,16 @@ BEGIN {
         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;
         }
-        a[3] = ++id;
         lastline = s[0];
         for (i=1; i<=n; ++i)
         {


More information about the Libreoffice-commits mailing list