commit d2b6232ce768bd4b5c7c0f7c1d36e1cf583ffb0e
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Jun 2 19:07:01 2019 +0200

    Fix lineno options param
    
    This has been written even if empty -- and thus caused reading errors.
---
 lib/doc/Customization.lyx    |    1 -
 lib/doc/UserGuide.lyx        |    1 -
 lib/doc/de/Customization.lyx |    1 -
 lib/doc/de/UserGuide.lyx     |    1 -
 lib/lyx2lyx/lyx_2_4.py       |    7 +++++--
 src/BufferParams.cpp         |    3 ++-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index d8475fe..af95f4d 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -103,7 +103,6 @@ logicalmkup
 \use_refstyle 0
 \use_minted 0
 \use_lineno 0
-\lineno_options 
 \notefontcolor #0000ff
 \branch OutDated
 \selected 0
diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx
index 6d27840..48dd928 100644
--- a/lib/doc/UserGuide.lyx
+++ b/lib/doc/UserGuide.lyx
@@ -118,7 +118,6 @@ logicalmkup
 \use_refstyle 1
 \use_minted 0
 \use_lineno 0
-\lineno_options 
 \notefontcolor #0000ff
 \branch Question
 \selected 1
diff --git a/lib/doc/de/Customization.lyx b/lib/doc/de/Customization.lyx
index f838e20..f1cde43 100644
--- a/lib/doc/de/Customization.lyx
+++ b/lib/doc/de/Customization.lyx
@@ -111,7 +111,6 @@ logicalmkup
 \use_refstyle 0
 \use_minted 0
 \use_lineno 0
-\lineno_options 
 \notefontcolor #0000ff
 \branch OutDated
 \selected 0
diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx
index 29fe9bb..814443f 100644
--- a/lib/doc/de/UserGuide.lyx
+++ b/lib/doc/de/UserGuide.lyx
@@ -123,7 +123,6 @@ logicalmkup
 \use_refstyle 1
 \use_minted 0
 \use_lineno 0
-\lineno_options 
 \notefontcolor #0000ff
 \branch Frage
 \selected 1
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 61d45f2..41c4324 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -1721,8 +1721,11 @@ def convert_lineno(document):
             del_token(document.preamble, "% Added by lyx2lyx", j-2, j-1)
 
     k = find_token(document.header, "\\index ")
-    document.header[k:k] = ["\\use_lineno %d" % use_lineno,
-                            "\\lineno_options %s" % options]
+    if options == "":
+        document.header[k:k] = ["\\use_lineno %d" % use_lineno]
+    else:
+        document.header[k:k] = ["\\use_lineno %d" % use_lineno,
+                                "\\lineno_options %s" % options]
 
 
 ##
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index dbe5d7f..3d9f717 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1329,7 +1329,8 @@ void BufferParams::writeFile(ostream & os, Buffer const * 
buf) const
           << "\n\\use_lineno " << use_lineno
           << '\n';
 
-        os << "\\lineno_options " << lineno_opts << '\n';
+       if (!lineno_opts.empty())
+               os << "\\lineno_options " << lineno_opts << '\n';
 
        if (isbackgroundcolor == true)
                os << "\\backgroundcolor " << lyx::X11hexname(backgroundcolor) 
<< '\n';

Reply via email to