]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/LayoutBox.cpp
Fix handling of the add branch textfield in GuiBranches
[lyx.git] / src / frontends / qt4 / LayoutBox.cpp
index 23017cf6f89e8f8d75ecedfdca2528560bf206b6..df4b076a279deaa9e57bd1299b423f2167188e85 100644 (file)
@@ -26,7 +26,7 @@
 #include "Cursor.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "LyXFunc.h"
+#include "LyX.h"
 #include "LyXRC.h"
 #include "Paragraph.h"
 #include "TextClass.h"
@@ -418,6 +418,11 @@ LayoutBox::LayoutBox(GuiView & owner)
 }
 
 
+LayoutBox::~LayoutBox() {
+       delete d;
+}
+
+
 void LayoutBox::Private::countCategories()
 {
        int n = filterModel_->rowCount();
@@ -529,6 +534,9 @@ void LayoutBox::set(docstring const & layout)
        if (!d->text_class_)
                return;
 
+       if (!(*d->text_class_).hasLayout(layout))
+               return;
+
        Layout const & lay = (*d->text_class_)[layout];
        QString newLayout = toqstr(lay.name());