]> 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 55888d5ec173cfb11e5190d2a595f8c2e60736b5..df4b076a279deaa9e57bd1299b423f2167188e85 100644 (file)
@@ -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());