Don't say empty layouts are valid.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35272 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-09-03 13:33:05 +00:00
parent 4db466495b
commit a5cb539d08

View File

@ -583,12 +583,15 @@ void LocalLayout::validate() {
toqstr("<p style=\"color: #c00000; font-weight: bold; \">") toqstr("<p style=\"color: #c00000; font-weight: bold; \">")
+ invalid + toqstr("</p>"); + invalid + toqstr("</p>");
string const layout = fromqstr(locallayoutTE->document()->toPlainText()); string const layout =
if (layout.empty()) fromqstr(locallayoutTE->document()->toPlainText().trimmed());
if (layout.empty()) {
is_valid_ = true; is_valid_ = true;
else infoLB->setText("");
} else {
is_valid_ = TextClass::validate(layout); is_valid_ = TextClass::validate(layout);
infoLB->setText(is_valid_ ? vtext : ivtext); infoLB->setText(is_valid_ ? vtext : ivtext);
}
validatePB->setEnabled(false); validatePB->setEnabled(false);
} }