]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetvspace.C
changelogs
[lyx.git] / src / insets / insetvspace.C
index 7b7c9a3998676c577679669d3d477f2e59578a03..c6596972fa2e4d9d0f2df6470e75a931e18fe2e4 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "buffer.h"
 #include "BufferView.h"
+#include "cursor.h"
 #include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -26,7 +27,7 @@
 #include "frontends/font_metrics.h"
 #include "frontends/Painter.h"
 
-#include "support/std_sstream.h"
+#include <sstream>
 
 using std::istringstream;
 using std::ostream;
@@ -53,29 +54,28 @@ InsetVSpace::~InsetVSpace()
 }
 
 
-std::auto_ptr<InsetBase> InsetVSpace::clone() const
+std::auto_ptr<InsetBase> InsetVSpace::doClone() const
 {
        return std::auto_ptr<InsetBase>(new InsetVSpace(*this));
 }
 
 
-DispatchResult
-InsetVSpace::priv_dispatch(FuncRequest const & cmd,
-                          idx_type & idx, pos_type & pos)
+void InsetVSpace::doDispatch(LCursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
 
        case LFUN_INSET_MODIFY: {
                InsetVSpaceMailer::string2params(cmd.argument, space_);
-               return DispatchResult(true, true);
+               break;
        }
 
        case LFUN_MOUSE_PRESS:
-               InsetVSpaceMailer(*this).showDialog(cmd.view());
-               return DispatchResult(true, true);
+               InsetVSpaceMailer(*this).showDialog(&cur.bv());
+               break;
 
        default:
-               return InsetOld::priv_dispatch(cmd, idx, pos);
+               InsetOld::doDispatch(cur, cmd);
+               break;
        }
 }
 
@@ -129,8 +129,7 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
 {
        static std::string const label = _("Vertical Space");
 
-       xo_ = x;
-       yo_ = y;
+       setPosCache(pi, x, y);
 
        x += ADD_TO_VSPACE_WIDTH;