]> git.lyx.org Git - features.git/commitdiff
Don't say empty layouts are valid.
authorRichard Heck <rgheck@comcast.net>
Fri, 3 Sep 2010 13:33:05 +0000 (13:33 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 3 Sep 2010 13:33:05 +0000 (13:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35272 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiDocument.cpp

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