2003-08-22 09:44:59 +00:00
|
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
|
* \file Counters.cpp
|
2003-08-22 09:44:59 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-22 09:44:59 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Martin Vermeer
|
2003-09-12 17:13:22 +00:00
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
2007-08-08 15:10:55 +00:00
|
|
|
|
* \author Richard Heck (roman numerals)
|
2000-07-24 13:53:19 +00:00
|
|
|
|
*
|
2003-08-22 09:44:59 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
2000-07-17 18:27:53 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-04-26 04:41:58 +00:00
|
|
|
|
#include "Counters.h"
|
2000-07-17 18:27:53 +00:00
|
|
|
|
#include "debug.h"
|
2002-09-06 14:48:01 +00:00
|
|
|
|
|
2002-08-06 22:40:59 +00:00
|
|
|
|
#include "support/lstrings.h"
|
2005-01-06 16:39:35 +00:00
|
|
|
|
#include "support/convert.h"
|
2003-09-09 17:25:35 +00:00
|
|
|
|
|
|
|
|
|
#include <boost/assert.hpp>
|
2000-07-17 18:27:53 +00:00
|
|
|
|
|
2004-07-24 10:55:30 +00:00
|
|
|
|
#include <sstream>
|
|
|
|
|
|
2000-07-17 18:27:53 +00:00
|
|
|
|
using std::endl;
|
2003-09-05 18:02:24 +00:00
|
|
|
|
using std::ostringstream;
|
2003-10-06 15:43:21 +00:00
|
|
|
|
using std::string;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
|
|
|
|
|
|
2007-07-17 17:40:44 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
2000-07-17 18:27:53 +00:00
|
|
|
|
Counter::Counter()
|
|
|
|
|
{
|
|
|
|
|
reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Counter::set(int v)
|
|
|
|
|
{
|
|
|
|
|
value_ = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Counter::addto(int v)
|
|
|
|
|
{
|
|
|
|
|
value_ += v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Counter::value() const
|
|
|
|
|
{
|
|
|
|
|
return value_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Counter::step()
|
|
|
|
|
{
|
|
|
|
|
++value_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Counter::reset()
|
|
|
|
|
{
|
|
|
|
|
value_ = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-06 14:48:01 +00:00
|
|
|
|
|
2007-01-11 22:38:37 +00:00
|
|
|
|
docstring const & Counter::master() const
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
|
|
|
|
return master_;
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-06 14:48:01 +00:00
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counter::setMaster(docstring const & m)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
|
|
|
|
master_ = m;
|
|
|
|
|
}
|
|
|
|
|
|
2000-07-17 18:27:53 +00:00
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counters::newCounter(docstring const & newc)
|
2000-07-17 18:27:53 +00:00
|
|
|
|
{
|
|
|
|
|
// First check if newc already exist
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::iterator const cit = counterList.find(newc);
|
2002-08-06 22:40:59 +00:00
|
|
|
|
// if already exist give warning and return
|
2000-07-17 18:27:53 +00:00
|
|
|
|
if (cit != counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "New counter already exists: "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(newc)
|
2006-10-20 20:30:00 +00:00
|
|
|
|
<< endl;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
counterList[newc];
|
2000-07-17 18:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counters::newCounter(docstring const & newc,
|
|
|
|
|
docstring const & masterc)
|
2000-07-17 18:27:53 +00:00
|
|
|
|
{
|
2002-08-06 22:40:59 +00:00
|
|
|
|
// First check if newc already exists
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::iterator const cit = counterList.find(newc);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
// if already existant give warning and return
|
|
|
|
|
if (cit != counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "New counter already exists: "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(newc)
|
2006-10-20 20:30:00 +00:00
|
|
|
|
<< endl;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
// then check if masterc exists
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::iterator const it = counterList.find(masterc);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
// if not give warning and return
|
|
|
|
|
if (it == counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "Master counter does not exist: "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(masterc)
|
2006-10-20 20:30:00 +00:00
|
|
|
|
<< endl;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-06 14:48:01 +00:00
|
|
|
|
counterList[newc].setMaster(masterc);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counters::set(docstring const & ctr, int const val)
|
2000-07-17 18:27:53 +00:00
|
|
|
|
{
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::iterator const it = counterList.find(ctr);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
if (it == counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "set: Counter does not exist: "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(ctr) << endl;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
it->second.set(val);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counters::addto(docstring const & ctr, int const val)
|
2000-07-17 18:27:53 +00:00
|
|
|
|
{
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::iterator const it = counterList.find(ctr);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
if (it == counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "addto: Counter does not exist: "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(ctr) << endl;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
it->second.addto(val);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
int Counters::value(docstring const & ctr) const
|
2000-07-17 18:27:53 +00:00
|
|
|
|
{
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::const_iterator const cit = counterList.find(ctr);
|
2000-07-17 18:27:53 +00:00
|
|
|
|
if (cit == counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "value: Counter does not exist: "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(ctr) << endl;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
return cit->second.value();
|
2000-07-17 18:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counters::step(docstring const & ctr)
|
2000-07-17 18:27:53 +00:00
|
|
|
|
{
|
|
|
|
|
CounterList::iterator it = counterList.find(ctr);
|
|
|
|
|
if (it == counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "step: Counter does not exist: "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(ctr) << endl;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
|
|
|
|
|
it->second.step();
|
|
|
|
|
it = counterList.begin();
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::iterator const end = counterList.end();
|
2002-08-06 22:40:59 +00:00
|
|
|
|
for (; it != end; ++it) {
|
|
|
|
|
if (it->second.master() == ctr) {
|
|
|
|
|
it->second.reset();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-11 20:34:20 +00:00
|
|
|
|
|
|
|
|
|
void Counters::reset()
|
|
|
|
|
{
|
2007-07-11 12:52:50 +00:00
|
|
|
|
appendix_ = false;
|
2002-08-11 20:34:20 +00:00
|
|
|
|
CounterList::iterator it = counterList.begin();
|
2005-01-05 20:21:27 +00:00
|
|
|
|
CounterList::iterator const end = counterList.end();
|
2002-08-11 20:34:20 +00:00
|
|
|
|
for (; it != end; ++it) {
|
|
|
|
|
it->second.reset();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counters::reset(docstring const & match)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
2003-09-09 17:25:35 +00:00
|
|
|
|
BOOST_ASSERT(!match.empty());
|
2002-08-11 20:34:20 +00:00
|
|
|
|
|
2002-08-06 22:40:59 +00:00
|
|
|
|
CounterList::iterator it = counterList.begin();
|
|
|
|
|
CounterList::iterator end = counterList.end();
|
|
|
|
|
for (; it != end; ++it) {
|
2002-08-11 20:34:20 +00:00
|
|
|
|
if (it->first.find(match) != string::npos)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
it->second.reset();
|
2002-08-09 12:14:54 +00:00
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-08-12 20:24:10 +00:00
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
void Counters::copy(Counters & from, Counters & to, docstring const & match)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
|
|
|
|
CounterList::iterator it = counterList.begin();
|
|
|
|
|
CounterList::iterator end = counterList.end();
|
|
|
|
|
for (; it != end; ++it) {
|
|
|
|
|
if (it->first.find(match) != string::npos || match == "") {
|
|
|
|
|
to.set(it->first, from.value(it->first));
|
2002-08-09 12:14:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace {
|
2002-08-09 12:14:54 +00:00
|
|
|
|
|
2005-01-05 20:21:27 +00:00
|
|
|
|
char loweralphaCounter(int const n)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
2003-09-15 11:00:00 +00:00
|
|
|
|
if (n < 1 || n > 26)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
return '?';
|
2003-09-12 17:13:22 +00:00
|
|
|
|
return 'a' + n - 1;
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-08-12 20:24:10 +00:00
|
|
|
|
|
2005-01-05 20:21:27 +00:00
|
|
|
|
char alphaCounter(int const n)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
|
|
|
|
if (n < 1 || n > 26)
|
|
|
|
|
return '?';
|
2003-09-12 17:13:22 +00:00
|
|
|
|
return 'A' + n - 1;
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-08-12 20:24:10 +00:00
|
|
|
|
|
2005-01-05 20:21:27 +00:00
|
|
|
|
char hebrewCounter(int const n)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
|
|
|
|
static const char hebrew[22] = {
|
2007-05-10 10:35:57 +00:00
|
|
|
|
'\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8',
|
|
|
|
|
'\xe9', '\xeb', '\xec', '\xee', '\xf0', '\xf1', '\xf2', '\xf4', '\xf6',
|
|
|
|
|
'\xf7', '\xf8', '\xf9', '\xfa'
|
2002-08-06 22:40:59 +00:00
|
|
|
|
};
|
2003-09-12 17:13:22 +00:00
|
|
|
|
|
2002-08-06 22:40:59 +00:00
|
|
|
|
if (n < 1 || n > 22)
|
|
|
|
|
return '?';
|
2003-09-12 17:13:22 +00:00
|
|
|
|
return hebrew[n - 1];
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-08-12 20:24:10 +00:00
|
|
|
|
|
2007-08-08 15:10:55 +00:00
|
|
|
|
|
|
|
|
|
//On the special cases, see http://mathworld.wolfram.com/RomanNumerals.html
|
|
|
|
|
//and for a list of roman numerals up to and including 3999, see
|
|
|
|
|
//http://www.research.att.com/~njas/sequences/a006968.txt. (Thanks to Joost
|
|
|
|
|
//for this info.)
|
|
|
|
|
docstring const romanCounter(int const n, bool lowercase = false)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
2007-08-08 15:10:55 +00:00
|
|
|
|
static char const * const ones[9] = {
|
|
|
|
|
"I", "II", "III", "IV", "V",
|
|
|
|
|
"VI", "VII", "VIII", "IX"
|
2002-08-06 22:40:59 +00:00
|
|
|
|
};
|
2007-08-08 15:10:55 +00:00
|
|
|
|
|
|
|
|
|
static char const * const tens[9] = {
|
|
|
|
|
"X", "XX", "XXX", "XL", "L",
|
|
|
|
|
"LX", "LXX", "LXXX", "XC"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static char const * const hunds[9] = {
|
|
|
|
|
"C", "CC", "CCC", "CD", "D",
|
|
|
|
|
"DC", "DCC", "DCCC", "CM"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (n > 1000 || n < 1)
|
2006-10-21 00:16:43 +00:00
|
|
|
|
return from_ascii("??");
|
2007-08-08 15:10:55 +00:00
|
|
|
|
|
|
|
|
|
int val = n;
|
|
|
|
|
string roman;
|
|
|
|
|
switch (n) {
|
|
|
|
|
//special cases
|
|
|
|
|
case 900:
|
|
|
|
|
roman = "CM";
|
|
|
|
|
break;
|
|
|
|
|
case 400:
|
|
|
|
|
roman = "CD";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if (val >= 100) {
|
|
|
|
|
int hundreds = val / 100;
|
|
|
|
|
roman = hunds[hundreds - 1];
|
|
|
|
|
val = val % 100;
|
|
|
|
|
}
|
|
|
|
|
if (val >= 10) {
|
|
|
|
|
switch (val) {
|
|
|
|
|
//special case
|
|
|
|
|
case 90:
|
|
|
|
|
roman = roman + "XC";
|
|
|
|
|
val = 0; //skip next
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
int tensnum = val / 10;
|
|
|
|
|
roman = roman + tens[tensnum - 1];
|
|
|
|
|
val = val % 10;
|
|
|
|
|
} // end switch
|
|
|
|
|
} // end tens
|
|
|
|
|
if (val > 0)
|
|
|
|
|
roman = roman + ones[val -1];
|
|
|
|
|
}
|
|
|
|
|
docstring retval = from_ascii(roman);
|
|
|
|
|
return lowercase ? support::lowercase(retval) : retval;
|
2003-09-12 17:13:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-08 15:10:55 +00:00
|
|
|
|
docstring const lowerromanCounter(int const n)
|
2003-09-12 17:13:22 +00:00
|
|
|
|
{
|
2007-08-08 15:10:55 +00:00
|
|
|
|
return romanCounter(n, true);
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace anon
|
|
|
|
|
|
2002-08-12 20:24:10 +00:00
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
docstring Counters::labelItem(docstring const & ctr,
|
|
|
|
|
docstring const & numbertype)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
2007-01-11 22:56:21 +00:00
|
|
|
|
CounterList::const_iterator const cit = counterList.find(ctr);
|
|
|
|
|
if (cit == counterList.end()) {
|
2006-10-20 20:30:00 +00:00
|
|
|
|
lyxerr << "Counter "
|
2006-10-21 00:16:43 +00:00
|
|
|
|
<< to_utf8(ctr)
|
2006-10-20 20:30:00 +00:00
|
|
|
|
<< " does not exist." << endl;
|
|
|
|
|
return docstring();
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
2002-09-05 12:58:10 +00:00
|
|
|
|
|
2007-01-11 22:56:21 +00:00
|
|
|
|
int val = cit->second.value();
|
|
|
|
|
|
2003-09-12 17:13:22 +00:00
|
|
|
|
if (numbertype == "hebrew")
|
2007-01-11 22:56:21 +00:00
|
|
|
|
return docstring(1, hebrewCounter(val));
|
2003-09-12 17:13:22 +00:00
|
|
|
|
|
|
|
|
|
if (numbertype == "alph")
|
2007-01-11 22:56:21 +00:00
|
|
|
|
return docstring(1, loweralphaCounter(val));
|
2003-09-12 17:13:22 +00:00
|
|
|
|
|
|
|
|
|
if (numbertype == "Alph")
|
2007-01-11 22:56:21 +00:00
|
|
|
|
return docstring(1, alphaCounter(val));
|
2003-09-12 17:13:22 +00:00
|
|
|
|
|
|
|
|
|
if (numbertype == "roman")
|
2007-01-11 22:56:21 +00:00
|
|
|
|
return lowerromanCounter(val);
|
2002-11-04 02:12:42 +00:00
|
|
|
|
|
2003-09-12 17:13:22 +00:00
|
|
|
|
if (numbertype == "Roman")
|
2007-01-11 22:56:21 +00:00
|
|
|
|
return romanCounter(val);
|
2003-09-12 17:13:22 +00:00
|
|
|
|
|
2007-01-11 22:56:21 +00:00
|
|
|
|
return convert<docstring>(val);
|
2002-08-06 22:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-08-12 20:24:10 +00:00
|
|
|
|
|
2006-10-20 20:30:00 +00:00
|
|
|
|
docstring Counters::counterLabel(docstring const & format)
|
2002-08-06 22:40:59 +00:00
|
|
|
|
{
|
2006-10-20 20:30:00 +00:00
|
|
|
|
docstring label = format;
|
2003-09-12 17:13:22 +00:00
|
|
|
|
while (true) {
|
2004-04-05 09:36:28 +00:00
|
|
|
|
#ifdef WITH_WARNINGS
|
2005-01-05 20:21:27 +00:00
|
|
|
|
#warning Using boost::regex or boost::spirit would make this code a lot simpler... (Lgb)
|
2004-04-05 09:36:28 +00:00
|
|
|
|
#endif
|
2003-09-15 11:00:00 +00:00
|
|
|
|
|
2003-09-12 17:13:22 +00:00
|
|
|
|
size_t const i = label.find('\\', 0);
|
2006-10-20 20:30:00 +00:00
|
|
|
|
if (i == docstring::npos)
|
2003-09-12 17:13:22 +00:00
|
|
|
|
break;
|
|
|
|
|
size_t const j = label.find('{', i + 1);
|
2006-10-20 20:30:00 +00:00
|
|
|
|
if (j == docstring::npos)
|
2003-09-12 17:13:22 +00:00
|
|
|
|
break;
|
|
|
|
|
size_t const k = label.find('}', j + 1);
|
2007-01-11 22:38:37 +00:00
|
|
|
|
if (k == docstring::npos)
|
2003-09-12 17:13:22 +00:00
|
|
|
|
break;
|
2006-10-20 20:30:00 +00:00
|
|
|
|
docstring const numbertype(label, i + 1, j - i - 1);
|
|
|
|
|
docstring const counter(label, j + 1, k - j - 1);
|
|
|
|
|
docstring const rep = labelItem(counter, numbertype);
|
2007-05-28 22:27:45 +00:00
|
|
|
|
label = docstring(label, 0, i) + rep
|
2007-01-11 22:38:37 +00:00
|
|
|
|
+ docstring(label, k + 1, docstring::npos);
|
2003-09-12 17:13:22 +00:00
|
|
|
|
//lyxerr << " : " << " (" << counter << ","
|
|
|
|
|
// << numbertype << ") -> " << label << endl;
|
|
|
|
|
}
|
|
|
|
|
//lyxerr << "counterLabel: " << format << " -> " << label << endl;
|
|
|
|
|
return label;
|
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|