mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
lyxtext-3-a.diff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6804 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3694058883
commit
2da34093a2
@ -1,3 +1,7 @@
|
||||
2003-04-14 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* text3.C (gotoNextInset): use separate tmp vars for par and pos.
|
||||
|
||||
2003-04-14 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* LColor.[Ch]: scrap LColor mathcursor.
|
||||
|
34
src/text3.C
34
src/text3.C
@ -43,6 +43,7 @@
|
||||
using std::endl;
|
||||
using std::find;
|
||||
using std::vector;
|
||||
using lyx::pos_type;
|
||||
|
||||
extern string current_layout;
|
||||
extern int bibitemMaxWidth(BufferView *, LyXFont const &);
|
||||
@ -170,28 +171,29 @@ Inset * LyXText::checkInsetHit(int & x, int & y)
|
||||
bool LyXText::gotoNextInset(vector<Inset::Code> const & codes,
|
||||
string const & contents)
|
||||
{
|
||||
LyXCursor res = cursor;
|
||||
ParagraphList::iterator end = ownerParagraphs().end();
|
||||
ParagraphList::iterator pit = cursor.par();
|
||||
pos_type pos = cursor.pos();
|
||||
|
||||
Inset * inset;
|
||||
do {
|
||||
if (res.pos() < res.par()->size() - 1) {
|
||||
res.pos(res.pos() + 1);
|
||||
if (pos + 1 < pit->size()) {
|
||||
++pos;
|
||||
} else {
|
||||
res.par(boost::next(res.par()));
|
||||
res.pos(0);
|
||||
++pit;
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
} while (res.par() != ownerParagraphs().end()&&
|
||||
!(res.par()->isInset(res.pos())
|
||||
&& (inset = res.par()->getInset(res.pos())) != 0
|
||||
&& find(codes.begin(), codes.end(), inset->lyxCode())
|
||||
!= codes.end()
|
||||
&& (contents.empty() ||
|
||||
static_cast<InsetCommand *>(
|
||||
res.par()->getInset(res.pos()))->getContents()
|
||||
== contents)));
|
||||
} while (pit != end &&
|
||||
!(pit->isInset(pos) &&
|
||||
(inset = pit->getInset(pos)) != 0 &&
|
||||
find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end() &&
|
||||
(contents.empty() ||
|
||||
static_cast<InsetCommand *>(pit->getInset(pos))->getContents()
|
||||
== contents)));
|
||||
|
||||
if (res.par() != ownerParagraphs().end()) {
|
||||
setCursor(res.par(), res.pos(), false);
|
||||
if (pit != end) {
|
||||
setCursor(pit, pos, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user