From 5f7e3ad041ddf022f6b0feb11fac1debbcf835b2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2016 15:41:33 +0100 Subject: Recover lost basic in help indentation regression from... commit 6614bedceadcc07ec082c5e926107f27903bda5c Date: Mon Jan 25 20:07:10 2016 +0100 fix validation errors by round-trip through helpauthoring extension with git show 6614bedceadcc07ec082c5e926107f27903bda5c | ~/recoverindent.py import fileinput import re import sys added = [] removed = [] filename = "" def processlastfile(filename, added, removed): if len(added) != len(removed): print "BROKEN" sys.exit(-2) if len(removed): f = open(filename, "rw") linestring = open(filename, "r").read() start = 0 for x in range(0, len(added)): if added[x] == removed[x]: continue if added[x].strip() != removed[x].strip(): print "BROKEN" sys.exit(-2) if filename == "source/text/sbasic/shared/03080301.xhp" and x == 6: print "skipping special hunk", removed[x], "in source/text/sbasic/shared/03080301.xhp" else: start = linestring.find(added[x], start) if start == -1: print "BROKEN" sys.exit(-2) linestring = linestring[0:start] + removed[x] + linestring[start + len(added[x]):] start = start + len(removed[x]) open(filename, "w").write(linestring) for line in fileinput.input(): if line.startswith("--- a/"): if filename is not "": processlastfile(filename, added, removed) added = [] removed = [] filename = line[6:-1] elif "role=\"bascode\"" in line: m = re.search('>(.+?)<', line) code = m.group(1) if line.startswith("-"): removed.append(code) else: added.append(code) processlastfile(filename, added, removed) which puts the code back the way it was, except for one string which had changed and was fixed manually afterwards Change-Id: Ic67abf36bb5d27be58a51ebbf5022830f56dcb37 --- source/text/sbasic/shared/03090303.xhp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/text/sbasic/shared/03090303.xhp') diff --git a/source/text/sbasic/shared/03090303.xhp b/source/text/sbasic/shared/03090303.xhp index d64d0afdb7..ad0d3317cf 100644 --- a/source/text/sbasic/shared/03090303.xhp +++ b/source/text/sbasic/shared/03090303.xhp @@ -55,21 +55,21 @@ Sub ExampleOnGosub Dim iVar As Integer Dim sVar As String - iVar = 2 - sVar ="" - On iVar GoSub Sub1, Sub2 - On iVar GoTo Line1, Line2 - Exit Sub + iVar = 2 + sVar ="" + On iVar GoSub Sub1, Sub2 + On iVar GoTo Line1, Line2 + Exit Sub Sub1: - sVar =sVar & " From Sub 1 to" : Return + sVar =sVar & " From Sub 1 to" : Return Sub2: - sVar =sVar & " From Sub 2 to" : Return + sVar =sVar & " From Sub 2 to" : Return Line1: - sVar =sVar & " Label 1" : GoTo Ende + sVar =sVar & " Label 1" : GoTo Ende Line2: - sVar =sVar & " Label 2" + sVar =sVar & " Label 2" Ende: - MsgBox sVar,0,"On...GoSub" + MsgBox sVar,0,"On...GoSub" End Sub -- cgit