Fix crash on moving or coping the note while the selection is empty.

This resolves issue #11.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 7c7f7a8147)
r14.0.x
Slávek Banko 2 years ago
parent e1ae8a61ad
commit dfe0af7d33
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -2415,7 +2415,7 @@ void Basket::contentsMouseMoveEvent(TQMouseEvent *event)
m_isSelecting = false; // Don't draw selection rectangle ater drag!
m_selectionStarted = false;
NoteSelection *selection = selectedNotes();
if (selection->firstStacked()) {
if (selection && selection->firstStacked()) {
TQDragObject *d = NoteDrag::dragObject(selection, /*cutting=*/false, /*source=*/this); // d will be deleted by QT
/*bool shouldRemove = */d->drag();
// delete selection;
@ -4204,7 +4204,7 @@ void Basket::doCopy(CopyMode copyMode)
NoteSelection *selection = selectedNotes();
int countCopied = countSelecteds();
if (selection->firstStacked()) {
if (selection && selection->firstStacked()) {
TQDragObject *d = NoteDrag::dragObject(selection, copyMode == CutToClipboard, /*source=*/0); // d will be deleted by QT
// /*bool shouldRemove = */d->drag();
// delete selection;

Loading…
Cancel
Save