mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
LaTeX export small speedup: Introduce RandomAccessList::position() and use it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36931 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
280f7a7ced
commit
ca91d508b2
@ -413,7 +413,7 @@ void TeXOnePar(Buffer const & buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (text.inset().getLayout().isPassThru()) {
|
if (text.inset().getLayout().isPassThru()) {
|
||||||
int const dist = distance(paragraphs.begin(), pit);
|
int const dist = paragraphs.position(pit);
|
||||||
Font const outerfont = text.outerFont(dist);
|
Font const outerfont = text.outerFont(dist);
|
||||||
|
|
||||||
// No newline before first paragraph in this lyxtext
|
// No newline before first paragraph in this lyxtext
|
||||||
@ -432,7 +432,7 @@ void TeXOnePar(Buffer const & buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (style.pass_thru) {
|
if (style.pass_thru) {
|
||||||
int const dist = distance(paragraphs.begin(), pit);
|
int const dist = paragraphs.position(pit);
|
||||||
Font const outerfont = text.outerFont(dist);
|
Font const outerfont = text.outerFont(dist);
|
||||||
pit->latex(bparams, outerfont, os, texrow,
|
pit->latex(bparams, outerfont, os, texrow,
|
||||||
runparams, start_pos, end_pos);
|
runparams, start_pos, end_pos);
|
||||||
@ -690,7 +690,7 @@ void TeXOnePar(Buffer const & buf,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Font const outerfont = text.outerFont(distance(paragraphs.begin(), pit));
|
Font const outerfont = text.outerFont(paragraphs.position(pit));
|
||||||
|
|
||||||
// FIXME UNICODE
|
// FIXME UNICODE
|
||||||
os << from_utf8(everypar);
|
os << from_utf8(everypar);
|
||||||
|
@ -273,6 +273,26 @@ public:
|
|||||||
iterCont_.clear();
|
iterCont_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t position(iterator it) const
|
||||||
|
{
|
||||||
|
size_t const s = iterCont_.size();
|
||||||
|
for (size_t i = 0; it != s; ++i) {
|
||||||
|
if (iterCont_[i] == it)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t position(const_iterator it) const
|
||||||
|
{
|
||||||
|
size_t const s = iterCont_.size();
|
||||||
|
for (size_t i = 0; i != s; ++i) {
|
||||||
|
if (iterCont_[i] == it)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void recreateVector()
|
void recreateVector()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user