#include "Lexer.h"
#include "LyXAction.h"
#include "MetricsInfo.h"
-#include "OutputParams.h"
+#include "output_docbook.h"
#include "output_xhtml.h"
#include "TextClass.h"
#include "TextMetrics.h"
return translator;
}
-} // anon
+} // namespace
InsetScriptParams::InsetScriptParams()
}
-Inset::DisplayType InsetScript::display() const
-{
- return Inline;
-}
-
-
void InsetScript::metrics(MetricsInfo & mi, Dimension & dim) const
{
int const shift = params_.shift(mi.base.font);
- ScriptChanger dummy(mi.base);
+ // Remember the value of the outser font, so that it can be used in cursorPos.
+ outer_font_ = mi.base.font;
+ Changer dummy = mi.base.changeScript();
InsetText::metrics(mi, dim);
dim.asc -= shift;
dim.des += shift;
void InsetScript::draw(PainterInfo & pi, int x, int y) const
{
int const shift = params_.shift(pi.base.font);
- ScriptChanger dummy(pi.base);
+ Changer dummy = pi.base.changeScript();
InsetText::draw(pi, x, y + shift);
}
void InsetScript::cursorPos(BufferView const & bv,
CursorSlice const & sl, bool boundary, int & x, int & y) const
{
- Font const font = bv.textMetrics(&text()).displayFont(sl.pit(), sl.pos());
- int const shift = params_.shift(font.fontInfo());
+ int const shift = params_.shift(outer_font_);
InsetText::cursorPos(bv, sl, boundary, x, y);
y += shift;
}
case BOX_CODE:
case BRANCH_CODE:
case CAPTION_CODE:
- case COLLAPSABLE_CODE:
+ case COLLAPSIBLE_CODE:
case FLOAT_CODE:
case FLOAT_LIST_CODE:
case FOOT_CODE:
case LFUN_PREVIEW_INSERT:
case LFUN_QUOTE_INSERT:
case LFUN_TABULAR_INSERT:
+ case LFUN_TABULAR_STYLE_INSERT:
case LFUN_WRAP_INSERT:
flag.setEnabled(false);
return true;
}
-int InsetScript::docbook(odocstream & os, OutputParams const & runparams) const
+void InsetScript::docbook(XMLStream & xs, OutputParams const & runparams) const
{
docstring cmdname;
switch (params_.type) {
cmdname = from_ascii("superscript");
break;
}
- os << '<' + cmdname + '>';
- int const i = InsetText::docbook(os, runparams);
- os << "</" + cmdname + '>';
- return i;
+ xs << xml::StartTag(cmdname);
+ InsetText::docbook(xs, runparams);
+ xs << xml::EndTag(cmdname);
}