]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
another fix
[lyx.git] / src / BufferView_pimpl.C
index 5b20865439a6eaa348142c15a0248a0407b5de01..163629c76a2be3a803e04dc8b1047fdf0bab7004 100644 (file)
@@ -44,7 +44,6 @@
 
 #include "insets/insetbib.h"
 #include "insets/insettext.h"
-#include "insets/inseturl.h"
 #include "insets/insetlatexaccent.h"
 #include "insets/insettoc.h"
 #include "insets/insetindex.h"
@@ -364,13 +363,13 @@ void BufferView::Pimpl::scrollDocView(int value)
 {
        lyxerr[Debug::GUI] << "scrollDocView of " << value << endl;
 
-       if (!buffer_) return;
+       if (!buffer_)
+               return;
 
        screen().draw(bv_->text, bv_, value);
 
-       if (!lyxrc.cursor_follows_scrollbar) {
+       if (!lyxrc.cursor_follows_scrollbar)
                return;
-       }
 
        LyXText * vbt = bv_->text;
 
@@ -903,6 +902,10 @@ 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) {
@@ -1064,32 +1067,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        }
        break;
 
-       case LFUN_HTMLURL:
-       case LFUN_URL:
-       {
-               InsetCommandParams p;
-               if (ev.action == LFUN_HTMLURL)
-                       p.setCmdName("htmlurl");
-               else
-                       p.setCmdName("url");
-               owner_->getDialogs().createUrl(p.getAsString());
-       }
-       break;
-
-       case LFUN_INSERT_URL:
-       {
-               InsetCommandParams p;
-               p.setFromString(ev.argument);
-
-               InsetUrl * inset = new InsetUrl(p);
-               if (!insertInset(inset))
-                       delete inset;
-               else
-                       updateInset(inset, true);
-       }
-       break;
-
-
        // --- accented characters ---------------------------
 
        case LFUN_UMLAUT:
@@ -1263,7 +1240,7 @@ bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
        // inset there otherwise this is a illegal function now
        if (bv_->theLockingInset()) {
                if (bv_->theLockingInset()->insetAllowed(inset))
-                   return bv_->theLockingInset()->insertInset(bv_, inset);
+                       return bv_->theLockingInset()->insertInset(bv_, inset);
                return false;
        }