-void MathCursor::seldump(char const *) const
+void MathCursor::seldump(char const * str) const
{
//lyxerr << "SEL: " << str << ": '" << theSelection << "'\n";
//dump(" Pos");
return;
{
//lyxerr << "SEL: " << str << ": '" << theSelection << "'\n";
//dump(" Pos");
return;
- //lyxerr << "\n\n\\n=================vvvvvvvvvvvvv======================= "
- // << str << "\ntheSelection: " << theSelection;
- //for (unsigned int i = 0; i < Cursor_.size(); ++i)
- // lyxerr << Cursor_[i].par_ << "\n'" << Cursor_[i].cell() << "'\n";
+ lyxerr << "\n\n\n=================vvvvvvvvvvvvv======================= "
+ << str << "\ntheSelection: " << selection_
+ << " '" << theSelection.glue() << "'\n";
+ for (unsigned int i = 0; i < Cursor_.size(); ++i)
+ lyxerr << Cursor_[i].par_ << "\n'" << Cursor_[i].cell() << "'\n";
+ lyxerr << "\n";
+ for (unsigned int i = 0; i < Anchor_.size(); ++i)
+ lyxerr << Anchor_[i].par_ << "\n'" << Anchor_[i].cell() << "'\n";
//lyxerr << "\ncursor.pos_: " << cursor().pos_;
//lyxerr << "\nanchor.pos_: " << anchor().pos_;
//lyxerr << "\ncursor.pos_: " << cursor().pos_;
//lyxerr << "\nanchor.pos_: " << anchor().pos_;
- //lyxerr << "\n===================^^^^^^^^^^^^=====================\n\n\n";
+ lyxerr << "\n===================^^^^^^^^^^^^=====================\n\n\n";
}
array().insert(cursor().pos_, c, t);
}
array().insert(cursor().pos_, c, t);
}
array().insert(cursor().pos_, p);
}
array().insert(cursor().pos_, p);
if (selection_) {
theSelection.grab(*this);
theSelection.erase(*this);
if (selection_) {
theSelection.grab(*this);
theSelection.erase(*this);
+ selClear();
+ } else {
+ theSelection.clear();
void MathCursor::selHandle(bool sel)
{
void MathCursor::selHandle(bool sel)
{
- if (sel && !selection_)
- selStart();
- if (!sel && selection_)
- selClear();
+ if (sel == selection_)
+ return;
+
+ theSelection.clear();
+ Anchor_ = Cursor_;
+ selection_ = sel;
Anchor_ = Cursor_;
selection_ = true;
}
Anchor_ = Cursor_;
selection_ = true;
}
void MathCursor::selClear()
{
void MathCursor::selClear()
{