Skip to content

Commit

Permalink
[26428] ETFDropReceiver lock consultation
Browse files Browse the repository at this point in the history
  • Loading branch information
col-panic committed Jun 14, 2024
1 parent 0cacfad commit a910061
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.swt.graphics.Point;

import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.data.service.LocalLockServiceHolder;
import ch.elexis.core.model.Identifiable;
import ch.elexis.core.ui.UiDesk;
import ch.elexis.core.ui.util.GenericObjectDropTarget.IReceiver;
Expand Down Expand Up @@ -68,7 +69,7 @@ public void dropped(List<Object> list, DropTargetEvent e) {
Point maxOffset = etf.text.getLocationAtOffset(etf.text.getCharCount());
int pos = etf.text.getCharCount();
if (mapped.y < maxOffset.y) {
pos = etf.text.getOffsetAtLocation(new Point(0, mapped.y));
pos = etf.text.getOffsetAtPoint(new Point(0, mapped.y));
}
Object object = list.get(0);
IKonsExtension rec = getTargetForObject(object);
Expand All @@ -78,8 +79,11 @@ public void dropped(List<Object> list, DropTargetEvent e) {
} else {
Konsultation actKons = (Konsultation) ElexisEventDispatcher.getSelected(Konsultation.class);
if (actKons != null) {
etf.text.insert(getLabel(object));
actKons.updateEintrag(etf.getContentsAsXML(), false);
if (LocalLockServiceHolder.get().acquireLock(actKons).isOk()) {
etf.text.insert(getLabel(object));
actKons.updateEintrag(etf.getContentsAsXML(), false);
LocalLockServiceHolder.get().releaseLock(actKons);
}
}
}
}
Expand Down

0 comments on commit a910061

Please sign in to comment.