Skip to content
Open
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
Expand Up @@ -17,6 +17,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand All @@ -42,6 +43,7 @@
import org.eclipse.set.basis.exceptions.FileExportException;
import org.eclipse.set.feature.export.pdf.TableToTableDocument;
import org.eclipse.set.model.tablemodel.CompareFootnoteContainer;
import org.eclipse.set.model.tablemodel.CompareTableFootnoteContainer;
import org.eclipse.set.model.tablemodel.Footnote;
import org.eclipse.set.model.tablemodel.FootnoteContainer;
import org.eclipse.set.model.tablemodel.SimpleFootnoteContainer;
Expand Down Expand Up @@ -245,17 +247,27 @@ private static void fillSheet(final Sheet sheet, final List<TableRow> rows,
}
}

private static void fillFootnoteCell(final Cell cell,
final String cellContent, final List<FootnoteInfo> allFootnotes,
final FootnoteContainer fnContainer, final boolean inlineFootnote) {
final List<Footnote> footnotes = switch (fnContainer) {
private static List<Footnote> getFootnotes(
final FootnoteContainer fnContainer) {
if (fnContainer == null) {
return Collections.emptyList();
}
return switch (fnContainer) {
case final SimpleFootnoteContainer simpleContainer -> simpleContainer
.getFootnotes();
case final CompareFootnoteContainer compareContainer -> compareContainer
.getUnchangedFootnotes()
.getFootnotes();
default -> throw new IllegalArgumentException();
case final CompareTableFootnoteContainer compareContainer -> getFootnotes(
compareContainer.getMainPlanFootnoteContainer());
default -> Collections.emptyList();
};
}

private static void fillFootnoteCell(final Cell cell,
final String cellContent, final List<FootnoteInfo> allFootnotes,
final FootnoteContainer fnContainer, final boolean inlineFootnote) {
final List<Footnote> footnotes = getFootnotes(fnContainer);
final List<FootnoteInfo> fnInfo = footnotes.stream()
.map(fn -> TableExtensions.getFootnoteInfo(allFootnotes, fn))
.filter(Objects::nonNull)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,13 @@ class CellContentExtensions {
if (content.mainPlanCellContent === null) {
return content.mainPlanCellContent.plainStringValue
}

return '''«content.mainPlanCellContent.plainStringValue»/«content.comparePlanCellContent.plainStringValue»'''

val mainContent = content.mainPlanCellContent.plainStringValue
val compareContent = content.comparePlanCellContent.plainStringValue
if (mainContent.isNullOrEmpty && compareContent.nullOrEmpty) {
return ""
}
return '''«mainContent»/«compareContent»'''
}

static def dispatch Iterable<String> getStringValueIterable(Void content) {
Expand Down
Loading