#include "insetspecialchar.h"
#include "debug.h"
#include "LaTeXFeatures.h"
+#include "BufferView.h"
#include "Painter.h"
#include "font.h"
}
-void InsetSpecialChar::draw(Painter & pain, LyXFont const & f,
- int baseline, float & x) const
+void InsetSpecialChar::draw(BufferView * bv, LyXFont const & f,
+ int baseline, float & x, bool) const
{
+ Painter & pain = bv->painter();
LyXFont font(f);
+
switch (kind) {
case HYPHENATION:
{
// In lyxf3 this will be just LaTeX
-void InsetSpecialChar::Write(ostream & os) const
+void InsetSpecialChar::Write(Buffer const *, ostream & os) const
{
string command;
switch (kind) {
case LDOTS: command = "\\ldots{}"; break;
case MENU_SEPARATOR: command = "\\menuseparator"; break;
case PROTECTED_SEPARATOR:
- command = "\\protected_separator"; break;
+ //command = "\\protected_separator";
+ command = "~";
+ break;
}
os << "\\SpecialChar " << command << "\n";
}
// This function will not be necessary when lyx3
-void InsetSpecialChar::Read(LyXLex & lex)
+void InsetSpecialChar::Read(Buffer const *, LyXLex & lex)
{
lex.nextToken();
string command = lex.GetString();
kind = LDOTS;
else if (command == "\\menuseparator")
kind = MENU_SEPARATOR;
- else if (command == "\\protected_separator")
+ else if (command == "\\protected_separator"
+ || command == "~")
kind = PROTECTED_SEPARATOR;
else
lex.printError("InsetSpecialChar: Unknown kind: `$$Token'");
}
-int InsetSpecialChar::Latex(ostream & os, bool /*fragile*/,
+int InsetSpecialChar::Latex(Buffer const *, ostream & os, bool /*fragile*/,
bool free_space) const
{
switch (kind) {
return 0;
}
-int InsetSpecialChar::Ascii(ostream & os) const
+int InsetSpecialChar::Ascii(Buffer const *, ostream & os) const
{
switch (kind) {
case HYPHENATION: break;
}
-int InsetSpecialChar::Linuxdoc(ostream & os) const
+int InsetSpecialChar::Linuxdoc(Buffer const * buf, ostream & os) const
{
- return Ascii(os);
+ return Ascii(buf, os);
}
-int InsetSpecialChar::DocBook(ostream & os) const
+int InsetSpecialChar::DocBook(Buffer const * buf, ostream & os) const
{
- return Ascii(os);
+ return Ascii(buf, os);
}