From 2d6759de52a991cde443e19fb431abe4cec1a554 Mon Sep 17 00:00:00 2001 From: Quang Truong Date: Mon, 27 Apr 2026 11:59:56 +0200 Subject: [PATCH 1/2] Fix sort exception by single plan --- .../sorting/CompareRouteAndKmCriterion.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/java/bundles/org.eclipse.set.utils.table/src/org/eclipse/set/utils/table/sorting/CompareRouteAndKmCriterion.java b/java/bundles/org.eclipse.set.utils.table/src/org/eclipse/set/utils/table/sorting/CompareRouteAndKmCriterion.java index 2fb674adac..a62a89b5a8 100644 --- a/java/bundles/org.eclipse.set.utils.table/src/org/eclipse/set/utils/table/sorting/CompareRouteAndKmCriterion.java +++ b/java/bundles/org.eclipse.set.utils.table/src/org/eclipse/set/utils/table/sorting/CompareRouteAndKmCriterion.java @@ -116,17 +116,23 @@ public int compare(final TableRow o1, final TableRow o2) { private static Ur_Objekt getCompareObjekt(final TableRow row, final TableType tableType) { final Ur_Objekt obj = TableRowExtensions.getLeadingObject(row); - if (tableType == null || tableType == TableType.INITIAL) { + if (tableType == null) { return obj; } - final PlanPro_Schnittstelle planProSchnittstelle = UrObjectExtensions - .getPlanProSchnittstelle(obj); - final MultiContainer_AttributeGroup finalContainer = PlanProSchnittstelleExtensions - .getContainer(planProSchnittstelle, ContainerType.FINAL); - final Ur_Objekt finalObject = MultiContainer_AttributeGroupExtensions - .getObject(finalContainer, obj.getClass(), - obj.getIdentitaet().getWert()); - return finalObject == null ? obj : finalObject; + return switch (tableType) { + case DIFF, FINAL -> { + final PlanPro_Schnittstelle planProSchnittstelle = UrObjectExtensions + .getPlanProSchnittstelle(obj); + final MultiContainer_AttributeGroup finalContainer = PlanProSchnittstelleExtensions + .getContainer(planProSchnittstelle, + ContainerType.FINAL); + final Ur_Objekt finalObject = MultiContainer_AttributeGroupExtensions + .getObject(finalContainer, obj.getClass(), + obj.getIdentitaet().getWert()); + yield finalObject == null ? obj : finalObject; + } + default -> obj; + }; } // IMPROVE: the determine route and km can be depended on the From 64e140da11fac5977a84fa1bcd7fa99801c99fda Mon Sep 17 00:00:00 2001 From: Quang Truong Date: Mon, 27 Apr 2026 16:22:33 +0200 Subject: [PATCH 2/2] Fix PDF excel cell style --- .../utils/export/xsl/TransformTableBody.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/java/bundles/org.eclipse.set.utils/src/org/eclipse/set/utils/export/xsl/TransformTableBody.java b/java/bundles/org.eclipse.set.utils/src/org/eclipse/set/utils/export/xsl/TransformTableBody.java index e1519f2757..3d883fcbd8 100644 --- a/java/bundles/org.eclipse.set.utils/src/org/eclipse/set/utils/export/xsl/TransformTableBody.java +++ b/java/bundles/org.eclipse.set.utils/src/org/eclipse/set/utils/export/xsl/TransformTableBody.java @@ -101,24 +101,23 @@ private Set> groupCellByStyle(final Set pageBreakAts) { throw new RuntimeException( "Missing first data row. Is the printing area configured correctly?"); //$NON-NLS-1$ } - for (int i = 0; i <= getHeaderLastColumnIndex(sheet); i++) { - final Cell cellAt = getCellAt(sheet, firstDataRow.getRowNum(), i) - .orElse(firstDataRow.createCell(i)); - - if (parentGroupLastIndex.contains(i) || pageBreakAts.contains(i)) { - setExcelCellBorderStyle(cellAt, BorderDirection.RIGHT, + getFirstDataRow(sheet).forEach(cell -> { + final int index = cell.getColumnIndex() - 1; + if (parentGroupLastIndex.contains(index) + || pageBreakAts.contains(index)) { + setExcelCellBorderStyle(cell, BorderDirection.RIGHT, BorderStyle.MEDIUM); // Set border style for The break column and the after - } else if (pageBreakAts.contains(i - 1)) { - setExcelCellBorderStyle(cellAt, BorderDirection.LEFT, + } else if (pageBreakAts.contains(index - 1)) { + setExcelCellBorderStyle(cell, BorderDirection.LEFT, BorderStyle.MEDIUM); } - if (!isDefaultStyle(cellAt.getCellStyle())) { + if (!isDefaultStyle(cell.getCellStyle())) { Set sameStyleGroup = result.stream() .filter(cells -> cells.stream() - .filter(cell -> isEquals(cellAt.getCellStyle(), - cell.getCellStyle())) + .filter(c -> isEquals(cell.getCellStyle(), + c.getCellStyle())) .findFirst() .orElse(null) != null) .findFirst() @@ -127,9 +126,9 @@ private Set> groupCellByStyle(final Set pageBreakAts) { sameStyleGroup = new LinkedHashSet<>(); result.add(sameStyleGroup); } - sameStyleGroup.add(cellAt); + sameStyleGroup.add(cell); } - } + }); return result; }