#include "DocIterator.h"
#include "Buffer.h"
+#include "BufferParams.h"
+#include "Encoding.h"
+#include "Font.h"
#include "InsetList.h"
+#include "Language.h"
#include "Paragraph.h"
-#include "LyXRC.h"
#include "Text.h"
#include "mathed/MathData.h"
}
+InsetMath & DocIterator::nextMath()
+{
+ return *nextAtom().nucleus();
+}
+
+
+InsetMath & DocIterator::prevMath()
+{
+ return *prevAtom().nucleus();
+}
+
+
MathAtom & DocIterator::prevAtom() const
{
LASSERT(!empty(), /**/);
}
+docstring DocIterator::getPossibleLabel() const
+{
+ return inMathed() ? from_ascii("eq:") : text()->getPossibleLabel(*this);
+}
+
+
+Encoding const * DocIterator::getEncoding() const
+{
+ if (empty())
+ return 0;
+ BufferParams const & bp = buffer()->params();
+ if (bp.useNonTeXFonts)
+ return encodings.fromLyXName("utf8-plain");
+
+ CursorSlice const & sl = innerTextSlice();
+ Text const & text = *sl.text();
+ Font font = text.getPar(sl.pit()).getFont(bp, sl.pos(),
+ text.outerFont(sl.pit()));
+ return font.language()->encoding();
+}
+
+
ostream & operator<<(ostream & os, DocIterator const & dit)
{
for (size_t i = 0, n = dit.depth(); i != n; ++i)