From ebc464950801141403091ebf8f2adefe0419226b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Fri, 15 Feb 2008 14:13:05 +0000 Subject: [PATCH] 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 --- src/BufferParams.cpp | 6 +++++- src/frontends/qt4/GuiDocument.cpp | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 98376c5e5d..e4d241d56c 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -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; diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 3ea5e1aa83..6f020c3acd 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -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())); } -- 2.39.5