Skip to content

Commit bf0683f

Browse files
committed
Minor changes.
Check if styles set is initialized. Delete unnecessary test.
1 parent 9d27a8e commit bf0683f

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

layout/src/main/java/com/itextpdf/layout/element/Cell.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ public Cell clone(boolean includeContent) {
196196
newCell.row = row;
197197
newCell.col = col;
198198
newCell.properties = new HashMap<>(properties);
199-
newCell.styles = new LinkedHashSet<>(styles);
199+
if (null != styles) {
200+
newCell.styles = new LinkedHashSet<>(styles);
201+
}
200202
if (includeContent) {
201203
newCell.childElements = new ArrayList<>(childElements);
202204
}

layout/src/test/java/com/itextpdf/layout/TableTest.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,27 +1285,6 @@ public void cellAlignmentAndSplittingTest01() throws IOException, InterruptedExc
12851285
}
12861286

12871287

1288-
@Test
1289-
public void memoryTest01() throws IOException, InterruptedException {
1290-
String testName = "memoryTest01.pdf";
1291-
String outFileName = destinationFolder + testName;
1292-
String cmpFileName = sourceFolder + "cmp_" + testName;
1293-
1294-
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(outFileName));
1295-
Document doc = new Document(pdfDoc);
1296-
1297-
Table table = new Table(5);
1298-
for (int i = 0; i < 20000; i++) {
1299-
for (int j = 0; j < 5; j++) {
1300-
table.addCell(j + " Liberté!\nÉgalité!\nFraternité!");
1301-
}
1302-
}
1303-
doc.add(table);
1304-
1305-
doc.close();
1306-
Assert.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, destinationFolder, testName + "_diff"));
1307-
}
1308-
13091288
@Test
13101289
public void cellAlignmentAndKeepTogetherTest01() throws IOException, InterruptedException {
13111290
String testName = "cellAlignmentAndKeepTogetherTest01.pdf";

0 commit comments

Comments
 (0)