#include "Paragraph.h"
#include "ParIterator.h"
#include "sgml.h"
+#include "TexRow.h"
#include "TextClass.h"
#include "TextPainter.h"
#include "TocBackend.h"
#include "frontends/Painter.h"
#include "support/convert.h"
-#include "support/lassert.h"
#include "support/debug.h"
-#include "support/filetools.h"
#include "support/gettext.h"
+#include "support/filetools.h"
+#include "support/lassert.h"
#include "support/lstrings.h"
+#include "support/RefChanger.h"
#include <sstream>
void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
{
BufferView const * const bv = pi.base.bv;
+ Dimension const dim = dimension(*bv);
if (type_ == hullRegexp) {
- Dimension const dim = dimension(*bv);
pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
dim.width() - 2, dim.height() - 2, Color_regexpframe);
}
if (previewState(bv)) {
- Dimension const dim = dimension(*bv);
+ // Do not draw change tracking cue if taken care of by RowPainter
+ // already.
+ Changer dummy = make_change(pi.change_, Change(), !canPaintChange(*bv));
if (previewTooSmall(dim)) {
// we have an extra frame
preview_->draw(pi, x + ERROR_FRAME_WIDTH, y);
pi.draw(xx, yy, nl);
}
}
+ // drawing change line
+ if (canPaintChange(*bv))
+ pi.change_.paintCue(pi, x + 1, y + 1 - dim.asc,
+ x + dim.wid, y + dim.des);
setPosCache(pi, x, y);
}
InsetMathGrid::metricsT(mi, dim);
} else {
odocstringstream os;
- TexRow texrow(false);
- otexrowstream ots(os,texrow);
+ otexrowstream ots(os);
WriteStream wi(ots, false, true, WriteStream::wsDefault);
write(wi);
dim.wid = os.str().size();
InsetMathGrid::drawT(pain, x, y);
} else {
odocstringstream os;
- TexRow texrow(false);
- otexrowstream ots(os,texrow);
+ otexrowstream ots(os);
WriteStream wi(ots, false, true, WriteStream::wsDefault);
write(wi);
pain.draw(x, y, os.str().c_str());
static Encoding const * encoding = 0;
if (inset.isBufferValid())
encoding = &(inset.buffer().params().encoding());
- TexRow texrow(false);
- otexrowstream ots(ls,texrow);
+ otexrowstream ots(ls);
WriteStream wi(ots, false, true, WriteStream::wsPreview, encoding);
inset.write(wi);
return ls.str();
void InsetMathHull::write(ostream & os) const
{
odocstringstream oss;
- TexRow texrow(false);
- otexrowstream ots(oss,texrow);
+ otexrowstream ots(oss);
WriteStream wi(ots, false, false, WriteStream::wsDefault);
oss << "Formula ";
write(wi);
}
odocstringstream oss;
- TexRow texrow(false);
- otexrowstream ots(oss,texrow);
+ otexrowstream ots(oss);
Encoding const * const enc = encodings.fromLyXName("utf8");
WriteStream wi(ots, false, true, WriteStream::wsDefault, enc);
++ms.tab(); ms.cr(); ms.os() << '<' << bname << '>';
odocstringstream ls;
- TexRow texrow;
- otexstream ols(ls, texrow);
+ otexstream ols(ls);
if (runparams.flavor == OutputParams::XML) {
ms << MTag("alt role='tex' ");
// Workaround for db2latex: db2latex always includes equations with
} else {
ms << MTag("alt role='tex'");
latex(ols, runparams);
- res = texrow.rows();
+ res = ols.texrow().rows();
ms << from_utf8(subst(subst(to_utf8(ls.str()), "&", "&"), "<", "<"));
ms << ETag("alt");
}
// Unfortunately, we cannot use latexString() because we do not want
// $...$ or whatever.
odocstringstream ls;
- TexRow texrow(false);
- otexrowstream ots(ls,texrow);
+ otexrowstream ots(ls);
WriteStream wi(ots, false, true, WriteStream::wsPreview);
ModeSpecifier specifier(wi, MATH_MODE);
mathAsLatex(wi);
docit_ = di;
}
+
+bool InsetMathHull::canPaintChange(BufferView const &) const
+{
+ // We let RowPainter do it seamlessly for inline insets
+ return display() != Inline;
+}
+
+
} // namespace lyx