]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpace.cpp
- Simplify prefs, graphics and external display options which are now true or false.
[lyx.git] / src / insets / InsetSpace.cpp
index 86e690a77744b4433b2e97cd60016c304273d6df..c9156d4e51136255c9ceabaac876277baf66806f 100644 (file)
@@ -441,13 +441,12 @@ void InsetSpaceParams::read(Lexer & lex)
 
        if (lex.checkFor("\\length"))
                lex >> length;
-       lex >> "\\end_inset";
 }
 
 
 void InsetSpace::write(ostream & os) const
 {
-       os << "Space ";
+       os << "space ";
        params_.write(os);
 }
 
@@ -455,6 +454,7 @@ void InsetSpace::write(ostream & os) const
 void InsetSpace::read(Lexer & lex)
 {
        params_.read(lex);
+       lex >> "\\end_inset";
 }
 
 
@@ -632,7 +632,11 @@ void InsetSpace::string2params(string const & in, InsetSpaceParams & params)
        lex.setContext("InsetSpace::string2params");
        lex >> "space";
 
-       params.read(lex);
+       // There are cases, such as when we are called via getStatus() from
+       // Dialog::canApply(), where we are just called with "space" rather
+       // than a full "space \type{}\n\\end_inset".
+       if (lex.isOK())
+               params.read(lex);
 }