X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetSpace.cpp;h=bdc7d51d5eb9e5f595531ef8cabe33d0f335a46d;hb=0362c6aae73c293d1c20277c12d362acfe0b2ef6;hp=83600c376b703e943ab5ba6a653fd4ca38a029b2;hpb=150cf11651ad92090a452bb9e6cb72d7eea886d5;p=lyx.git diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index 83600c376b..bdc7d51d5e 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -15,7 +15,6 @@ #include "InsetSpace.h" -#include "debug.h" #include "Dimension.h" #include "Lexer.h" #include "MetricsInfo.h" @@ -24,13 +23,12 @@ #include "frontends/FontMetrics.h" #include "frontends/Painter.h" +#include "support/debug.h" #include "support/docstream.h" -namespace lyx { +using namespace std; -using std::string; -using std::max; -using std::ostream; +namespace lyx { InsetSpace::InsetSpace() @@ -57,21 +55,21 @@ void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const switch (kind_) { case THIN: case NEGTHIN: - dim.wid = fm.width(char_type('x')) / 3; + dim.wid = fm.width(char_type('M')) / 6; break; case PROTECTED: case NORMAL: - dim.wid = fm.width(char_type('x')); + dim.wid = fm.width(char_type(' ')); break; case QUAD: - dim.wid = 20; + dim.wid = fm.width(char_type('M')); break; case QQUAD: - dim.wid = 40; + dim.wid = 2 * fm.width(char_type('M')); break; case ENSPACE: case ENSKIP: - dim.wid = 10; + dim.wid = int(0.5 * fm.width(char_type('M'))); break; } // Cache the inset dimension. @@ -89,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 { @@ -227,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)); }