]> 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 f8c99d59e8ccc36e2e51fe3d220a1bda3795c1ba..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());
 
@@ -687,7 +695,6 @@ void LayoutBox::selected(int index)
        // find corresponding text class
        if (d->text_class_->hasLayout(layoutName)) {
                FuncRequest const func(LFUN_LAYOUT, layoutName, FuncRequest::TOOLBAR);
-               theLyXFunc().setLyXView(&d->owner_);
                lyx::dispatch(func);
                updateContents(false);
                d->resetFilter();