]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
make "make distcheck" work
[lyx.git] / src / text2.C
index 5f2b91d77f2453524276ec76364b41963b26a788..673287fbbb595796f0fedb4242fbf7cb15b9ebde 100644 (file)
@@ -440,7 +440,9 @@ void LyXText::setFont(LCursor & cur, LyXFont const & font, bool toggleall)
 
        // Don't use forwardChar here as ditend might have
        // pos() == lastpos() and forwardChar would miss it.
-       for (; dit != ditend; dit.forwardPos()) {
+       // Can't use forwardPos either as this descends into
+       // nested insets. 
+       for (; dit != ditend; dit.forwardPosNoDescend()) {
                if (dit.pos() != dit.lastpos()) {
                        LyXFont f = getFont(dit.paragraph(), dit.pos());
                        f.update(font, params.language, toggleall);
@@ -791,6 +793,7 @@ void LyXText::setCounter(Buffer const & buf, pit_type pit)
                        bool isOK = false;
                        while (tmppit != end) {
                                in = pars_[tmppit].inInset();
+                               // FIXME: in should be always valid.
                                if (in &&
                                    (in->lyxCode() == InsetBase::FLOAT_CODE ||
                                     in->lyxCode() == InsetBase::WRAP_CODE)) {