mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
Move leaveInset and isInside from CursorData to DocIterator
They only touch the slices of the main DocIterator.
This commit is contained in:
parent
86398b5d91
commit
4727e2becf
@ -571,26 +571,6 @@ void CursorData::sanitize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CursorData::isInside(Inset const * p) const
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i != depth(); ++i)
|
|
||||||
if (&operator[](i).inset() == p)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CursorData::leaveInset(Inset const & inset)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i != depth(); ++i) {
|
|
||||||
if (&operator[](i).inset() == &inset) {
|
|
||||||
resize(i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool CursorData::undoAction()
|
bool CursorData::undoAction()
|
||||||
{
|
{
|
||||||
if (!buffer()->undo().undoAction(*this))
|
if (!buffer()->undo().undoAction(*this))
|
||||||
|
@ -171,10 +171,6 @@ public:
|
|||||||
/// Repopulate the slices insets from bottom to top. Useful
|
/// Repopulate the slices insets from bottom to top. Useful
|
||||||
/// for stable iterators or Undo data.
|
/// for stable iterators or Undo data.
|
||||||
void sanitize();
|
void sanitize();
|
||||||
///
|
|
||||||
bool isInside(Inset const *) const;
|
|
||||||
/// make sure we are outside of given inset
|
|
||||||
void leaveInset(Inset const & inset);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
bool undoAction();
|
bool undoAction();
|
||||||
|
@ -656,6 +656,26 @@ void DocIterator::sanitize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool DocIterator::isInside(Inset const * p) const
|
||||||
|
{
|
||||||
|
for (CursorSlice const & sl : slices_)
|
||||||
|
if (&sl.inset() == p)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DocIterator::leaveInset(Inset const & inset)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i != slices_.size(); ++i) {
|
||||||
|
if (&slices_[i].inset() == &inset) {
|
||||||
|
resize(i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int DocIterator::find(MathData const & cell) const
|
int DocIterator::find(MathData const & cell) const
|
||||||
{
|
{
|
||||||
for (size_t l = 0; l != slices_.size(); ++l) {
|
for (size_t l = 0; l != slices_.size(); ++l) {
|
||||||
|
@ -249,6 +249,10 @@ public:
|
|||||||
/// Repopulate the slices insets from bottom to top. Useful
|
/// Repopulate the slices insets from bottom to top. Useful
|
||||||
/// for stable iterators or Undo data.
|
/// for stable iterators or Undo data.
|
||||||
void sanitize();
|
void sanitize();
|
||||||
|
///
|
||||||
|
bool isInside(Inset const *) const;
|
||||||
|
/// make sure we are outside of given inset
|
||||||
|
void leaveInset(Inset const & inset);
|
||||||
|
|
||||||
/// find index of CursorSlice with &cell() == &cell (or -1 if not found)
|
/// find index of CursorSlice with &cell() == &cell (or -1 if not found)
|
||||||
int find(MathData const & cell) const;
|
int find(MathData const & cell) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user