From d2b6232ce768bd4b5c7c0f7c1d36e1cf583ffb0e Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 2 Jun 2019 19:07:01 +0200 Subject: [PATCH] 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 d8475feb7f..af95f4db37 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 6d27840353..48dd928789 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 f838e20c54..f1cde43027 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 29fe9bb51a..814443f6c9 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 61d45f282b..41c4324013 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 dbe5d7fc27..3d9f717275 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';