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:
Georg Baum 2015-03-19 21:44:25 +01:00
parent c54b136880
commit 82263ccad9
2 changed files with 23 additions and 1 deletions

View File

@ -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

View File

@ -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