#include "counters.h"
#include "debug.h"
#include "support/lstrings.h"
+#include "support/LAssert.h"
using std::endl;
using std::vector;
counterList[newc];
cit = counterList.find(newc);
- cit->second.setMaster(masterc);
+ cit->second.setMaster(masterc);
}
}
}
+
+void Counters::reset()
+{
+ CounterList::iterator it = counterList.begin();
+ CounterList::iterator end = counterList.end();
+ for (; it != end; ++it) {
+ it->second.reset();
+ }
+}
+
+
void Counters::reset(string const & match)
{
+ lyx::Assert(!match.empty());
+
CounterList::iterator it = counterList.begin();
CounterList::iterator end = counterList.end();
for (; it != end; ++it) {
- if (it->first.find(match) != string::npos || match == "")
+ if (it->first.find(match) != string::npos)
it->second.reset();
}
}
+
void Counters::copy(Counters & from, Counters & to, string const & match)
{
CounterList::iterator it = counterList.begin();
return 'a' + n - 1;
}
+
inline
char alphaCounter(int n)
{
return 'A' + n - 1;
}
+
inline
char hebrewCounter(int n)
{
return hebrew[n-1];
}
+
inline
string const romanCounter(int n)
{
} // namespace anon
+
string Counters::labelItem(string const & ctr,
- string const & numbertype,
- string const & langtype,
- bool first)
+ string const & numbertype,
+ string const & langtype,
+ bool first)
{
ostringstream s, o;
CounterList::iterator it = counterList.find(ctr);
return s.str();
}
+
string Counters::numberLabel(string const & ctr,
- string const & numbertype,
- string const & langtype,
- int head)
+ string const & numbertype,
+ string const & langtype,
+ int head)
{
ostringstream s, o;
if (numbertype == "sectioning" || numbertype == "appendix") {