From 5fbfa4888bb2cf8dad04530312d27e2637384767 Mon Sep 17 00:00:00 2001 From: Dekel Tsur Date: Wed, 12 Mar 2003 18:41:51 +0000 Subject: [PATCH] Fix for note insets git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@6469 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 7 +++++++ lib/lyx2lyx/lyxconvert_218.py | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 0c65d2f7bb..391b40935a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2003-03-12 Dekel Tsur + + * lyx2lyx/lyx2lyx (main): Print error messages to stderr. + + * lyx2lyx/lyxconvert_218.py (change_infoinset): Convert correctly + notes with several lines and backslashes. + 2003-03-11 Dekel Tsur * lyx2lyx/lyxconvert_218.py (change_infoinset): Convert Info insets diff --git a/lib/lyx2lyx/lyxconvert_218.py b/lib/lyx2lyx/lyxconvert_218.py index 8d40596ad8..882488d4bf 100644 --- a/lib/lyx2lyx/lyxconvert_218.py +++ b/lib/lyx2lyx/lyxconvert_218.py @@ -483,8 +483,20 @@ def change_infoinset(lines): i = find_token(lines, "\\begin_inset Info", i) if i == -1: break - lines[i:i+1] = ["\\begin_inset Note", "collapsed true", "", - "\layout Standard", ""] + txt = string.lstrip(lines[i][18:]) + new = ["\\begin_inset Note", "collapsed true", ""] + if len(txt) > 0: + new = new + ["\layout Standard", "", txt] + j = find_token(lines, "\\end_inset", i) + if j == -1: + break + for k in range(i+1, j): + new = new + ["\layout Standard", ""] + tmp = string.split(lines[k], '\\') + new = new + [tmp[0]] + for x in tmp[1:]: + new = new + ["\\backslash ", x] + lines[i:j] = new i = i+5 def change_preamble(lines):