mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
move the catInit call around
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27481 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8c68c6524c
commit
ffafdb2bbe
@ -250,7 +250,7 @@ void InsetBibitem::fillWithBibKeys(BiblioInfo & keys, InsetIterator const & it)
|
||||
/// Update the counters of this inset and of its contents
|
||||
void InsetBibitem::updateLabels(ParIterator const &)
|
||||
{
|
||||
Counters & counters = buffer().params().documentClass().counters();
|
||||
Counters & counters = buffer().masterBuffer()->params().documentClass().counters();
|
||||
docstring const bibitem = from_ascii("bibitem");
|
||||
if (counters.hasCounter(bibitem) && getParam("label").empty()) {
|
||||
counters.step(bibitem);
|
||||
|
@ -47,7 +47,7 @@ docstring InsetFoot::editMessage() const
|
||||
|
||||
void InsetFoot::updateLabels(ParIterator const & it)
|
||||
{
|
||||
DocumentClass const & tclass = buffer().params().documentClass();
|
||||
DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
|
||||
Counters & cnts = tclass.counters();
|
||||
docstring const foot = from_ascii("footnote");
|
||||
Paragraph const & outer = it.paragraph();
|
||||
|
@ -73,7 +73,7 @@ Inset::DisplayType InsetListings::display() const
|
||||
|
||||
void InsetListings::updateLabels(ParIterator const & it)
|
||||
{
|
||||
Counters & cnts = buffer().params().documentClass().counters();
|
||||
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
|
||||
string const saveflt = cnts.current_float();
|
||||
|
||||
// Tell to captions what the current float is
|
||||
|
@ -3211,7 +3211,7 @@ void InsetTabular::edit(Cursor & cur, bool front, EntryDirection)
|
||||
void InsetTabular::updateLabels(ParIterator const & it)
|
||||
{
|
||||
// In a longtable, tell captions what the current float is
|
||||
Counters & cnts = buffer().params().documentClass().counters();
|
||||
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
|
||||
string const saveflt = cnts.current_float();
|
||||
if (tabular.is_long_tabular)
|
||||
cnts.current_float("table");
|
||||
|
@ -462,7 +462,7 @@ void InsetText::updateLabels(ParIterator const & it)
|
||||
if (producesOutput())
|
||||
lyx::updateLabels(buffer(), it2);
|
||||
else {
|
||||
DocumentClass const & tclass = buffer().params().documentClass();
|
||||
DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
|
||||
Counters const savecnt = tclass.counters();
|
||||
lyx::updateLabels(buffer(), it2);
|
||||
tclass.counters() = savecnt;
|
||||
|
@ -25,6 +25,11 @@ CatCode theCatcode[256];
|
||||
|
||||
void catInit()
|
||||
{
|
||||
static bool init_done = false;
|
||||
if (init_done)
|
||||
return;
|
||||
init_done = true;
|
||||
|
||||
fill(theCatcode, theCatcode + 256, catOther);
|
||||
fill(theCatcode + 'a', theCatcode + 'z' + 1, catLetter);
|
||||
fill(theCatcode + 'A', theCatcode + 'Z' + 1, catLetter);
|
||||
@ -358,6 +363,7 @@ string const Parser::verbatimEnvironment(string const & name)
|
||||
|
||||
void Parser::tokenize_one()
|
||||
{
|
||||
catInit();
|
||||
char c;
|
||||
if (!is_.get(c))
|
||||
return;
|
||||
@ -434,13 +440,6 @@ void Parser::tokenize_one()
|
||||
|
||||
void Parser::tokenize()
|
||||
{
|
||||
static bool init_done = false;
|
||||
|
||||
if (!init_done) {
|
||||
catInit();
|
||||
init_done = true;
|
||||
}
|
||||
|
||||
while (is_)
|
||||
tokenize_one();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user