}
-auto_ptr<InsetBase> InsetLatexAccent::clone() const
+auto_ptr<InsetBase> InsetLatexAccent::doClone() const
{
return auto_ptr<InsetBase>(new InsetLatexAccent(contents));
}
return;
}
- // REMOVE IN 0.13
- // Dirty Hack for backward compability. remove in 0.13 (Lgb)
contents = trim(contents);
- if (!contains(contents, "{") && !contains(contents, "}")) {
- if (contents.length() == 2) {
- string tmp;
- tmp += contents[0];
- tmp += contents[1];
- tmp += "{}";
- contents = tmp;
- } else if (contents.length() == 3) {
- string tmp;
- tmp += contents[0];
- tmp += contents[1];
- tmp += '{';
- tmp += contents[2];
- tmp += '}';
- contents = tmp;
- } else if (contents.length() == 4 && contents[2] == ' ') {
- string tmp;
- tmp += contents[0];
- tmp += contents[1];
- tmp += '{';
- tmp += contents[3];
- tmp += '}';
- contents = tmp;
- } else if (contents.length() == 4 && contents[2] == '\\'
- && (contents[3] == 'i' || contents[3] == 'j')) {
- string tmp;
- tmp += contents[0];
- tmp += contents[1];
- tmp += '{';
- tmp += contents[2];
- tmp += contents[3];
- tmp += '}';
- contents = tmp;
- }
- }
if (contents[0] != '\\') { // demand that first char is a '\\'
lyxerr[Debug::KEY] << "Cannot decode: " << contents << endl;
return;
break;
default:
lyxerr[Debug::KEY] << "Default" << endl;
- // unknow accent (or something else)
+ // unknown accent (or something else)
return;
}
switch (modtype) {
case CEDILLA: {
- if (ic == 'c') tmpic = 0xe7;
- if (ic == 'C') tmpic = 0xc7;
- if (ic == 's') tmpic = 0xfe;
- if (ic == 'S') tmpic = 0xde;
+ if (ic == 'c') tmpic = '\xe7';
+ if (ic == 'C') tmpic = '\xc7';
+ if (ic == 's') tmpic = '\xfe';
+ if (ic == 'S') tmpic = '\xde';
break;
}
case BREVE: {
- if (ic == 'g') tmpic = 0xf0;
- if (ic == 'G') tmpic = 0xd0;
+ if (ic == 'g') tmpic = '\xf0';
+ if (ic == 'G') tmpic = '\xd0';
break;
}
case UMLAUT: {
- if (ic == 'o') tmpic = 0xf6;
- if (ic == 'O') tmpic = 0xd6;
- if (ic == 'u') tmpic = 0xfc;
- if (ic == 'U') tmpic = 0xdc;
+ if (ic == 'o') tmpic = '\xf6';
+ if (ic == 'O') tmpic = '\xd6';
+ if (ic == 'u') tmpic = '\xfc';
+ if (ic == 'U') tmpic = '\xdc';
break;
}
case DOT:
- if (ic == 'I') tmpic = 0xdd;
+ if (ic == 'I') tmpic = '\xdd';
break;
case DOT_LESS_I:
- tmpic = 0xfd;
+ tmpic = '\xfd';
break;
default:
// closer to the top of the dot-less 'i' or 'j'.
char tmpic = ic; // store the ic when we
ic = 'x'; // calculates the ascent of
+#ifdef WITH_WARNINGS
#warning metrics?
+#endif
int asc = ascent(); // the dot-less version (here: 'x')
ic = tmpic; // set the orig ic back
y = baseline - asc; // update to new y coord.
// now the rest - draw within (x, y, x + wid, y + hg)
switch (modtype) {
case ACUTE:
- drawAccent(pi, x2, baseline, char(0xB4));
+ drawAccent(pi, x2, baseline, '\xB4');
break;
-
- case GRAVE:
- drawAccent(pi, x2, baseline, char(0x60));
+
+ case GRAVE:
+ drawAccent(pi, x2, baseline, '\x60');
break;
case MACRON:
- drawAccent(pi, x2, baseline, char(0xAF));
+ drawAccent(pi, x2, baseline, '\xAF');
break;
case TILDE:
drawAccent(pi, x2, baseline, '~');
break;
- case UNDERBAR: // underbar 0x5F
- pi.pain.text(x2 - font_metrics::center(0x5F, font), baseline,
- char(0x5F), font);
+ case UNDERBAR: {
+ char const underbar('\x5F');
+ pi.pain.text(x2 - font_metrics::center(underbar, font),
+ baseline, underbar, font);
break;
+ }
- case CEDILLA:
- pi.pain.text(x2 - font_metrics::center(0xB8, font), baseline,
- char(0xB8), font);
+ case CEDILLA: {
+ char const cedilla('\xB8');
+ pi.pain.text(x2 - font_metrics::center(cedilla, font),
+ baseline, cedilla, font);
break;
+ }
case UNDERDOT:
pi.pain.text(x2 - font_metrics::center('.', font),
drawAccent(pi, x2, baseline, '.');
break;
- case CIRCLE:
- drawAccent(pi, x2, baseline, char(0xB0));
+ case CIRCLE:
+ drawAccent(pi, x2, baseline, '\xB0');
break;
case TIE:
break;
case CIRCUMFLEX:
- drawAccent(pi, x2, baseline, 0x5E);
+ drawAccent(pi, x2, baseline, '\x5E');
break;
case OGONEK: {
int InsetLatexAccent::latex(Buffer const &, ostream & os,
- LatexRunParams const &) const
+ OutputParams const &) const
{
os << contents;
return 0;
}
-int InsetLatexAccent::ascii(Buffer const &, ostream & os, int) const
+int InsetLatexAccent::plaintext(Buffer const &, ostream & os,
+ OutputParams const &) const
{
os << contents;
return 0;
}
-int InsetLatexAccent::linuxdoc(Buffer const &, ostream & os) const
+int InsetLatexAccent::linuxdoc(Buffer const &, ostream & os,
+ OutputParams const &) const
{
os << contents;
return 0;
}
-int InsetLatexAccent::docbook(Buffer const &, ostream & os, bool) const
+int InsetLatexAccent::docbook(Buffer const &, ostream & os,
+ OutputParams const &) const
{
os << contents;
return 0;
}
+int InsetLatexAccent::textString(Buffer const & buf, ostream & os,
+ OutputParams const & op) const
+{
+ return plaintext(buf, os, op);
+}
+
+
bool InsetLatexAccent::directWrite() const
{
return true;
}
-InsetOld::Code InsetLatexAccent::lyxCode() const
+InsetBase::Code InsetLatexAccent::lyxCode() const
{
- return InsetOld::ACCENT_CODE;
+ return InsetBase::ACCENT_CODE;
}