mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
small simplification and speedup for InsetFoot::updateLabels
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30966 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
23e01eb866
commit
1c867a17b2
@ -26,14 +26,11 @@
|
||||
#include "support/debug.h"
|
||||
#include "support/docstream.h"
|
||||
#include "support/gettext.h"
|
||||
#include "support/lstrings.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
using support::bformat;
|
||||
|
||||
InsetFoot::InsetFoot(Buffer const & buf)
|
||||
: InsetFootlike(buf)
|
||||
{}
|
||||
@ -43,14 +40,12 @@ void InsetFoot::updateLabels(ParIterator const & it)
|
||||
{
|
||||
BufferParams const & bp = buffer().masterBuffer()->params();
|
||||
Counters & cnts = bp.documentClass().counters();
|
||||
docstring const foot = from_ascii("footnote");
|
||||
Paragraph const & outer = it.paragraph();
|
||||
static docstring const foot = from_ascii("footnote");
|
||||
Paragraph const & outer = it.paragraph();
|
||||
if (!outer.layout().intitle && cnts.hasCounter(foot)) {
|
||||
cnts.step(foot);
|
||||
// FIXME: the counter should format itself.
|
||||
custom_label_= bformat(from_utf8("%1$s %2$s"),
|
||||
translateIfPossible(getLayout().labelstring()),
|
||||
cnts.theCounter(foot, outer.getParLanguage(bp)->code()));
|
||||
custom_label_= translateIfPossible(getLayout().labelstring())
|
||||
+ ' ' + cnts.theCounter(foot, outer.getParLanguage(bp)->code());
|
||||
setLabel(custom_label_);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user