]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/text.cpp
Fix bug #7895: Do not output lines with only a single space.
[lyx.git] / src / tex2lyx / text.cpp
index 7babea1650bc0d6b260af520863040b3b7c8b190..bf3ea8c2bd4c0e032473cca8ff84d4a42ba62833 100644 (file)
@@ -1186,6 +1186,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");
@@ -1197,8 +1199,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<string>(is_starred)
                   << "\nsideways false"
                   << "\nstatus open\n\n";