X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCounters.cpp;h=d6865d107d99dd6954b1e4a3d697c7449a2f8acd;hb=489b80aef4d7904d667aeb06a32f2cc4ecbb75fa;hp=c8e82ca39350832861d6c858be68629d26cdcf1f;hpb=4dd9a8acf17b13b38de5a03722e6cb1f6c43b7be;p=lyx.git diff --git a/src/Counters.cpp b/src/Counters.cpp index c8e82ca393..d6865d107d 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -545,21 +545,19 @@ docstring Counters::counterLabel(docstring const & format, } -docstring Counters::prettyCounter(docstring const & counter, +docstring Counters::prettyCounter(docstring const & name, string const & lang) const { - CounterList::const_iterator it = counterList_.find(counter); + CounterList::const_iterator it = counterList_.find(name); if (it == counterList_.end()) return from_ascii("??"); Counter const & ctr = it->second; + + docstring const value = theCounter(name, lang); docstring const & format = ctr.prettyFormat(); - // FIXME We need to "flatten" the format to get proper output, - // but doing so will take a bit of work. - if (true || format.empty()) { - docstring cntrname = translateIfPossible(counter, lang); - return cntrname + " " + theCounter(counter, lang); - } - return counterLabel(format, lang); + if (format.empty()) + return value; + return subst(format, from_ascii("##"), value); }