Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 580822

Summary: AutoResizeColumnCommandHandler might skip the TurnViewportOnCommand
Product: [Technology] NatTable Reporter: Gerhard Kreuzer <gerhard.kreuzer>
Component: CoreAssignee: Project Inbox <nattable.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk.fauth, gerhard.kreuzer
Version: 2.0.2   
Target Milestone: 2.0.4   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/196084
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=1aa3202e7759dd103eebce3188ebfc9a96ced6a1
Whiteboard:

Description Gerhard Kreuzer CLA 2022-09-28 02:15:24 EDT
From AutoResizeColumnCommandHandler (lines 97 to 103):

        // only perform further actions if the widths could be calculated
        // could fail and return null for example if the GCFactory fails
        if (gridColumnWidths != null && gridColumnWidths.length > 0) {
            this.commandLayer.doCommand(
                    new MultiColumnResizeCommand(this.commandLayer, gridColumnPositions, gridColumnWidths, true));
            targetLayer.doCommand(new TurnViewportOnCommand());
        }

In my opinion, the TurnViewportOnCommand should not be controlled by the if clause, but executed anyway, because the viewport was unconditionally turned off as first operation in the doCommand() method.
Comment 1 Eclipse Genie CLA 2022-09-28 04:25:13 EDT
New Gerrit change created: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/196084
Comment 3 Dirk Fauth CLA 2022-09-28 05:56:11 EDT
Yes I share your opinion. If the viewport is always turned off, it should always be turned on again.
Comment 4 Dirk Fauth CLA 2022-12-14 14:58:33 EST
Released with 2.0.4