]> git.lyx.org Git - features.git/commitdiff
Fix a crash following the input of an invalid paragraph separation value in the docum...
authorJürgen Spitzmüller <spitz@lyx.org>
Fri, 15 Feb 2008 14:13:05 +0000 (14:13 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Fri, 15 Feb 2008 14:13:05 +0000 (14:13 +0000)
* src/frontends/qt4/GuiDocument.cpp:
- disallow input of defskip length without actual length value.

* src/BufferParams.cpp (readToken):
- there might be documents with the invalif "\defskip defskip" param. Reset this to "\defskip medskip".

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23022 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferParams.cpp
src/frontends/qt4/GuiDocument.cpp

index 98376c5e5d9f3a75b37adcda9001798faa4b19ce..e4d241d56c5664ba65be38f4c2f2437aab3b065c 100644 (file)
@@ -529,7 +529,11 @@ string const BufferParams::readToken(Lexer & lex, string const & token,
                paragraph_separation = parseptranslator().find(parsep);
        } else if (token == "\\defskip") {
                lex.next();
-               pimpl_->defskip = VSpace(lex.getString());
+               string defskip = lex.getString();
+               if (defskip == "defskip")
+                       // this is invalid
+                       defskip = "medskip";
+               pimpl_->defskip = VSpace(defskip);
        } else if (token == "\\quotes_language") {
                string quotes_lang;
                lex >> quotes_lang;
index 3ea5e1aa83bfb6c069289904b9f7d5be42b9ac74..6f020c3acdb68ab2760917c2de172c041d8a0111 100644 (file)
@@ -2033,7 +2033,9 @@ void GuiDocument::useClassDefaults()
 
 bool GuiDocument::isValid()
 {
-       return validate_listings_params().empty();
+       return (validate_listings_params().empty() &&
+               (textLayoutModule->skipCO->currentIndex() != 3 ||
+                !textLayoutModule->skipLE->text().isEmpty()));
 }