From 8ede3618f0e0a3bb20e9a6dcc07b6c0704c402b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Sun, 17 May 2015 02:48:22 +0200 Subject: [PATCH] lyx2lyx/lyx_2_2.py: fix for a lyx2lyx issue I don't understand why the string "shadowsize" is not already in the file because when I convert from format 474 to 489 it is added. So why is it not there when I convert from format 474 to 491. --- lib/lyx2lyx/lyx_2_2.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/lyx2lyx/lyx_2_2.py b/lib/lyx2lyx/lyx_2_2.py index d7f417e7ad..cd8ec9830f 100644 --- a/lib/lyx2lyx/lyx_2_2.py +++ b/lib/lyx2lyx/lyx_2_2.py @@ -1082,10 +1082,18 @@ def convert_colorbox(document): i = 0 while True: + # the routine convert_BoxFeatures adds already "shadowsize" to the box params + # but for an unknown reason this is not yet done before this routine is run + # therefore handle the case that shadowsize exists (for files in version 489 491) + # and that it don't exists i = find_token(document.body, "height_special", i) if i == -1: return - document.body.insert(i + 2, 'framecolor "black"\nbackgroundcolor "none"') + j = find_token(document.body, "shadowsize", i) + if j == i + 3: + document.body.insert(i + 4, 'framecolor "black"\nbackgroundcolor "none"') + else: + document.body.insert(i + 2, 'framecolor "black"\nbackgroundcolor "none"') i = i + 2