+ } else {
+ /* we should have a footnote environment */
+ if (!next || next->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
+ // Notice that LyX does request the
+ // last char from time to time. (Asger)
+ //lyxerr << "ERROR (LyXParagraph::GetChar): "
+ // "expected footnote." << endl;
+ return '\0';
+ }
+ switch (next->footnotekind) {
+ case LyXParagraph::FOOTNOTE:
+ return LyXParagraph::META_FOOTNOTE;
+ case LyXParagraph::MARGIN:
+ return LyXParagraph::META_MARGIN;
+ case LyXParagraph::FIG:
+ case LyXParagraph::WIDE_FIG:
+ return LyXParagraph::META_FIG;
+ case LyXParagraph::TAB:
+ case LyXParagraph::WIDE_TAB:
+ return LyXParagraph::META_TAB;
+ case LyXParagraph::ALGORITHM:
+ return LyXParagraph::META_ALGORITHM;
+ }
+ return '\0'; // to shut up gcc
+ }
+}
+
+
+char LyXParagraph::GetChar(LyXParagraph::size_type pos) const
+{
+#ifdef DEVEL_VERSION
+ /* a workaround to 'fix' some bugs in text-class */
+ if (pos < 0) {
+ // This function is important. It should not work around bugs.
+ // Let's find the bugs instead and fix them. (Asger)
+ lyxerr << "FATAL ERROR (LyXParagraph::GetChar):"
+ " bad position " << pos << endl;
+ abort();
+ }
+#endif
+
+ if (pos < size()) {