X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCounters.cpp;h=d6865d107d99dd6954b1e4a3d697c7449a2f8acd;hb=489b80aef4d7904d667aeb06a32f2cc4ecbb75fa;hp=c06e9a7f9f4497742f83fc2f01a7b1bb0bb87872;hpb=c2ac70552ccb4e5c05130d0071ba513d2e3b3d94;p=lyx.git diff --git a/src/Counters.cpp b/src/Counters.cpp index c06e9a7f9f..d6865d107d 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -545,19 +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(); - if (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); }