]> git.lyx.org Git - features.git/commitdiff
Fixup revert_vcolumns2 routine
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 25 Jan 2021 11:04:45 +0000 (12:04 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 25 Jan 2021 11:04:45 +0000 (12:04 +0100)
lib/lyx2lyx/lyx_2_4.py

index ec6622cb6f854008725f20a566bffe2e1115c9a5..f4cb55a4285282ca9d7ede545ab90de85454c225 100644 (file)
@@ -4187,7 +4187,42 @@ def revert_vcolumns2(document):
                             flt = find_token(document.body, "\\begin_layout", begcell, endcell)
                             elt = find_token_backwards(document.body, "\\end_layout", endcell)
                             if flt != -1 and elt != -1:
-                                document.body[elt:elt+1] = put_cmd_in_ert("\\end{cellvarwidth}")
+                                extralines = []
+                                # we need to reset character layouts if necessary
+                                el = find_token(document.body, '\\emph on', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\emph default")
+                                el = find_token(document.body, '\\noun on', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\noun default")
+                                el = find_token(document.body, '\\series', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\series default")
+                                el = find_token(document.body, '\\family', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\family default")
+                                el = find_token(document.body, '\\shape', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\shape default")
+                                el = find_token(document.body, '\\color', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\color inherit")
+                                el = find_token(document.body, '\\size', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\size default")
+                                el = find_token(document.body, '\\bar under', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\bar default")
+                                el = find_token(document.body, '\\uuline on', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\uuline default")
+                                el = find_token(document.body, '\\uwave on', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\uwave default")
+                                el = find_token(document.body, '\\strikeout on', flt, elt)
+                                if el != -1:
+                                    extralines.append("\\strikeout default")
+                                document.body[elt:elt+1] = extralines + put_cmd_in_ert("\\end{cellvarwidth}") + ["\end_layout"]
                                 document.body[flt+1:flt+1] = put_cmd_in_ert("\\begin{cellvarwidth}" + alarg)
                                 needcellvarwidth = True
                                 needvarwidth = True