mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +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>
|
2003-04-14 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* LColor.[Ch]: scrap LColor mathcursor.
|
* LColor.[Ch]: scrap LColor mathcursor.
|
||||||
|
32
src/text3.C
32
src/text3.C
@ -43,6 +43,7 @@
|
|||||||
using std::endl;
|
using std::endl;
|
||||||
using std::find;
|
using std::find;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
using lyx::pos_type;
|
||||||
|
|
||||||
extern string current_layout;
|
extern string current_layout;
|
||||||
extern int bibitemMaxWidth(BufferView *, LyXFont const &);
|
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,
|
bool LyXText::gotoNextInset(vector<Inset::Code> const & codes,
|
||||||
string const & contents)
|
string const & contents)
|
||||||
{
|
{
|
||||||
LyXCursor res = cursor;
|
ParagraphList::iterator end = ownerParagraphs().end();
|
||||||
|
ParagraphList::iterator pit = cursor.par();
|
||||||
|
pos_type pos = cursor.pos();
|
||||||
|
|
||||||
Inset * inset;
|
Inset * inset;
|
||||||
do {
|
do {
|
||||||
if (res.pos() < res.par()->size() - 1) {
|
if (pos + 1 < pit->size()) {
|
||||||
res.pos(res.pos() + 1);
|
++pos;
|
||||||
} else {
|
} else {
|
||||||
res.par(boost::next(res.par()));
|
++pit;
|
||||||
res.pos(0);
|
pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (res.par() != ownerParagraphs().end()&&
|
} while (pit != end &&
|
||||||
!(res.par()->isInset(res.pos())
|
!(pit->isInset(pos) &&
|
||||||
&& (inset = res.par()->getInset(res.pos())) != 0
|
(inset = pit->getInset(pos)) != 0 &&
|
||||||
&& find(codes.begin(), codes.end(), inset->lyxCode())
|
find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end() &&
|
||||||
!= codes.end()
|
(contents.empty() ||
|
||||||
&& (contents.empty() ||
|
static_cast<InsetCommand *>(pit->getInset(pos))->getContents()
|
||||||
static_cast<InsetCommand *>(
|
|
||||||
res.par()->getInset(res.pos()))->getContents()
|
|
||||||
== contents)));
|
== contents)));
|
||||||
|
|
||||||
if (res.par() != ownerParagraphs().end()) {
|
if (pit != end) {
|
||||||
setCursor(res.par(), res.pos(), false);
|
setCursor(pit, pos, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user