diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/FillHandleLayerPainter.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/FillHandleLayerPainter.java index c62bd79a6..328b7339a 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/FillHandleLayerPainter.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/FillHandleLayerPainter.java @@ -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 @@ -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; diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/command/FillHandlePasteCommandHandler.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/command/FillHandlePasteCommandHandler.java index ac123d52d..1da963030 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/command/FillHandlePasteCommandHandler.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/fillhandle/command/FillHandlePasteCommandHandler.java @@ -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 @@ -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)); }