Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #86 - [FillHandle] Improve fault handling #87

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*****************************************************************************
* Copyright (c) 2015, 2020 CEA LIST and others.
* Copyright (c) 2015, 2024 CEA LIST and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -221,6 +221,12 @@ public void paintLayer(
IConfigRegistry configRegistry) {

Rectangle positionRectangle = getPositionRectangleFromPixelRectangle(natLayer, pixelRectangle);

// nothing to draw, we exit
if (positionRectangle.width <= 0 || positionRectangle.height <= 0) {
return;
}

int columnPositionOffset = positionRectangle.x;
int rowPositionOffset = positionRectangle.y;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*****************************************************************************
* Copyright (c) 2015, 2020 CEA LIST.
* Copyright (c) 2015, 2024 CEA LIST.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -98,13 +98,12 @@ public boolean doCommand(ILayer targetLayer, FillHandlePasteCommand command) {
for (int j = 0; j < pasteWidth; j++) {
ILayerCell cell = cells[(j + columnStartAdjustment) % this.clipboard.getCopiedCells()[0].length];

Object cellValue = getPasteValue(cell, command, pasteColumn, pasteRow);

if (EditUtils.isCellEditable(
new PositionCoordinate(this.selectionLayer,
pasteColumn,
pasteRow),
command.configRegistry)) {
Object cellValue = getPasteValue(cell, command, pasteColumn, pasteRow);
this.selectionLayer.doCommand(new UpdateDataCommand(this.selectionLayer, pasteColumn, pasteRow, cellValue));
}

Expand Down