]> git.lyx.org Git - features.git/commitdiff
Polish plural and capitalized reference reversion.
authorRichard Heck <rgheck@lyx.org>
Thu, 5 Jan 2017 07:50:18 +0000 (02:50 -0500)
committerRichard Heck <rgheck@lyx.org>
Thu, 5 Jan 2017 07:50:18 +0000 (02:50 -0500)
Thanks to Scott for noticing the problem.

lib/doc/de/Additional.lyx
lib/lyx2lyx/lyx_2_3.py

index 2397c544ce92d6828086b92951258e9c2d5588a3..5c6bc9b46efe32b616881e274a5c1cc6930b0f04 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 526
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -51,6 +51,7 @@ shapepar
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
+\use_microtype false
 \graphics default
 \default_output_format pdf2
 \output_sync 0
@@ -103,7 +104,8 @@ shapepar
 \tocdepth 3
 \paragraph_separation indent
 \paragraph_indentation default
-\quotes_language german
+\quotes_style german
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 2
 \paperpagestyle headings
@@ -777,8 +779,10 @@ tex2lyx
 -Datei einsetzen
  wollen, lesen Sie Abschnitt 
 \begin_inset CommandInset ref
-LatexCommand vref
+LatexCommand formatted
 reference "sec:LaTeX-Code"
+plural "false"
+caps "false"
 
 \end_inset
 
@@ -8281,7 +8285,6 @@ aa.cls
 
 \begin_layout Standard
 \align center
-
 \begin_inset Flex URL
 status collapsed
 
@@ -14066,8 +14069,6 @@ Unsichtbarer Text
 
 \family sans
 SichtbarerText
-\family default
-
 \end_layout
 
 \begin_deeper
@@ -15951,8 +15952,6 @@ Left
 \end_inset
 
 Header
-\family default
-
 \end_layout
 
 \begin_deeper
index e3eab80c16fffd74e52b2270fdfa19533ba405bb..efabaed14c3454f7c7ec3eeb73958015f0a02016 100644 (file)
@@ -1101,18 +1101,24 @@ def revert_plural_refs(document):
             i += 1
             continue
 
-        plural = caps = label = False
-        if use_refstyle:
+        plural = caps = suffix = False
+        k = find_token(document.body, "LaTeXCommand formatted", i, j)
+        if k != -1 and use_refstyle:
             plural = get_bool_value(document.body, "plural", i, j, False)
             caps   = get_bool_value(document.body, "caps", i, j, False)
             label  = get_quoted_value(document.body, "reference", i, j)
             if label:
-                (prefix, suffix) = label.split(":", 1)
+                try:
+                    (prefix, suffix) = label.split(":", 1)
+                except:
+                    document.warning("No `:' separator in formatted reference at line %d!" % (i))
             else:
                 document.warning("Can't find label for reference at line %d!" % (i))
 
-        # this effectively tests also for use_refstyle
-        if not ((plural or caps) and label):
+        # this effectively tests also for use_refstyle and a formatted reference
+        # we do this complicated test because we would otherwise do this erasure
+        # over and over and over
+        if not ((plural or caps) and suffix):
             del_token(document.body, "plural", i, j)
             del_token(document.body, "caps", i, j - 1) # since we deleted a line
             i = j - 1