Skip to content
Snippets Groups Projects
Commit cec88084 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Fixed #185 - Remove pad from old page even if new pad is null. Prevent issue...

Fixed #185 -  Remove pad from old page even if new pad is null. Prevent issue of removing wrong pad on multipage move drag & drop action
parent 6724e7bf
Branches
Tags
No related merge requests found
......@@ -107,18 +107,15 @@ public class Project implements IProject {
}
public void setPad(PadIndex index, Pad pad) {
if (pad == null) {
return;
}
// Remove Pad from old location
if (pad.getPage().getPosition() != index.getPagePosition()) {
Page oldPage = pad.getPage();
// Remove Pad from old location if page changed
if (pad != null && pad.getPage().getPosition() != index.getPagePosition()) {
final Page oldPage = pad.getPage();
if (oldPage.getPad(pad.getPosition()).equals(pad)) {
oldPage.setPad(index.getId(), null);
}
}
Page page = pages.get(index.getPagePosition());
final Page page = pages.get(index.getPagePosition());
page.setPad(index.getId(), pad);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment