* Licence details can be found in the file COPYING.
*
* \author Alejandro Aguilar Sierra
- * \author André Pönitz
+ * \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include "BufferView.h"
#include "Cursor.h"
-#include "debug.h"
-#include "gettext.h"
-#include "Color.h"
+#include "support/debug.h"
+#include "support/gettext.h"
#include "Lexer.h"
#include "OutputParams.h"
#include <sstream>
-using std::string;
-using std::ostream;
-using std::endl;
+using namespace std;
+using namespace lyx::support;
namespace lyx {
-using support::bformat;
-
InsetFormulaMacro::InsetFormulaMacro()
- : InsetMathNest(2), name_("unknownA")
+ : InsetMathNest(2), name_(from_ascii("unknownA"))
{}
InsetFormulaMacro::InsetFormulaMacro(string const & s)
: InsetMathNest(2), name_("unknownB")
{
- std::istringstream is(s);
+ istringstream is(s);
read(is);
}
}
-void InsetFormulaMacro::write(Buffer const &, ostream & os) const
+void InsetFormulaMacro::write(ostream & os) const
{
os << "FormulaMacro\n";
- WriteStream wi(os, false, false);
+ WriteStream wi(os, false, false, false);
tmpl()->write(wi);
}
-int InsetFormulaMacro::latex(Buffer const &, odocstream & os,
+int InsetFormulaMacro::latex(odocstream & os,
OutputParams const & runparams) const
{
//lyxerr << "InsetFormulaMacro::latex" << endl;
- WriteStream wi(os, runparams.moving_arg, true);
+ WriteStream wi(os, runparams.moving_arg, true, runparams.dryrun,
+ runparams.encoding);
tmpl()->write(wi);
return 2;
}
-int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os,
- OutputParams const &) const
+int InsetFormulaMacro::plaintext(odocstream & os, OutputParams const & runparams) const
{
odocstringstream oss;
- WriteStream wi(oss, false, true);
+ WriteStream wi(oss, false, true, false, runparams.encoding);
tmpl()->write(wi);
docstring const str = oss.str();
}
-int InsetFormulaMacro::docbook(Buffer const & buf, ostream & os,
+int InsetFormulaMacro::docbook(ostream & os,
OutputParams const & runparams) const
{
- return plaintext(buf, os, runparams);
+ return plaintext(os, runparams);
}
-void InsetFormulaMacro::read(Buffer const &, Lexer & lex)
+void InsetFormulaMacro::read(Lexer & lex)
{
read(lex.getStream());
}
-void InsetFormulaMacro::read(std::istream & is)
+void InsetFormulaMacro::read(istream & is)
{
auto_ptr<MathMacroTemplate> p(new MathMacroTemplate(is));
name_ = p->name();
{
// label
Font font = p.base.font;
- font.setColor(Color::math);
+ font.setColor(Color_math);
PainterInfo pi(p.base.bv, p.pain);
pi.base.style = LM_ST_TEXT;
int const w = dim_.wid - 2;
int const h = dim_.height() - 2;
- // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
- pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
- pi.pain.rectangle(x, a, w, h, Color::mathframe);
+ // Color_mathbg used to be "AntiqueWhite" but is "linen" now, too
+ pi.pain.fillRectangle(x, a, w, h, Color_mathmacrobg);
+ pi.pain.rectangle(x, a, w, h, Color_mathframe);
// FIXME
#if 0