| 366 | } |
| 367 | |
| 368 | void |
| 369 | Editables::clear_selection () |
| 370 | { |
| 371 | cancel_edits (); |
| 372 | |
| 373 | bool had_transient_selection = false; |
| 374 | bool had_selection = false; |
| 375 | |
| 376 | for (iterator e = begin (); e != end (); ++e) { |
| 377 | if (e->has_selection ()) { |
| 378 | had_selection = true; |
| 379 | } |
| 380 | if (e->has_transient_selection ()) { |
| 381 | had_transient_selection = true; |
| 382 | } |
| 383 | e->select (db::DBox (), lay::Editable::Reset); // clear selection |
| 384 | e->clear_transient_selection (); |
| 385 | e->clear_previous_selection (); |
| 386 | } |
| 387 | |
| 388 | // send a signal to the observers |
| 389 | if (had_transient_selection) { |
| 390 | signal_transient_selection_changed (); |
| 391 | } |
| 392 | if (had_selection) { |
| 393 | signal_selection_changed (); |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | void |
| 398 | Editables::select (const db::DBox &box, lay::Editable::SelectionMode mode) |
no test coverage detected