]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpace.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetSpace.cpp
index 11f33617897d604e1459b547806124a682f3571b..bdc7d51d5eb9e5f595531ef8cabe33d0f335a46d 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "InsetSpace.h"
 
-#include "support/debug.h"
 #include "Dimension.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
@@ -24,6 +23,7 @@
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
 
+#include "support/debug.h"
 #include "support/docstream.h"
 
 using namespace std;
@@ -69,7 +69,7 @@ void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
                        break;
                case ENSPACE:
                case ENSKIP:
-                       dim.wid = 0.5 * fm.width(char_type('M'));
+                       dim.wid = int(0.5 * fm.width(char_type('M')));
                        break;
        }
        // Cache the inset dimension. 
@@ -87,7 +87,7 @@ void InsetSpace::draw(PainterInfo & pi, int x, int y) const
 
        xp[0] = x;
        yp[0] = y - max(h / 4, 1);
-       if (kind_ == NORMAL) {
+       if (kind_ == NORMAL || kind_ == PROTECTED) {
                xp[1] = x;     yp[1] = y;
                xp[2] = x + w; yp[2] = y;
        } else {
@@ -225,10 +225,9 @@ int InsetSpace::docbook(Buffer const &, odocstream & os,
 }
 
 
-int InsetSpace::textString(Buffer const & buf, odocstream & os,
-                      OutputParams const & op) const
+void InsetSpace::textString(Buffer const & buf, odocstream & os) const
 {
-       return plaintext(buf, os, op);
+       plaintext(buf, os, OutputParams(0));
 }