]> git.lyx.org Git - features.git/commitdiff
Get counter from InsetLayout, as elsewhere.
authorRichard Heck <rgheck@comcast.net>
Thu, 3 Dec 2009 23:22:45 +0000 (23:22 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 3 Dec 2009 23:22:45 +0000 (23:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32310 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetFoot.cpp

index 04fe39e482dbf8620f98f3ea8338f0e041a6d534..779c06727e6cb20b648393972fe1edaeb8a50e84 100644 (file)
@@ -40,14 +40,14 @@ void InsetFoot::updateLabels(ParIterator const & it)
 {
        BufferParams const & bp = buffer().masterBuffer()->params();
        Counters & cnts = bp.documentClass().counters();
-       static docstring const foot = from_ascii("footnote");
        Paragraph const & outer = it.paragraph();
-       if (!outer.layout().intitle && cnts.hasCounter(foot)) {
-               cnts.step(foot);
-               custom_label_= translateIfPossible(getLayout().labelstring()) 
-                       + ' ' + cnts.theCounter(foot, outer.getParLanguage(bp)->code());
-               setLabel(custom_label_);
-       
+       InsetLayout const & il = getLayout();
+       docstring const & count = il.counter();
+       if (!outer.layout().intitle && cnts.hasCounter(count)) {
+               cnts.step(count);
+               custom_label_= translateIfPossible(il.labelstring()) 
+                       + ' ' + cnts.theCounter(count, outer.getParLanguage(bp)->code());
+               setLabel(custom_label_);        
        }
        InsetCollapsable::updateLabels(it);
 }