]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFoot.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetFoot.cpp
index 779c06727e6cb20b648393972fe1edaeb8a50e84..fd8038f4ee654fef029a6bb9b4892f464fbef4d5 100644 (file)
@@ -36,20 +36,26 @@ InsetFoot::InsetFoot(Buffer * buf)
 {}
 
 
-void InsetFoot::updateLabels(ParIterator const & it)
+void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype)
 {
        BufferParams const & bp = buffer().masterBuffer()->params();
        Counters & cnts = bp.documentClass().counters();
+       if (utype == OutputUpdate) {
+               // the footnote counter is local to this inset
+               cnts.saveLastCounter();
+       }
        Paragraph const & outer = it.paragraph();
        InsetLayout const & il = getLayout();
        docstring const & count = il.counter();
        if (!outer.layout().intitle && cnts.hasCounter(count)) {
-               cnts.step(count);
+               cnts.step(count, utype);
                custom_label_= translateIfPossible(il.labelstring()) 
                        + ' ' + cnts.theCounter(count, outer.getParLanguage(bp)->code());
                setLabel(custom_label_);        
        }
-       InsetCollapsable::updateLabels(it);
+       InsetCollapsable::updateBuffer(it, utype);
+       if (utype == OutputUpdate)
+               cnts.restoreLastCounter();      
 }
 
 
@@ -60,8 +66,8 @@ void InsetFoot::addToToc(DocIterator const & cpit)
 
        Toc & toc = buffer().tocBackend().toc("footnote");
        docstring str;
-       str = custom_label_ + ": " + getNewLabel(str);
-       toc.push_back(TocItem(pit, 0, str));
+       str = custom_label_ + ": " + text().getPar(0).asString();
+       toc.push_back(TocItem(pit, 0, str, toolTipText()));
        // Proceed with the rest of the inset.
        InsetFootlike::addToToc(cpit);
 }