From b6eb513d9464f179ea278b4204ba48fe60b87a4a Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 14 Nov 2011 21:04:00 +0000 Subject: [PATCH] Fix bug #7895: Do not output lines with only a single space. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40194 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/text.cpp | 6 ++++-- status.20x | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 7c3dcc2da7..bd7a0d203c 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1161,6 +1161,8 @@ void parse_environment(Parser & p, ostream & os, bool outer, } else if (parent_context.textclass.floats().typeExist(unstarred_name)) { + eat_whitespace(p, os, parent_context, false); + string const opt = p.hasOpt() ? p.getArg('[', ']') : string(); eat_whitespace(p, os, parent_context, false); parent_context.check_layout(os); begin_inset(os, "Float " + unstarred_name + "\n"); @@ -1172,8 +1174,8 @@ void parse_environment(Parser & p, ostream & os, bool outer, float_type = unstarred_name; else float_type = ""; - if (p.hasOpt()) - os << "placement " << p.getArg('[', ']') << '\n'; + if (!opt.empty()) + os << "placement " << opt << '\n'; os << "wide " << convert(is_starred) << "\nsideways false" << "\nstatus open\n\n"; diff --git a/status.20x b/status.20x index a4c0927c86..14181e410f 100644 --- a/status.20x +++ b/status.20x @@ -170,6 +170,9 @@ What's new - Fix tex2lyx handling of description \item with spaces (bug 7663). +- tex2lyx does not start floats with lines containing only a single space + anymore (bug 7895). + - Store the autosave files of unnamed buffers in the correct directory and make sure they are not left behind after saving (bug 7793). -- 2.39.5