]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetVSpace.cpp
* src/insets/InsetListingsParams.cpp: fix user message
[lyx.git] / src / insets / InsetVSpace.cpp
index 89d1f01bf89ed8905e0a7ef46c59e886f84c1284..e4be4510145f9cafd19aea76a64692bb5c99e743 100644 (file)
 #include "InsetVSpace.h"
 
 #include "Buffer.h"
-#include "LCursor.h"
+#include "Cursor.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
 #include "Lexer.h"
-#include "LyXText.h"
+#include "Text.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 
@@ -57,13 +57,13 @@ InsetVSpace::~InsetVSpace()
 }
 
 
-std::auto_ptr<InsetBase> InsetVSpace::doClone() const
+std::auto_ptr<Inset> InsetVSpace::doClone() const
 {
-       return std::auto_ptr<InsetBase>(new InsetVSpace(*this));
+       return std::auto_ptr<Inset>(new InsetVSpace(*this));
 }
 
 
-void InsetVSpace::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetVSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
 
@@ -73,11 +73,12 @@ void InsetVSpace::doDispatch(LCursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_MOUSE_RELEASE:
-               InsetVSpaceMailer(*this).showDialog(&cur.bv());
+               if (!cur.selection())
+                       InsetVSpaceMailer(*this).showDialog(&cur.bv());
                break;
 
        default:
-               InsetBase::doDispatch(cur, cmd);
+               Inset::doDispatch(cur, cmd);
                break;
        }
 }
@@ -123,7 +124,7 @@ bool InsetVSpace::metrics(MetricsInfo & mi, Dimension & dim) const
        if (space_.length().len().value() >= 0.0)
                height = max(height, space_.inPixels(*mi.base.bv));
 
-       LyXFont font;
+       Font font;
        font.decSize();
        font.decSize();
 
@@ -178,8 +179,8 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
        int a = 0;
        int d = 0;
 
-       LyXFont font;
-       font.setColor(LColor::added_space);
+       Font font;
+       font.setColor(Color::added_space);
        font.decSize();
        font.decSize();
        docstring const lab = label();
@@ -187,23 +188,23 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
 
        pi.pain.rectText(x + 2 * arrow_size + 5,
                         start + (end - start) / 2 + (a - d) / 2,
-                        lab, font, LColor::none, LColor::none);
+                        lab, font, Color::none, Color::none);
 
        // top arrow
-       pi.pain.line(x, ty1, midx, ty2, LColor::added_space);
-       pi.pain.line(midx, ty2, rightx, ty1, LColor::added_space);
+       pi.pain.line(x, ty1, midx, ty2, Color::added_space);
+       pi.pain.line(midx, ty2, rightx, ty1, Color::added_space);
 
        // bottom arrow
-       pi.pain.line(x, by1, midx, by2, LColor::added_space);
-       pi.pain.line(midx, by2, rightx, by1, LColor::added_space);
+       pi.pain.line(x, by1, midx, by2, Color::added_space);
+       pi.pain.line(midx, by2, rightx, by1, Color::added_space);
 
        // joining line
-       pi.pain.line(midx, ty2, midx, by2, LColor::added_space);
+       pi.pain.line(midx, ty2, midx, by2, Color::added_space);
 }
 
 
 int InsetVSpace::latex(Buffer const & buf, odocstream & os,
-                       OutputParams const &) const
+                      OutputParams const &) const
 {
        os << from_ascii(space_.asLatexCommand(buf.params())) << '\n';
        return 1;
@@ -211,7 +212,7 @@ int InsetVSpace::latex(Buffer const & buf, odocstream & os,
 
 
 int InsetVSpace::plaintext(Buffer const &, odocstream & os,
-                           OutputParams const &) const
+                          OutputParams const &) const
 {
        os << "\n\n";
        return PLAINTEXT_NEWLINE;
@@ -219,7 +220,7 @@ int InsetVSpace::plaintext(Buffer const &, odocstream & os,
 
 
 int InsetVSpace::docbook(Buffer const &, odocstream & os,
-                         OutputParams const &) const
+                        OutputParams const &) const
 {
        os << '\n';
        return 1;