#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
-using lyx::docstring;
+
+namespace lyx {
using std::string;
using std::auto_ptr;
}
-void InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetSpecialChar::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();
dim.wid = fm.width(ds);
if (kind_ == HYPHENATION && dim.wid > 5)
dim.wid -= 2; // to make it look shorter
+ bool const changed = dim_ != dim;
dim_ = dim;
+ return changed;
}
case HYPHENATION:
{
font.setColor(LColor::special);
- pi.pain.text(x, y, lyx::char_type('-'), font);
+ pi.pain.text(x, y, char_type('-'), font);
break;
}
case LIGATURE_BREAK:
{
font.setColor(LColor::special);
- pi.pain.text(x, y, lyx::char_type('|'), font);
+ pi.pain.text(x, y, char_type('|'), font);
break;
}
case END_OF_SENTENCE:
{
font.setColor(LColor::special);
- pi.pain.text(x, y, lyx::char_type('.'), font);
+ pi.pain.text(x, y, char_type('.'), font);
break;
}
case LDOTS:
}
case MENU_SEPARATOR:
{
- lyx::frontend::FontMetrics const & fm =
+ frontend::FontMetrics const & fm =
theFontMetrics(font);
// A triangle the width and height of an 'x'
- int w = fm.width(lyx::char_type('x'));
- int ox = fm.width(lyx::char_type(' ')) + x;
- int h = fm.ascent(lyx::char_type('x'));
+ int w = fm.width(char_type('x'));
+ int ox = fm.width(char_type(' ')) + x;
+ int h = fm.ascent(char_type('x'));
int xp[4], yp[4];
xp[0] = ox; yp[0] = y;
}
-int InsetSpecialChar::latex(Buffer const &, ostream & os,
+int InsetSpecialChar::latex(Buffer const &, odocstream & os,
OutputParams const &) const
{
switch (kind_) {
}
-int InsetSpecialChar::plaintext(Buffer const &, ostream & os,
+int InsetSpecialChar::plaintext(Buffer const &, odocstream & os,
OutputParams const &) const
{
switch (kind_) {
}
-int InsetSpecialChar::docbook(Buffer const &, ostream & os,
+int InsetSpecialChar::docbook(Buffer const &, odocstream & os,
OutputParams const &) const
{
switch (kind_) {
}
-int InsetSpecialChar::textString(Buffer const & buf, ostream & os,
+int InsetSpecialChar::textString(Buffer const & buf, odocstream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
return false;
#endif
}
+
+
+} // namespace lyx