mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 16:37:28 +00:00
*** empty log message ***
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8931 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6cb284c727
commit
11c69712d3
@ -410,6 +410,17 @@ void DocIterator::backwardPos()
|
||||
}
|
||||
|
||||
|
||||
bool DocIterator::hasPart(DocIterator const & it) const
|
||||
{
|
||||
// it can't be a part if it is larger
|
||||
if (it.size() > size())
|
||||
return false;
|
||||
|
||||
// as inset adresses are the 'last' level
|
||||
return &it.back().inset() == &operator[](it.size() - 1).inset();
|
||||
}
|
||||
|
||||
|
||||
std::ostream & operator<<(std::ostream & os, DocIterator const & dit)
|
||||
{
|
||||
for (size_t i = 0, n = dit.size(); i != n; ++i)
|
||||
|
@ -185,6 +185,9 @@ public:
|
||||
/// move backward one inset
|
||||
void backwardInset();
|
||||
|
||||
/// are we some 'extension' (i.e. deeper nested) of the given iterator
|
||||
bool hasPart(DocIterator const & it) const;
|
||||
|
||||
/// output
|
||||
friend std::ostream &
|
||||
operator<<(std::ostream & os, DocIterator const & cur);
|
||||
|
@ -927,7 +927,7 @@ void MathNestInset::lfunMouseMotion(LCursor & cur, FuncRequest & cmd)
|
||||
if (cmd.button() == mouse_button::button1) {
|
||||
LCursor & bvcur = cur.bv().cursor();
|
||||
if (abs(cmd.x - first_x) + abs(cmd.y - first_y) > 4
|
||||
&& cur.size() <= bvcur.anchor_.size()) {
|
||||
&& bvcur.anchor_.hasPart(cur)) {
|
||||
first_x = cmd.x;
|
||||
first_y = cmd.y;
|
||||
|
||||
|
@ -1129,7 +1129,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
|
||||
// ignore motions deeper nested than the real anchor
|
||||
LCursor & bvcur = cur.bv().cursor();
|
||||
if (bvcur.anchor_.size() < cur.size())
|
||||
if (!bvcur.anchor_.hasPart(cur))
|
||||
break;
|
||||
|
||||
CursorSlice old = cur.top();
|
||||
|
Loading…
x
Reference in New Issue
Block a user