#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
-using lyx::odocstream;
-using lyx::odocstream;
+namespace lyx {
using std::string;
using std::max;
}
-void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
{
- lyx::frontend::FontMetrics const & fm =
+ frontend::FontMetrics const & fm =
theFontMetrics(mi.base.font);
dim.asc = fm.maxAscent();
dim.des = fm.maxDescent();
switch (kind_) {
case THIN:
case NEGTHIN:
- dim.wid = fm.width(lyx::char_type('x')) / 3;
+ dim.wid = fm.width(char_type('x')) / 3;
break;
case PROTECTED:
case NORMAL:
- dim.wid = fm.width(lyx::char_type('x'));
+ dim.wid = fm.width(char_type('x'));
break;
case QUAD:
dim.wid = 20;
dim.wid = 10;
break;
}
+ bool const changed = dim_ != dim;
dim_ = dim;
+ return changed;
}
int InsetSpace::latex(Buffer const &, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
switch (kind_) {
case NORMAL:
int InsetSpace::plaintext(Buffer const &, odocstream & os,
- OutputParams const &) const
+ OutputParams const &) const
{
- switch (kind_) {
- case NORMAL:
- case PROTECTED:
- case THIN:
- case QUAD:
- case QQUAD:
- case ENSPACE:
- case ENSKIP:
- case NEGTHIN:
- os << ' ';
- break;
- }
- return 0;
+ os << ' ';
+ return 1;
}
int InsetSpace::docbook(Buffer const &, odocstream & os,
- OutputParams const &) const
+ OutputParams const &) const
{
switch (kind_) {
case NORMAL:
{
return true;
}
+
+
+} // namespace lyx