]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseterror.C
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / inseterror.C
index 08b9b4179e768e8940360fe781d9c37d8aeb4802..38135356cd1a57c4bf2463967c00f912efdb0567 100644 (file)
 
 #include <config.h>
 
+#include "inseterror.h"
 
 #include "BufferView.h"
-#include "frontends/font_metrics.h"
-#include "lyxfont.h"
+#include "funcrequest.h"
 #include "gettext.h"
-#include "inseterror.h"
+#include "lyxfont.h"
+
+#include "frontends/Dialogs.h"
+#include "frontends/font_metrics.h"
 #include "frontends/LyXView.h"
 #include "frontends/Painter.h"
-#include "frontends/Dialogs.h"
+
 #include "support/LAssert.h"
 
 using std::ostream;
@@ -32,8 +35,24 @@ InsetError::InsetError(string const & str, bool)
 
 InsetError::~InsetError()
 {
-       if (view())
-               view()->owner()->getDialogs().hide("error");
+       Dialogs::hide("error", this);
+}
+
+
+dispatch_result InsetError::localDispatch(FuncRequest const & cmd)
+{
+       dispatch_result result = UNDISPATCHED;
+
+       switch (cmd.action) {
+       case LFUN_MOUSE_RELEASE:
+               edit(cmd.view(), cmd.x, cmd.y, cmd.button());
+               break;
+
+       default:
+               break;
+       }
+
+       return result;
 }
 
 
@@ -62,7 +81,7 @@ int InsetError::width(BufferView *, LyXFont const & font) const
 
 
 void InsetError::draw(BufferView * bv, LyXFont const & font,
-                     int baseline, float & x, bool) const
+                     int baseline, float & x) const
 {
        lyx::Assert(bv);
        cache(bv);