]> git.lyx.org Git - features.git/commitdiff
Fix bug 5411
authorJosé Matox <jamatos@lyx.org>
Fri, 7 Nov 2008 19:17:35 +0000 (19:17 +0000)
committerJosé Matox <jamatos@lyx.org>
Fri, 7 Nov 2008 19:17:35 +0000 (19:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27329 a592a061-630c-0410-9148-cb99ea01b6c8

development/FORMAT
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_1_6.py
src/Buffer.cpp

index 436d074f0806dfe21eb313837a01d8f4de92b018..9155e3a83f4ec44722348c44a6be2639931fe790 100644 (file)
@@ -1,6 +1,10 @@
 LyX file-format changes
 -----------------------
 
+2008-11-07 José Matos <jamatos@lyx.org>
+       * Format incremented to 345: for docbook backend CharStyle: -> Element:
+         (fix bug 5411)
+
 2008-10-12 Pavel Sanda <sanda@lyx.org>
        * Format incremented to 344: sanitize backreference settings
          for hyperref (fix bug 5340).
index 9ad4c69c35eac794328c4d8d38b0a0e20a2588d4..e5175355c7f7fe52b3accf933e8c5291bc1b5a0f 100644 (file)
@@ -79,8 +79,8 @@ format_relation = [("0_06",    [200], minor_versions("0.6" , 4)),
                    ("1_2",     [220], minor_versions("1.2" , 4)),
                    ("1_3",     [221], minor_versions("1.3" , 7)),
                    ("1_4", range(222,246), minor_versions("1.4" , 5)),
-                   ("1_5", range(246,277), minor_versions("1.5" , 5)),
-                   ("1_6",     []   , minor_versions("1.6" , 0))]
+                   ("1_5", range(246,277), minor_versions("1.5" , 6)),
+                   ("1_6", range(277,346), minor_versions("1.6" , 0))]
 
 ####################################################################
 # This is useful just for development versions                     #
@@ -113,7 +113,7 @@ def get_backend(textclass):
     " For _textclass_ returns its backend."
     if textclass == "linuxdoc" or textclass == "manpage":
         return "linuxdoc"
-    if textclass[:7] == "docbook":
+    if textclass.startswith("docbook") or textclass.startswith("agu-"):
         return "docbook"
     return "latex"
 
index 46855ecc4a1f464170ba06fc17b8c273c0d05ee9..cefeea3ee2bdf4550f1d002ca4c40cb5b7d98cf2 100644 (file)
@@ -3052,6 +3052,31 @@ def convert_backref_options(document):
     elif k != -1 and j != -1:
         document.header[k] = "\\pdf_backref section"
 
+
+def convert_charstyle_element(document):
+    "Convert CharStyle to Element for docbook backend"
+    if document.backend != "docbook":
+        return
+    i = 0
+    while True:
+        i = find_token(document.body, "\\begin_inset Flex CharStyle:", i)
+        if i == -1:
+            return
+        document.body[i] = document.body[i].replace('\\begin_inset Flex CharStyle:',
+                                                    '\\begin_inset Flex Element:')
+
+def revert_charstyle_element(document):
+    "Convert Element to CharStyle for docbook backend"
+    if document.backend != "docbook":
+        return
+    i = 0
+    while True:
+        i = find_token(document.body, "\\begin_inset Flex Element:", i)
+        if i == -1:
+            return
+        document.body[i] = document.body[i].replace('\\begin_inset Flex Element:',
+                                                    '\\begin_inset Flex CharStyle:')
+
 ##
 # Conversion hub
 #
@@ -3124,10 +3149,12 @@ convert = [[277, [fix_wrong_tables]],
            [341, []],
            [342, []],
            [343, [convert_default_options]],
-           [344, [convert_backref_options]]
+           [344, [convert_backref_options]],
+           [345, [convert_charstyle_element]]
           ]
 
-revert =  [[343, [revert_backref_options]],
+revert =  [[344, [revert_charstyle_element]],
+           [343, [revert_backref_options]],
            [342, [revert_default_options]],
            [341, [revert_mongolian]],
            [340, [revert_tabulators, revert_tabsize]],
index 44e35ab607e48a77e6bc55397a6a21526e3874c1..418ea5447fdfbfdecb052b7bcdf03a2e6a7394eb 100644 (file)
@@ -117,7 +117,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 344;  // ps: backref
+int const LYX_FORMAT = 345;  // jamatos: xml elements
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;