]> git.lyx.org Git - lyx.git/blobdiff - src/buffer_funcs.C
fix crash when collapsing ert with cursor inside
[lyx.git] / src / buffer_funcs.C
index 38e4dde7912449a05fdf4ac363ce63f0ba57344a..61cf756fc43e1c5ac08cc01d409dd7b8096c19d7 100644 (file)
@@ -379,10 +379,10 @@ void setCounter(Buffer const & buf, ParIterator & it)
        // is it a layout that has an automatic label?
        if (layout->labeltype == LABEL_COUNTER) {
                if (layout->toclevel <= buf.params().secnumdepth
-                   && (!layout->isEnvironment() 
+                   && (!layout->isEnvironment()
                        || isFirstInSequence(it.pit(), it.plist()))) {
                        counters.step(layout->counter);
-                       string label = expandLabel(textclass, layout, 
+                       string label = expandLabel(textclass, layout,
                                                   par.params().appendix());
                        par.params().labelString(label);
                }
@@ -440,10 +440,9 @@ void setCounter(Buffer const & buf, ParIterator & it)
        } else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
                counters.step("bibitem");
                int number = counters.value("bibitem");
-               if (par.bibitem()) {
+               if (par.bibitem()) 
                        par.bibitem()->setCounter(number);
-                       par.params().labelString(layout->labelstring());
-               }
+               par.params().labelString(layout->labelstring());
                // In biblio should't be following counters but...
        } else if (layout->labeltype == LABEL_SENSITIVE) {
                // Search for the first float or wrap inset in the iterator
@@ -453,7 +452,7 @@ void setCounter(Buffer const & buf, ParIterator & it)
                        --i;
                        InsetBase * const in = &it[i].inset();
                        if (in->lyxCode() == InsetBase::FLOAT_CODE
-                           || in->lyxCode() == InsetBase::WRAP_CODE) 
+                           || in->lyxCode() == InsetBase::WRAP_CODE)
                                type = in->getInsetName();
                                break;
                }