]> git.lyx.org Git - lyx.git/commitdiff
Fix this bug reported by Bernhard Roider:
authorAbdelrazak Younes <younes@lyx.org>
Thu, 15 Mar 2007 19:16:53 +0000 (19:16 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 15 Mar 2007 19:16:53 +0000 (19:16 +0000)
steps to reproduce:
- create a new document
- change the document class to article (AMS)
- change the current layout to theorem, definition, proposition, ....
- try to write something -> boom

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17449 a592a061-630c-0410-9148-cb99ea01b6c8

src/buffer_funcs.C

index aa01afe6d7c4ec3ecbd2b5861fc0431d7d8cbb79..77c1af818d97c8b0de92b6519d9c94bb89c6c5bb 100644 (file)
@@ -703,7 +703,8 @@ void updateLabels(Buffer const & buf, bool childonly)
 
 void checkBufferStructure(Buffer & buffer, ParIterator const & par_it)
 {
-       if (par_it->layout()->labeltype == LABEL_COUNTER) {
+       if (par_it->layout()->labeltype == LABEL_COUNTER
+               && par_it->layout()->toclevel != LyXLayout::NOT_IN_TOC) {
                buffer.tocBackend().updateItem(par_it);
                buffer.structureChanged();
        }