lyx_mirror/src/insets/insetline.C
Georg Baum 8b67659646 Use UTF8 for LaTeX export.
Known problems:
- No space is output after a \hfill. I probably broke this with the
  InsetCommand patch. I'll have a look later.
- Although the encoding is now UTF8 the arguments of the inputenc package
  are still the old ones, so LaTeX will not run.
- Labels and references with non-ASCII characters are broken. This needs to
  be fixed in lyx::support::escape(), but this is a file format change.
- Something seems to be wrong with index entries, but this is probably also
  due to the InsetCommand changes.

Have fun!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15378 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 16:51:30 +00:00

88 lines
1.6 KiB
C

/**
* \file insetline.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "insetline.h"
#include "debug.h"
#include "LColor.h"
#include "lyxtext.h"
#include "metricsinfo.h"
#include "LaTeXFeatures.h"
#include "outputparams.h"
#include "frontends/Painter.h"
using lyx::odocstream;
using lyx::frontend::Painter;
using std::endl;
using std::ostream;
void InsetLine::read(Buffer const &, LyXLex &)
{
/* Nothing to read */
}
void InsetLine::write(Buffer const &, ostream & os) const
{
os << "\n\\lyxline\n";
}
void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const
{
dim.asc = 3;
dim.des = 3;
dim.wid = mi.base.textwidth;
dim_ = dim;
}
void InsetLine::draw(PainterInfo & pi, int x, int y) const
{
pi.pain.line(x, y, x + dim_.wid, y, LColor::topline, Painter::line_solid,
Painter::line_thick);
}
int InsetLine::latex(Buffer const &, odocstream & os,
OutputParams const & runparams) const
{
os << "\\lyxline{\\"
<< lyx::from_ascii(runparams.local_font->latexSize()) << '}';
return 0;
}
int InsetLine::plaintext(Buffer const &, odocstream & os,
OutputParams const &) const
{
os << "-------------------------------------------";
return 0;
}
int InsetLine::docbook(Buffer const &, std::ostream & os,
OutputParams const &) const
{
os << '\n';
return 0;
}
void InsetLine::validate(LaTeXFeatures & features) const
{
features.require("lyxline");
}