| 1 | package pro.verron.officestamper.core; | |
| 2 | ||
| 3 | import org.docx4j.XmlUtils; | |
| 4 | import org.docx4j.wml.Tbl; | |
| 5 | import org.docx4j.wml.Tr; | |
| 6 | import pro.verron.officestamper.api.*; | |
| 7 | import pro.verron.officestamper.utils.wml.WmlUtils; | |
| 8 | ||
| 9 | import java.util.List; | |
| 10 | ||
| 11 | import static java.util.stream.Collectors.toList; | |
| 12 | ||
| 13 | /// Represents a standard row in a table. This class provides functionality for manipulating table rows in a document. | |
| 14 | public class StandardRow | |
| 15 | implements Table.Row { | |
| 16 | private final DocxPart part; | |
| 17 | private final Tbl tbl; | |
| 18 | private final Tr tr; | |
| 19 | ||
| 20 | ||
| 21 | /// Constructs a new StandardRow with the specified table row element. | |
| 22 | /// | |
| 23 | /// @param part the document part containing the table | |
| 24 | /// @param tbl the table containing the row | |
| 25 | /// @param tr the table row element to wrap | |
| 26 | public StandardRow(DocxPart part, Tbl tbl, Tr tr) { | |
| 27 | this.part = part; | |
| 28 | this.tbl = tbl; | |
| 29 | this.tr = tr; | |
| 30 | } | |
| 31 | ||
| 32 | @Override | |
| 33 | public void remove() { | |
| 34 |
1
1. remove : removed call to pro/verron/officestamper/utils/wml/WmlUtils::remove → KILLED |
WmlUtils.remove(this.tr); |
| 35 | } | |
| 36 | ||
| 37 | @Override | |
| 38 | public Table table() { | |
| 39 |
1
1. table : replaced return value with null for pro/verron/officestamper/core/StandardRow::table → KILLED |
return new StandardTable(tbl); |
| 40 | } | |
| 41 | ||
| 42 | @Override | |
| 43 | public Table.Row copy() { | |
| 44 |
1
1. copy : replaced return value with null for pro/verron/officestamper/core/StandardRow::copy → KILLED |
return new StandardRow(part, tbl, XmlUtils.deepCopy(tr)); |
| 45 | } | |
| 46 | ||
| 47 | @Override | |
| 48 | public void removeComment(Comment comment) { | |
| 49 |
1
1. removeComment : removed call to pro/verron/officestamper/utils/wml/WmlUtils::deleteCommentFromElements → TIMED_OUT |
WmlUtils.deleteCommentFromElements(comment.getId(), tr.getContent()); |
| 50 | } | |
| 51 | ||
| 52 | @Override | |
| 53 | public List<Hook> hooks() { | |
| 54 |
1
1. hooks : replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardRow::hooks → KILLED |
return Hooks.ofHooks(tr) |
| 55 | .collect(toList()); | |
| 56 | } | |
| 57 | ||
| 58 | @Override | |
| 59 | public Tr asTr() { | |
| 60 |
1
1. asTr : replaced return value with null for pro/verron/officestamper/core/StandardRow::asTr → KILLED |
return tr; |
| 61 | } | |
| 62 | } | |
Mutations | ||
| 34 |
1.1 |
|
| 39 |
1.1 |
|
| 44 |
1.1 |
|
| 49 |
1.1 |
|
| 54 |
1.1 |
|
| 60 |
1.1 |