]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
partial framebox support
[lyx.git] / src / BufferView_pimpl.C
index 696f9197c14093ed3baec1bc7fa8a8cd03040c0b..b4a81751a22a0799ce04ac56bc27d9d5b4309102 100644 (file)
 #include "insets/inseturl.h"
 #include "insets/insetlatexaccent.h"
 #include "insets/insettoc.h"
-#include "insets/insetref.h"
-#include "insets/insetparent.h"
 #include "insets/insetindex.h"
+#include "insets/insetref.h"
 #include "insets/insetinclude.h"
 #include "insets/insetcite.h"
 #include "insets/insetgraphics.h"
 #include "insets/insetmarginal.h"
-#include "insets/insetcaption.h"
 #include "insets/insetfloatlist.h"
 
 #include "mathed/formulabase.h"
@@ -905,20 +903,14 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                << " button[" << ev.button() << "]"
                << endl;
 
+       // e.g. Qt mouse press when no buffer
+       if (!buffer_)
+               return false;
        LyXTextClass const & tclass = buffer_->params.getLyXTextClass();
 
        switch (ev.action) {
 
-       case LFUN_TOC_INSERT:
-       {
-               InsetCommandParams p;
-               p.setCmdName("tableofcontents");
-               Inset * inset = new InsetTOC(p);
-               if (!insertInset(inset, tclass.defaultLayoutName()))
-                       delete inset;
-               break;
-       }
-
        case LFUN_SCROLL_INSET:
                // this is not handled here as this function is only active
                // if we have a locking_inset and that one is (or contains)
@@ -1101,26 +1093,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        }
        break;
 
-       case LFUN_INSET_CAPTION:
-       {
-               // Do we have a locking inset...
-               if (bv_->theLockingInset()) {
-                       lyxerr << "Locking inset code: "
-                              << static_cast<int>(bv_->theLockingInset()->lyxCode());
-                       InsetCaption * new_inset =
-                               new InsetCaption(buffer_->params);
-                       new_inset->setOwner(bv_->theLockingInset());
-                       new_inset->setAutoBreakRows(true);
-                       new_inset->setDrawFrame(0, InsetText::LOCKED);
-                       new_inset->setFrameColor(0, LColor::captionframe);
-                       if (insertInset(new_inset))
-                               new_inset->edit(bv_);
-                       else
-                               delete new_inset;
-               }
-       }
-       break;
-
 
        // --- accented characters ---------------------------
 
@@ -1215,9 +1187,8 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        {
                InsetBibtex * inset =
                        static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
-               if (inset) {
+               if (inset)
                        inset->delDatabase(ev.argument);
-               }
        }
        break;
 
@@ -1225,52 +1196,11 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        {
                InsetBibtex * inset =
                        static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
-               if (inset) {
+               if (inset) 
                        inset->setOptions(ev.argument);
-               }
        }
        break;
 
-       case LFUN_INDEX_INSERT:
-       {
-               string entry = ev.argument;
-               if (entry.empty())
-                       entry = bv_->getLyXText()->getStringToIndex(bv_);
-
-               if (entry.empty()) {
-                       owner_->getDialogs().createIndex();
-                       break;
-               }
-
-               InsetIndex * inset = new InsetIndex(InsetCommandParams("index", entry));
-
-               if (!insertInset(inset)) {
-                       delete inset;
-               } else {
-                       updateInset(inset, true);
-               }
-       }
-       break;
-
-       case LFUN_INDEX_PRINT:
-       {
-               InsetCommandParams p("printindex");
-               Inset * inset = new InsetPrintIndex(p);
-               if (!insertInset(inset, tclass.defaultLayoutName()))
-                       delete inset;
-       }
-       break;
-
-       case LFUN_PARENTINSERT:
-       {
-               InsetCommandParams p("lyxparent", ev.argument);
-               Inset * inset = new InsetParent(p, *buffer_);
-               if (!insertInset(inset, tclass.defaultLayoutName()))
-                       delete inset;
-       }
-
-       break;
-
        case LFUN_CHILD_INSERT:
        {
                InsetInclude::Params p;