]> git.lyx.org Git - lyx.git/blobdiff - src/Text2.cpp
Cleanup the TEXT_TO_INSET_OFFSET mess. This correction is done now once in InsetText...
[lyx.git] / src / Text2.cpp
index 4cac71b48739663ea1729b90c5216d717fccf916..4b04512a102e4c5b9c48c5f3beeb35cc1f6480b8 100644 (file)
@@ -367,7 +367,7 @@ void Text::setFont(BufferView const & bv, CursorSlice const & begin,
                                // of noFontChange in Inset.h
                                setInsetFont(bv, pit, pos, font, toggleall);
                        TextMetrics const & tm = bv.textMetrics(this);
-                       Font f = tm.getDisplayFont(dit.paragraph(), pos);
+                       Font f = tm.getDisplayFont(pit, pos);
                        f.update(font, language, toggleall);
                        setCharFont(buffer, pit, pos, f, tm.font_);
                }
@@ -655,7 +655,7 @@ bool Text::cursorRight(Cursor & cur)
                TextMetrics const & tm = cur.bv().textMetrics(this);
                // if left of boundary -> just jump to right side
                // but for RTL boundaries don't, because: abc|DDEEFFghi -> abcDDEEF|Fghi
-               if (cur.boundary() && !tm.isRTLBoundary(cur.paragraph(), cur.pos()))
+               if (cur.boundary() && !tm.isRTLBoundary(cur.pit(), cur.pos()))
                        return setCursor(cur, cur.pit(), cur.pos(), true, false);
 
                // next position is left of boundary, 
@@ -684,7 +684,7 @@ bool Text::cursorRight(Cursor & cur)
                
                // in front of RTL boundary? Stay on this side of the boundary because:
                //   ab|cDDEEFFghi -> abc|DDEEFFghi
-               if (tm.isRTLBoundary(cur.paragraph(), cur.pos() + 1))
+               if (tm.isRTLBoundary(cur.pit(), cur.pos() + 1))
                        return setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
                
                // move right
@@ -813,7 +813,11 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
                           max(old.pit() - 1, pit_type(0)),
                           min(old.pit() + 1, old.lastpit()));
                ParagraphList & plist = old.text()->paragraphs();
+               bool const soa = oldpar.params().startOfAppendix();
                plist.erase(boost::next(plist.begin(), old.pit()));
+               // do not lose start of appendix marker (bug 4212)
+               if (soa)
+                       plist[old.pit()].params().startOfAppendix(true);
 
                // see #warning (FIXME?) above 
                if (cur.depth() >= old.depth()) {