Fix a crash following the input of an invalid paragraph separation value in the document settings dialog (bug 4556).

* 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
This commit is contained in:
Jürgen Spitzmüller 2008-02-15 14:13:05 +00:00
parent fa10443c54
commit ebc4649508
2 changed files with 8 additions and 2 deletions

View File

@ -529,7 +529,11 @@ string const BufferParams::readToken(Lexer & lex, string const & token,
paragraph_separation = parseptranslator().find(parsep); paragraph_separation = parseptranslator().find(parsep);
} else if (token == "\\defskip") { } else if (token == "\\defskip") {
lex.next(); 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") { } else if (token == "\\quotes_language") {
string quotes_lang; string quotes_lang;
lex >> quotes_lang; lex >> quotes_lang;

View File

@ -2033,7 +2033,9 @@ void GuiDocument::useClassDefaults()
bool GuiDocument::isValid() bool GuiDocument::isValid()
{ {
return validate_listings_params().empty(); return (validate_listings_params().empty() &&
(textLayoutModule->skipCO->currentIndex() != 3 ||
!textLayoutModule->skipLE->text().isEmpty()));
} }