Author: baum
Date: Mon Nov 14 22:04:00 2011
New Revision: 40194
URL: http://www.lyx.org/trac/changeset/40194

Log:
Fix bug #7895: Do not output lines with only a single space.

Modified:
   lyx-devel/branches/BRANCH_2_0_X/   (props changed)
   lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/   (props changed)
   lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/text.cpp
   lyx-devel/branches/BRANCH_2_0_X/status.20x

Modified: lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/text.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/text.cpp        Mon Nov 14 
22:00:47 2011        (r40193)
+++ lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/text.cpp        Mon Nov 14 
22:04:00 2011        (r40194)
@@ -1162,6 +1162,8 @@
 
        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");
                // store the float type for subfloats
@@ -1172,8 +1174,8 @@
                        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";

Modified: lyx-devel/branches/BRANCH_2_0_X/status.20x
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/status.20x  Mon Nov 14 22:00:47 2011        
(r40193)
+++ lyx-devel/branches/BRANCH_2_0_X/status.20x  Mon Nov 14 22:04:00 2011        
(r40194)
@@ -170,6 +170,9 @@
 
 - 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).
 

Reply via email to