mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 16:37:28 +00:00
alfredo's FIXME patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6831 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c8d7cbd790
commit
f403a65ad6
@ -1,3 +1,7 @@
|
|||||||
|
2003-04-16 Alfredo Braunstein <abraunst@libero.it>
|
||||||
|
|
||||||
|
* text2.C (redoParagraphs): eliminate good_prevrit, rewrite a loop
|
||||||
|
|
||||||
2003-04-16 Alfredo Braunstein <abraunst@libero.it>
|
2003-04-16 Alfredo Braunstein <abraunst@libero.it>
|
||||||
|
|
||||||
* bufferlist.C (quitWriteBuffer): WriteAs and MenuWrite return true
|
* bufferlist.C (quitWriteBuffer): WriteAs and MenuWrite return true
|
||||||
|
43
src/text2.C
43
src/text2.C
@ -646,6 +646,7 @@ void LyXText::redoParagraphs(LyXCursor const & cur,
|
|||||||
int y = cur.y() - tmprit->baseline();
|
int y = cur.y() - tmprit->baseline();
|
||||||
|
|
||||||
ParagraphList::iterator first_phys_pit;
|
ParagraphList::iterator first_phys_pit;
|
||||||
|
RowList::iterator prevrit;
|
||||||
if (tmprit == rows().begin()) {
|
if (tmprit == rows().begin()) {
|
||||||
// A trick/hack for UNDO.
|
// A trick/hack for UNDO.
|
||||||
// This is needed because in an UNDO/REDO we could have
|
// This is needed because in an UNDO/REDO we could have
|
||||||
@ -653,8 +654,7 @@ void LyXText::redoParagraphs(LyXCursor const & cur,
|
|||||||
// the row is NOT my really first par anymore.
|
// the row is NOT my really first par anymore.
|
||||||
// Got it Lars ;) (Jug 20011206)
|
// Got it Lars ;) (Jug 20011206)
|
||||||
first_phys_pit = ownerParagraphs().begin();
|
first_phys_pit = ownerParagraphs().begin();
|
||||||
#warning FIXME
|
prevrit = rows().end();
|
||||||
// In here prevrit could be set to rows().end(). (Lgb)
|
|
||||||
} else {
|
} else {
|
||||||
first_phys_pit = tmprit->par();
|
first_phys_pit = tmprit->par();
|
||||||
while (tmprit != rows().begin()
|
while (tmprit != rows().begin()
|
||||||
@ -663,18 +663,7 @@ void LyXText::redoParagraphs(LyXCursor const & cur,
|
|||||||
--tmprit;
|
--tmprit;
|
||||||
y -= tmprit->height();
|
y -= tmprit->height();
|
||||||
}
|
}
|
||||||
#warning FIXME
|
|
||||||
// Is it possible to put the prevrit setting in here? (Lgb)
|
|
||||||
}
|
|
||||||
|
|
||||||
RowList::iterator prevrit;
|
|
||||||
bool good_prevrit = false;
|
|
||||||
#warning FIXME
|
|
||||||
// It seems to mee that good_prevrit is not needed if we let
|
|
||||||
// a bad prevrit have the value rows().end() (Lgb)
|
|
||||||
if (tmprit != rows().begin()) {
|
|
||||||
prevrit = boost::prior(tmprit);
|
prevrit = boost::prior(tmprit);
|
||||||
good_prevrit = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove it
|
// remove it
|
||||||
@ -685,24 +674,18 @@ void LyXText::redoParagraphs(LyXCursor const & cur,
|
|||||||
|
|
||||||
// Reinsert the paragraphs.
|
// Reinsert the paragraphs.
|
||||||
ParagraphList::iterator tmppit = first_phys_pit;
|
ParagraphList::iterator tmppit = first_phys_pit;
|
||||||
#warning FIXME
|
|
||||||
// See if this loop can be rewritten as a while loop instead.
|
|
||||||
// That should also make the code a bit easier to read. (Lgb)
|
|
||||||
do {
|
|
||||||
if (tmppit != ownerParagraphs().end()) {
|
|
||||||
insertParagraph(tmppit, tmprit);
|
|
||||||
while (tmprit != rows().end()
|
|
||||||
&& tmprit->par() == tmppit) {
|
|
||||||
++tmprit;
|
|
||||||
}
|
|
||||||
++tmppit;
|
|
||||||
}
|
|
||||||
} while (tmppit != ownerParagraphs().end() && tmppit != endpit);
|
|
||||||
|
|
||||||
#warning FIXME
|
while (tmppit != ownerParagraphs().end()) {
|
||||||
// If the above changes are done, then we can compare prevrit
|
insertParagraph(tmppit, tmprit);
|
||||||
// with rows().end() here. (Lgb)
|
while (tmprit != rows().end()
|
||||||
if (good_prevrit) {
|
&& tmprit->par() == tmppit) {
|
||||||
|
++tmprit;
|
||||||
|
}
|
||||||
|
++tmppit;
|
||||||
|
if (tmppit == endpit)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (prevrit != rows().end()) {
|
||||||
setHeightOfRow(prevrit);
|
setHeightOfRow(prevrit);
|
||||||
const_cast<LyXText *>(this)->postPaint(y - prevrit->height());
|
const_cast<LyXText *>(this)->postPaint(y - prevrit->height());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user