mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Check whether MathRow exists when computing caret metrics
Fixes bug #12888.
This commit is contained in:
parent
e651e15a99
commit
7eecab5902
@ -435,6 +435,12 @@ CoordCache const & BufferView::coordCache() const
|
||||
}
|
||||
|
||||
|
||||
bool BufferView::hasMathRow(MathData const * cell) const
|
||||
{
|
||||
return d->math_rows_.find(cell) != d->math_rows_.end();
|
||||
}
|
||||
|
||||
|
||||
MathRow const & BufferView::mathRow(MathData const * cell) const
|
||||
{
|
||||
auto it = d->math_rows_.find(cell);
|
||||
@ -3323,7 +3329,7 @@ bool BufferView::paragraphVisible(DocIterator const & dit) const
|
||||
void BufferView::caretPosAndDim(Point & p, Dimension & dim) const
|
||||
{
|
||||
Cursor const & cur = cursor();
|
||||
if (cur.inMathed()) {
|
||||
if (cur.inMathed() && hasMathRow(&cur.cell())) {
|
||||
MathRow const & mrow = mathRow(&cur.cell());
|
||||
dim = mrow.caret_dim;
|
||||
} else {
|
||||
|
@ -321,6 +321,8 @@ public:
|
||||
///
|
||||
CoordCache const & coordCache() const;
|
||||
|
||||
///
|
||||
bool hasMathRow(MathData const * cell) const;
|
||||
///
|
||||
MathRow const & mathRow(MathData const * cell) const;
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user