#include "FuncStatus.h"
#include "Lexer.h"
#include "MetricsInfo.h"
-#include "OutputParams.h"
+#include "output_docbook.h"
#include "output_xhtml.h"
+#include "texstream.h"
#include "frontends/Application.h"
#include "frontends/FontMetrics.h"
namespace lyx {
-InsetSeparator::InsetSeparator() : Inset(0)
+InsetSeparator::InsetSeparator() : Inset(nullptr)
{}
InsetSeparator::InsetSeparator(InsetSeparatorParams const & params)
- : Inset(0), params_(params)
+ : Inset(nullptr), params_(params)
{}
case InsetSeparatorParams::PARBREAK:
os << "parbreak";
break;
+ case InsetSeparatorParams::LATEXPAR:
+ os << "latexpar";
+ break;
}
}
kind = InsetSeparatorParams::PLAIN;
else if (token == "parbreak")
kind = InsetSeparatorParams::PARBREAK;
+ else if (token == "latexpar")
+ kind = InsetSeparatorParams::LATEXPAR;
else
lex.printError("Unknown kind: `$$Token'");
}
}
-void InsetSeparator::latex(otexstream & os, OutputParams const &) const
+void InsetSeparator::latex(otexstream & os, OutputParams const & runparams) const
{
// Do nothing if a paragraph break was just output
if (!os.afterParbreak()) {
os << breakln << "%\n";
break;
case InsetSeparatorParams::PARBREAK:
- os << breakln << "\n";
+ case InsetSeparatorParams::LATEXPAR:
+ if (runparams.inDeletedInset)
+ os << breakln << "}\n\n{";
+ else
+ os << breakln << "\n";
break;
default:
os << breakln << "%\n";
}
-int InsetSeparator::docbook(odocstream & os, OutputParams const &) const
+void InsetSeparator::docbook(XMLStream & xs, OutputParams const &) const
{
- os << '\n';
- return 0;
+ xs << xml::CR();
}
-docstring InsetSeparator::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring InsetSeparator::xhtml(XMLStream & xs, OutputParams const &) const
{
- xs << html::CR() << html::CompTag("br") << html::CR();
+ xs << xml::CR() << xml::CompTag("br") << xml::CR();
return docstring();
}
dim.asc = fm.maxAscent();
dim.des = fm.maxDescent();
dim.wid = fm.width('n');
- if (params_.kind == InsetSeparatorParams::PLAIN)
+ if (params_.kind != InsetSeparatorParams::LATEXPAR)
dim.wid *= 8;
}
int xp[7];
int yp[7];
- if (params_.kind == InsetSeparatorParams::PLAIN) {
+ if (params_.kind != InsetSeparatorParams::LATEXPAR) {
yp[0] = int(y - 0.500 * asc * 0.75);
yp[1] = yp[0];
xp[1] = int(x + wid * 8);
pi.pain.lines(xp, yp, 2, ColorName());
+
+ if (params_.kind == InsetSeparatorParams::PARBREAK) {
+ yp[0] += int(0.25 * asc * 0.75);
+ yp[1] = yp[0];
+ pi.pain.lines(xp, yp, 2, ColorName());
+ }
} else {
yp[0] = int(y - 0.500 * asc * 0.5);
yp[1] = int(y - 0.250 * asc * 0.5);
string InsetSeparator::contextMenuName() const
{
+ if (params_.kind == InsetSeparatorParams::LATEXPAR)
+ return string();
+
return "context-separator";
}