mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Implement DocIterator::backwardInset()
I thought I would need it to fix bug #9418, but once backwardInset() worked it turned out that it is not needed. However, since it took me some time to figure out the correct implementation I do not want to throw the result away.
This commit is contained in:
parent
c54b136880
commit
82263ccad9
@ -449,6 +449,28 @@ void DocIterator::backwardPos()
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
// works, but currently not needed
|
||||
void DocIterator::backwardInset()
|
||||
{
|
||||
backwardPos();
|
||||
|
||||
while (!empty() && !nextInset()) {
|
||||
if (inTexted()) {
|
||||
pos_type const lastp = lastpos();
|
||||
Paragraph const & par = paragraph();
|
||||
pos_type & pos = top().pos();
|
||||
while (pos > 0 && (pos == lastp || !par.isInset(pos)))
|
||||
--pos;
|
||||
if (pos > 0)
|
||||
break;
|
||||
}
|
||||
backwardPos();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool DocIterator::hasPart(DocIterator const & it) const
|
||||
{
|
||||
// it can't be a part if it is larger
|
||||
|
@ -202,7 +202,7 @@ public:
|
||||
/// move backward one paragraph
|
||||
void backwardPar();
|
||||
/// move backward one inset
|
||||
/// FIXME: This is not implemented!
|
||||
/// not used currently, uncomment if you need it
|
||||
//void backwardInset();
|
||||
|
||||
/// are we some 'extension' (i.e. deeper nested) of the given iterator
|
||||
|
Loading…
Reference in New Issue
Block a user