Table.java

1
/*
2
 * $Id: Table.java 4065 2009-09-16 23:09:11Z psoares33 $
3
 *
4
 * Copyright 1999, 2000, 2001, 2002 by Bruno Lowagie.
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * (the "License"); you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
9
 *
10
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 * for the specific language governing rights and limitations under the License.
13
 *
14
 * The Original Code is 'iText, a free JAVA-PDF library'.
15
 *
16
 * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
17
 * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
18
 * All Rights Reserved.
19
 * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
20
 * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
21
 *
22
 * Contributor(s): all the names of the contributors are added in the source code
23
 * where applicable.
24
 *
25
 * Alternatively, the contents of this file may be used under the terms of the
26
 * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
27
 * provisions of LGPL are applicable instead of those above.  If you wish to
28
 * allow use of your version of this file only under the terms of the LGPL
29
 * License and not to allow others to use your version of this file under
30
 * the MPL, indicate your decision by deleting the provisions above and
31
 * replace them with the notice and other provisions required by the LGPL.
32
 * If you do not delete the provisions above, a recipient may use your version
33
 * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE
34
 *
35
 * This library is free software; you can redistribute it and/or modify it
36
 * under the terms of the MPL as stated above or under the terms of the GNU
37
 * Library General Public License as published by the Free Software Foundation;
38
 * either version 2 of the License, or any later version.
39
 *
40
 * This library is distributed in the hope that it will be useful, but WITHOUT
41
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
42
 * FOR A PARTICULAR PURPOSE. See the GNU LIBRARY GENERAL PUBLIC LICENSE for more
43
 * details.
44
 *
45
 * If you didn't download this code from the following link, you should check if
46
 * you aren't using an obsolete version:
47
 * http://www.lowagie.com/iText/
48
 *
49
 * Some methods in this class were contributed by Geert Poels, Kris Jespers and
50
 * Steve Ogryzek. Check the CVS repository.
51
 */
52
53
package com.lowagie.text;
54
55
import com.lowagie.text.alignment.HorizontalAlignment;
56
import com.lowagie.text.alignment.WithHorizontalAlignment;
57
import java.awt.Dimension;
58
import java.awt.Point;
59
import java.util.ArrayList;
60
import java.util.Iterator;
61
import com.lowagie.text.error_messages.MessageLocalization;
62
63
import com.lowagie.text.pdf.PdfPCell;
64
import com.lowagie.text.pdf.PdfPTable;
65
66
67
/**
68
 * A <CODE>Table</CODE> is a <CODE>Rectangle</CODE> that contains <CODE>Cell</CODE>s,
69
 * ordered in some kind of matrix.
70
 * <P>
71
 * Tables that span multiple pages are cut into different parts automatically.
72
 * If you want a table header to be repeated on every page, you may not forget to
73
 * mark the end of the header section by using the method <CODE>endHeaders()</CODE>.
74
 * <P>
75
 * The matrix of a table is not necessarily an m x n-matrix. It can contain holes
76
 * or cells that are bigger than the unit. Believe me or not, but it took some serious
77
 * thinking to make this as user friendly as possible. I hope you will find the result
78
 * quite simple (I love simple solutions, especially for complex problems).
79
 * I didn't want it to be something as complex as the Java <CODE>GridBagLayout</CODE>.
80
 * <P>
81
 * Example:
82
 * <BLOCKQUOTE><PRE>
83
 * // Remark: You MUST know the number of columns when constructing a Table.
84
 * //         The number of rows is not important.
85
 * <STRONG>Table table = new Table(3);</STRONG>
86
 * <STRONG>table.setBorderWidth(1);</STRONG>
87
 * <STRONG>table.setBorderColor(new Color(0, 0, 255));</STRONG>
88
 * <STRONG>table.setPadding(5);</STRONG>
89
 * <STRONG>table.setSpacing(5);</STRONG>
90
 * Cell cell = new Cell("header");
91
 * cell.setHeader(true);
92
 * cell.setColspan(3);
93
 * <STRONG>table.addCell(cell);</STRONG>
94
 * <STRONG>table.endHeaders();</STRONG>
95
 * cell = new Cell("example cell with colspan 1 and rowspan 2");
96
 * cell.setRowspan(2);
97
 * cell.setBorderColor(new Color(255, 0, 0));
98
 * <STRONG>table.addCell(cell);</STRONG>
99
 * <STRONG>table.addCell("1.1");</STRONG>
100
 * <STRONG>table.addCell("2.1");</STRONG>
101
 * <STRONG>table.addCell("1.2");</STRONG>
102
 * <STRONG>table.addCell("2.2");</STRONG>
103
 * <STRONG>table.addCell("cell test1");</STRONG>
104
 * cell = new Cell("big cell");
105
 * cell.setRowspan(2);
106
 * cell.setColspan(2);
107
 * <STRONG>table.addCell(cell);</STRONG>
108
 * <STRONG>table.addCell("cell test2");</STRONG>
109
 * </PRE></BLOCKQUOTE>
110
 * The result of this code is a table:
111
 *      <TABLE ALIGN="Center" BORDER="1" BORDERCOLOR="#0000ff" CELLPADDING="5" CELLSPACING="5">
112
 *              <TR ALIGN="Left" VALIGN="Left">
113
 *                      <TH ALIGN="Left" COLSPAN="3" VALIGN="Left">
114
 *                              header
115
 *                      </TH>
116
 *              </TR>
117
 *              <TR ALIGN="Left" VALIGN="Left">
118
 *                      <TD ALIGN="Left" BORDERCOLOR="#ff0000" ROWSPAN="2" VALIGN="Left">
119
 *                              example cell with colspan 1 and rowspan 2
120
 *                      </TD>
121
 *                      <TD ALIGN="Left" VALIGN="Left">
122
 *                              1.1
123
 *                      </TD>
124
 *                      <TD ALIGN="Left" VALIGN="Left">
125
 *                              2.1
126
 *                      </TD>
127
 *              </TR>
128
 *              <TR ALIGN="Left" VALIGN="Left">
129
 *                      <TD ALIGN="Left" VALIGN="Left">
130
 *                              1.2
131
 *                      </TD>
132
 *                      <TD ALIGN="Left" VALIGN="Left">
133
 *                              2.2
134
 *                      </TD>
135
 *              </TR>
136
 *              <TR ALIGN="Left" VALIGN="Left">
137
 *                      <TD ALIGN="Left" VALIGN="Left">
138
 *                              cell test1
139
 *                      </TD>
140
 *                      <TD ALIGN="Left" COLSPAN="2" ROWSPAN="2" VALIGN="Left">
141
 *                              big cell
142
 *                      </TD>
143
 *              </TR>
144
 *              <TR ALIGN="Left" VALIGN="Left">
145
 *                      <TD ALIGN="Left" VALIGN="Left">
146
 *                              cell test2
147
 *                      </TD>
148
 *              </TR>
149
 *      </TABLE>
150
 *
151
 * @see         Rectangle
152
 * @see         Element
153
 * @see         Row
154
 * @see         Cell
155
 */
156
157
public class Table extends Rectangle implements LargeElement, WithHorizontalAlignment {
158
    
159
    // membervariables
160
    
161
    /** This is the number of columns in the <CODE>Table</CODE>. */
162
    private int columns;
163
    
164
    /** This is the list of <CODE>Row</CODE>s. */
165
    private ArrayList rows = new ArrayList();
166
    
167
    /** The current Position in the table. */
168
    private Point curPosition = new Point(0, 0);
169
    
170
    /** This Empty Cell contains the DEFAULT layout of each Cell added with the method addCell(String content). */
171
    private Cell defaultCell = new Cell(true);
172
    
173
    /** This is the number of the last row of the table headers. */
174
    private int lastHeaderRow = -1;
175
    
176
    /** This is the horizontal alignment. */
177
    private int alignment = Element.ALIGN_CENTER;
178
    
179
    /** This is cellpadding. */
180
    private float cellpadding;
181
    
182
    /** This is cellspacing. */
183
    private float cellspacing;
184
    
185
    /** This is the width of the table (in percent of the available space). */
186
    private float width = 80;
187
    
188
    /** Is the width a percentage (false) or an absolute width (true)? */
189
    private boolean locked = false;
190
    
191
    /** This is an array containing the widths (in percentages) of every column. */
192
    private float[] widths;
193
    
194
    /** Boolean to track if a table was inserted (to avoid unnecessary computations afterwards) */
195
    private boolean mTableInserted = false;
196
    
197
    /**
198
     * Boolean to automatically fill empty cells before a table is rendered
199
     *  (takes CPU so may be set to false in case of certainty)
200
     */
201
    protected boolean autoFillEmptyCells = false;
202
    
203
    /** If true this table may not be split over two pages. */
204
    boolean tableFitsPage = false;
205
    
206
    /** If true cells may not be split over two pages. */
207
    boolean cellsFitPage = false;
208
    
209
    /** This is the offset of the table. */
210
    float offset = Float.NaN;
211
    
212
    /** if you want to generate tables the old way, set this value to false. */
213
    protected boolean convert2pdfptable = false;
214
    
215
    /**
216
     * Indicates if this is the first time the section was added.
217
     * @since    iText 2.0.8
218
     */
219
    protected boolean notAddedYet = true;
220
    
221
    /**
222
     * Indicates if the PdfPTable is complete once added to the document.
223
     * @since    iText 2.0.8
224
     */
225
    protected boolean complete = true;
226
    
227
    // constructors
228
    
229
    /**
230
     * Constructs a <CODE>Table</CODE> with a certain number of columns.
231
     *
232
     * @param       columns         The number of columns in the table
233
     * @throws      BadElementException if the creator was called with less than 1 column
234
     */
235
    public Table(int columns) throws BadElementException {
236
        this(columns, 1);
237
    }
238
    
239
    /**
240
     * Constructs a <CODE>Table</CODE> with a certain number of columns
241
     * and a certain number of <CODE>Row</CODE>s.
242
     *
243
     * @param       columns         The number of columns in the table
244
     * @param       rows            The number of rows
245
     * @throws      BadElementException if the creator was called with less than 1 column
246
     */
247
    public Table(int columns, int rows) throws BadElementException {
248
        // a Rectangle is create with BY DEFAULT a border with a width of 1
249
        super(0, 0, 0, 0);
250 1 1. : removed call to com/lowagie/text/Table::setBorder → SURVIVED
        setBorder(BOX);
251 1 1. : removed call to com/lowagie/text/Table::setBorderWidth → SURVIVED
        setBorderWidth(1);
252 1 1. : removed call to com/lowagie/text/Cell::setBorder → SURVIVED
        defaultCell.setBorder(BOX);
253
        
254
        // a table should have at least 1 column
255 2 1. : changed conditional boundary → SURVIVED
2. : negated conditional → KILLED
        if (columns <= 0) {
256
            throw new BadElementException(MessageLocalization.getComposedMessage("a.table.should.have.at.least.1.column"));
257
        }
258
        this.columns = columns;
259
        
260
        // a certain number of rows are created
261 3 1. : changed conditional boundary → SURVIVED
2. : negated conditional → SURVIVED
3. : Changed increment from 1 to -1 → TIMED_OUT
        for (int i = 0; i < rows; i++) {
262
            this.rows.add(new Row(columns));
263
        }
264
        curPosition = new Point(0, 0);
265
        
266
        // the DEFAULT widths are calculated
267
        widths = new float[columns];
268 1 1. : Replaced float division with multiplication → SURVIVED
        float width = 100f / columns;
269 3 1. : negated conditional → SURVIVED
2. : changed conditional boundary → KILLED
3. : Changed increment from 1 to -1 → KILLED
        for (int i = 0; i < columns; i++) {
270
            widths[i] = width;
271
        }
272
    }
273
    
274
    /**
275
     * Copy constructor (shallow copy).
276
     */
277
    public Table(Table t) {
278
        super(0, 0, 0, 0);
279 1 1. : removed call to com/lowagie/text/Table::cloneNonPositionParameters → NO_COVERAGE
        this.cloneNonPositionParameters(t);
280
        this.columns = t.columns;
281
        this.rows = t.rows;
282
        this.curPosition = t.curPosition;
283
        this.defaultCell = t.defaultCell;
284
        this.lastHeaderRow = t.lastHeaderRow;
285
        this.alignment = t.alignment;
286
        this.cellpadding = t.cellpadding;
287
        this.cellspacing = t.cellspacing;
288
        this.width = t.width;
289
        this.widths = t.widths;
290
        this.autoFillEmptyCells = t.autoFillEmptyCells;
291
        this.tableFitsPage = t.tableFitsPage;
292
        this.cellsFitPage = t.cellsFitPage;
293
        this.offset = t.offset;
294
        this.convert2pdfptable = t.convert2pdfptable;
295
    }
296
    
297
    // implementation of the Element-methods
298
    
299
    /**
300
     * Processes the element by adding it (or the different parts) to an
301
     * <CODE>ElementListener</CODE>.
302
     *
303
     * @param       listener        an <CODE>ElementListener</CODE>
304
     * @return <CODE>true</CODE> if the element was processed successfully
305
     */
306
    public boolean process(ElementListener listener) {
307
        try {
308 1 1. process : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return listener.add(this);
309
        }
310
        catch(DocumentException de) {
311 1 1. process : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return false;
312
        }
313
    }
314
    
315
    /**
316
     * Gets the type of the text element.
317
     *
318
     * @return  a type
319
     */
320
    public int type() {
321
        return Element.TABLE;
322
    }
323
    
324
    /**
325
     * Gets all the chunks in this element.
326
     *
327
     * @return  an <CODE>ArrayList</CODE>
328
     */
329
    
330
    public ArrayList getChunks() {
331 1 1. getChunks : mutated return of Object value for com/lowagie/text/Table::getChunks to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new ArrayList();
332
    }
333
334
    /**
335
     * @see com.lowagie.text.Element#isNestable()
336
     * @since    iText 2.0.8
337
     */
338
    public boolean isNestable() {
339
        return true;
340
    }
341
    
342
    // getters and setters
343
344
    /**
345
     * Gets the number of columns.
346
     *
347
     * @return    a value
348
     */
349
    public int getColumns() {
350
        return columns;
351
    }
352
    
353
    /**
354
     * Gets the number of rows in this <CODE>Table</CODE>.
355
     *
356
     * @return      the number of rows in this <CODE>Table</CODE>
357
     */
358
    public int size() {
359
        return rows.size();
360
    }
361
    
362
    /**
363
     * Gets the dimension of this table
364
     *
365
     * @return  dimension
366
     */
367
    public Dimension getDimension() {
368 1 1. getDimension : mutated return of Object value for com/lowagie/text/Table::getDimension to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new Dimension(columns, size());
369
    }
370
    
371
    /**
372
     * Gets the default layout of the Table.
373
     * @return a cell with all the defaults
374
     * @since 2.0.7
375
     */
376
    public Cell getDefaultCell() {
377
        return defaultCell;
378
    }
379
    
380
    /**
381
     * Sets the default layout of the Table to
382
     * the provided Cell
383
     * @param value a cell with all the defaults
384
     * @since 2.0.7
385
     */
386
    public void setDefaultCell(Cell value) {
387
        defaultCell = value;
388
    }
389
390
    /**
391
     * Gets the last number of the rows that contain headers.
392
     *  
393
     * @return a rownumber
394
     */
395
    public int getLastHeaderRow() {
396
        return this.lastHeaderRow;
397
    }
398
    
399
    /**
400
     * Sets the horizontal alignment.
401
     *
402
     * @param       value   the new value
403
     */
404
    public void setLastHeaderRow(int value) {
405
        lastHeaderRow = value;
406
    }
407
    
408
    /**
409
     * Marks the last row of the table headers.
410
     *
411
     * @return      the number of the last row of the table headers
412
     */
413
    public int endHeaders() {
414 1 1. endHeaders : Replaced integer subtraction with addition → NO_COVERAGE
        lastHeaderRow = curPosition.x - 1;
415 1 1. endHeaders : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return lastHeaderRow;
416
    }
417
418
    /**
419
     * Gets the horizontal alignment.
420
     *
421
     * @return  a value
422
     */
423
    public int getAlignment() {
424
        return alignment;
425
    }
426
    
427
    /**
428
     * Sets the horizontal alignment.
429
     *
430
     * @param       value   the new value
431
     * @deprecated Setting alignment through unconstrained types is non-obvious and error-prone,
432
     * use {@link Table#setHorizontalAlignment(HorizontalAlignment)} instead
433
     *
434
     */
435
    public void setAlignment(int value) {
436
        alignment = value;
437
    }
438
    
439
    /**
440
     * Sets the alignment of this paragraph.
441
     *
442
     * @param    alignment        the new alignment as a <CODE>String</CODE>
443
     * @deprecated Setting alignment through unconstrained types is non-obvious and error-prone,
444
     * use {@link Table#setHorizontalAlignment(HorizontalAlignment)} instead
445
     */
446
    public void setAlignment(String alignment) {
447
        if (ElementTags.ALIGN_LEFT.equalsIgnoreCase(alignment)) {
448
            this.alignment = Element.ALIGN_LEFT;
449
            return;
450
        }
451
        if (ElementTags.RIGHT.equalsIgnoreCase(alignment)) {
452
            this.alignment = Element.ALIGN_RIGHT;
453
            return;
454
        }
455
        this.alignment = Element.ALIGN_CENTER;
456
    }
457
458
    @Override
459
    public void setHorizontalAlignment(final HorizontalAlignment alignment) {
460 1 1. setHorizontalAlignment : negated conditional → NO_COVERAGE
        if (alignment == null) {
461
            return;
462
        }
463
464
        this.alignment = alignment.getId();
465
    }
466
467
    /**
468
     * Gets the cellpadding.
469
     *
470
     * @return  a value
471
     */
472
    public float getPadding() {
473
        return cellpadding;
474
    }
475
    
476
    /**
477
     * Sets the cellpadding.
478
     *
479
     * @param       value   the new value
480
     */
481
    public void setPadding(float value) {
482
        cellpadding = value;
483
    }
484
485
    /**
486
     * Gets the cellspacing.
487
     *
488
     * @return  a value
489
     */
490
    public float getSpacing() {
491
        return cellspacing;
492
    }
493
    
494
    /**
495
     * Sets the cellspacing.
496
     *
497
     * @param       value   the new value
498
     */
499
    public void setSpacing(float value) {
500
        cellspacing = value;
501
    }
502
    
503
    /**
504
     * Enables/disables automatic insertion of empty cells before table is rendered. (default = false)
505
     * As some people may want to create a table, fill only a couple of the cells and don't bother with
506
     * investigating which empty ones need to be added, this default behavior may be very welcome.
507
     * Disabling is recommended to increase speed. (empty cells should be added through extra code then)
508
     *
509
     * @param       aDoAutoFill   enable/disable autofill
510
     */
511
    public void setAutoFillEmptyCells(boolean aDoAutoFill) {
512
        autoFillEmptyCells = aDoAutoFill;
513
    }
514
515
    /**
516
     * Gets the table width (a percentage).
517
     *
518
     * @return      the table width
519
     */
520
    public float getWidth() {
521
        return width;
522
    }
523
    
524
    /**
525
     * Sets the width of this table (in percentage of the available space).
526
     *
527
     * @param       width           the width
528
     */
529
    public void setWidth(float width) {
530
        this.width = width;
531
    }
532
    
533
    /**
534
     * @return the locked
535
     */
536
    public boolean isLocked() {
537
        return locked;
538
    }
539
540
    /**
541
     * @param locked the locked to set
542
     */
543
    public void setLocked(boolean locked) {
544
        this.locked = locked;
545
    }
546
547
    /**
548
     * Gets the proportional widths of the columns in this <CODE>Table</CODE>.
549
     *
550
     * @return      the proportional widths of the columns in this <CODE>Table</CODE>
551
     */
552
    public float[] getProportionalWidths() {
553
        return widths;
554
    }
555
    
556
    /**
557
     * Sets the widths of the different columns (percentages).
558
     * <P>
559
     * You can give up relative values of borderwidths.
560
     * The sum of these values will be considered 100%.
561
     * The values will be recalculated as percentages of this sum.
562
     * <P>
563
     * example:
564
     * <BLOCKQUOTE><PRE>
565
     * float[] widths = {2, 1, 1};
566
     * <STRONG>table.setWidths(widths)</STRONG>
567
     * </PRE></BLOCKQUOTE>
568
     * The widths will be: a width of 50% for the first column,
569
     * 25% for the second and third column.
570
     *
571
     * @param       widths  an array with values
572
     * @throws BadElementException
573
     */
574
    public void setWidths(float[] widths) throws BadElementException {
575 1 1. setWidths : negated conditional → KILLED
        if (widths.length != columns) {
576
            throw new BadElementException(MessageLocalization.getComposedMessage("wrong.number.of.columns"));
577
        }
578
        
579
        // The sum of all values is 100%
580
        float hundredPercent = 0;
581 3 1. setWidths : negated conditional → SURVIVED
2. setWidths : changed conditional boundary → KILLED
3. setWidths : Changed increment from 1 to -1 → KILLED
        for (int i = 0; i < columns; i++) {
582 1 1. setWidths : Replaced float addition with subtraction → SURVIVED
            hundredPercent += widths[i];
583
        }
584
        
585
        // The different percentages are calculated
586
        float width;
587 1 1. setWidths : Replaced integer subtraction with addition → KILLED
        this.widths[columns - 1] = 100;
588 4 1. setWidths : changed conditional boundary → SURVIVED
2. setWidths : Changed increment from 1 to -1 → SURVIVED
3. setWidths : Replaced integer subtraction with addition → KILLED
4. setWidths : negated conditional → KILLED
        for (int i = 0; i < columns - 1; i++) {
589 2 1. setWidths : Replaced float multiplication with division → NO_COVERAGE
2. setWidths : Replaced float division with multiplication → NO_COVERAGE
            width = (100.0f * widths[i]) / hundredPercent;
590
            this.widths[i] = width;
591 2 1. setWidths : Replaced integer subtraction with addition → NO_COVERAGE
2. setWidths : Replaced float subtraction with addition → NO_COVERAGE
            this.widths[columns - 1] -= width;
592
        }
593
    }
594
    
595
    /**
596
     * Sets the widths of the different columns (percentages).
597
     * <P>
598
     * You can give up relative values of borderwidths.
599
     * The sum of these values will be considered 100%.
600
     * The values will be recalculated as percentages of this sum.
601
     *
602
     * @param       widths  an array with values
603
     * @throws DocumentException
604
     */
605
    public void setWidths(int[] widths) throws DocumentException {
606
        float[] tb = new float[widths.length];
607 2 1. setWidths : changed conditional boundary → NO_COVERAGE
2. setWidths : negated conditional → NO_COVERAGE
        for (int k = 0; k < widths.length; ++k)
608
            tb[k] = widths[k];
609 1 1. setWidths : removed call to com/lowagie/text/Table::setWidths → NO_COVERAGE
        setWidths(tb);
610
    }
611
    
612
    /**
613
     * Checks if this <CODE>Table</CODE> has to fit a page.
614
     *
615
     * @return  true if the table may not be split
616
     */
617
    public boolean isTableFitsPage() {
618
        return tableFitsPage;
619
    }
620
    
621
    /**
622
     * Allows you to control when a page break occurs.
623
     * <P>
624
     * When a table doesn't fit a page, it is split in two parts.
625
     * If you want to avoid this, you should set the <VAR>tableFitsPage</VAR> value to true.
626
     *
627
     * @param   fitPage    enter true if you don't want to split cells
628
     */
629
    public void setTableFitsPage(boolean fitPage) {
630
        this.tableFitsPage = fitPage;
631 2 1. setTableFitsPage : negated conditional → SURVIVED
2. setTableFitsPage : removed call to com/lowagie/text/Table::setCellsFitPage → SURVIVED
        if (fitPage) setCellsFitPage(true);
632
    }
633
    
634
    /**
635
     * Checks if the cells of this <CODE>Table</CODE> have to fit a page.
636
     *
637
     * @return  true if the cells may not be split
638
     */
639
    public boolean isCellsFitPage() {
640
        return cellsFitPage;
641
    }
642
    
643
    /**
644
     * Allows you to control when a page break occurs.
645
     * <P>
646
     * When a cell doesn't fit a page, it is split in two parts.
647
     * If you want to avoid this, you should set the <VAR>cellsFitPage</VAR> value to true.
648
     *
649
     * @param   fitPage    enter true if you don't want to split cells
650
     */
651
    public void setCellsFitPage(boolean fitPage) {
652
        this.cellsFitPage = fitPage;
653
    }
654
    
655
    /**
656
     * Sets the offset of this table.
657
     *
658
     * Normally a newline is added before you add a Table object.
659
     * This newline uses the current leading.
660
     * If you want to control the space between the table and the previous
661
     * element yourself, you have to set the offset of this table.
662
     *
663
     * @param   offset  the space between this table and the previous object.
664
     */
665
    public void setOffset(float offset) {
666
        this.offset = offset;
667
    }
668
    
669
    /**
670
     * Gets the offset of this table.
671
     *
672
     * @return  the space between this table and the previous element.
673
     */
674
    public float getOffset() {
675
        return offset;
676
    }
677
    
678
    /**
679
     * Method to check if the Table should be converted to a PdfPTable or not.
680
     * @return false if the table should be handled the old fashioned way.
681
     */
682
    public boolean isConvert2pdfptable() {
683
        return convert2pdfptable;
684
    }
685
    /**
686
     * If set to true, iText will try to convert the Table to a PdfPTable.
687
     * @param convert2pdfptable true if you want iText to try to convert the Table to a PdfPTable
688
     */
689
    public void setConvert2pdfptable(boolean convert2pdfptable) {
690
        this.convert2pdfptable = convert2pdfptable;
691
    }
692
    
693
    // methods to add content to the table
694
    
695
    /**
696
     * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE> at a certain row and column.
697
     *
698
     * @param       aCell    The <CODE>Cell</CODE> to add
699
     * @param       row     The row where the <CODE>Cell</CODE> will be added
700
     * @param       column  The column where the <CODE>Cell</CODE> will be added
701
     * @throws BadElementException
702
     */
703
    public void addCell(Cell aCell, int row, int column) throws BadElementException {
704 1 1. addCell : removed call to com/lowagie/text/Table::addCell → NO_COVERAGE
        addCell(aCell, new Point(row,column));
705
    }
706
    
707
    /**
708
     * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE> at a certain location.
709
     *
710
     * @param       aCell        The <CODE>Cell</CODE> to add
711
     * @param       aLocation    The location where the <CODE>Cell</CODE> will be added
712
     * @throws BadElementException
713
     */
714
    public void addCell(Cell aCell, Point aLocation) throws BadElementException {
715 1 1. addCell : negated conditional → KILLED
        if (aCell == null) throw new NullPointerException(MessageLocalization.getComposedMessage("addcell.cell.has.null.value"));
716 1 1. addCell : negated conditional → KILLED
        if (aLocation == null) throw new NullPointerException(MessageLocalization.getComposedMessage("addcell.point.has.null.value"));
717 2 1. addCell : removed call to com/lowagie/text/Table::insertTable → SURVIVED
2. addCell : negated conditional → KILLED
        if (aCell.isTable()) insertTable((Table)aCell.getElements().next(), aLocation);
718
        
719 2 1. addCell : changed conditional boundary → SURVIVED
2. addCell : negated conditional → SURVIVED
        if (aLocation.x < 0) throw new BadElementException(MessageLocalization.getComposedMessage("row.coordinate.of.location.must.be.gt.eq.0"));
720 4 1. addCell : changed conditional boundary → SURVIVED
2. addCell : changed conditional boundary → SURVIVED
3. addCell : negated conditional → SURVIVED
4. addCell : negated conditional → SURVIVED
        if ((aLocation.y <= 0) && (aLocation.y > columns)) throw new BadElementException(MessageLocalization.getComposedMessage("column.coordinate.of.location.must.be.gt.eq.0.and.lt.nr.of.columns"));
721 1 1. addCell : negated conditional → SURVIVED
        if (!isValidLocation(aCell, aLocation)) throw new BadElementException(MessageLocalization.getComposedMessage("adding.a.cell.at.the.location.1.2.with.a.colspan.of.3.and.a.rowspan.of.4.is.illegal.beyond.boundaries.overlapping", 
722
                String.valueOf(aLocation.x), String.valueOf(aLocation.y), String.valueOf(aCell.getColspan()), String.valueOf(aCell.getRowspan())));
723
        
724 2 1. addCell : negated conditional → SURVIVED
2. addCell : removed call to com/lowagie/text/Cell::setBorder → SURVIVED
        if (aCell.getBorder() == UNDEFINED) aCell.setBorder(defaultCell.getBorder());
725 1 1. addCell : removed call to com/lowagie/text/Cell::fill → SURVIVED
        aCell.fill();
726 1 1. addCell : removed call to com/lowagie/text/Table::placeCell → SURVIVED
        placeCell(rows, aCell, aLocation);
727 1 1. addCell : removed call to com/lowagie/text/Table::setCurrentLocationToNextValidPosition → SURVIVED
        setCurrentLocationToNextValidPosition(aLocation);
728
    }
729
    
730
    /**
731
     * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
732
     *
733
     * @param       cell         a <CODE>Cell</CODE>
734
     */
735
    public void addCell(Cell cell) {
736
        try {
737 1 1. addCell : removed call to com/lowagie/text/Table::addCell → SURVIVED
            addCell(cell, curPosition);
738
        }
739
        catch(BadElementException bee) {
740
            // don't add the cell
741
        }
742
    }
743
    
744
    /**
745
     * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
746
     * <P>
747
     * This is a shortcut for <CODE>addCell(Cell cell)</CODE>.
748
     * The <CODE>Phrase</CODE> will be converted to a <CODE>Cell</CODE>.
749
     *
750
     * @param       content         a <CODE>Phrase</CODE>
751
     * @throws      BadElementException this should never happen
752
     */
753
    public void addCell(Phrase content) throws BadElementException {
754 1 1. addCell : removed call to com/lowagie/text/Table::addCell → NO_COVERAGE
        addCell(content, curPosition);
755
    }
756
    
757
    /**
758
     * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
759
     * <P>
760
     * This is a shortcut for <CODE>addCell(Cell cell, Point location)</CODE>.
761
     * The <CODE>Phrase</CODE> will be converted to a <CODE>Cell</CODE>.
762
     *
763
     * @param       content         a <CODE>Phrase</CODE>
764
     * @param       location        a <CODE>Point</CODE>
765
     * @throws      BadElementException this should never happen
766
     */
767
    public void addCell(Phrase content, Point location) throws BadElementException {
768
        Cell cell = new Cell(content);
769 1 1. addCell : removed call to com/lowagie/text/Cell::setBorder → NO_COVERAGE
        cell.setBorder(defaultCell.getBorder());
770 1 1. addCell : removed call to com/lowagie/text/Cell::setBorderWidth → NO_COVERAGE
        cell.setBorderWidth(defaultCell.getBorderWidth());
771 1 1. addCell : removed call to com/lowagie/text/Cell::setBorderColor → NO_COVERAGE
        cell.setBorderColor(defaultCell.getBorderColor());
772 1 1. addCell : removed call to com/lowagie/text/Cell::setBackgroundColor → NO_COVERAGE
        cell.setBackgroundColor(defaultCell.getBackgroundColor());
773 1 1. addCell : removed call to com/lowagie/text/Cell::setHorizontalAlignment → NO_COVERAGE
        cell.setHorizontalAlignment(defaultCell.getHorizontalAlignment());
774 1 1. addCell : removed call to com/lowagie/text/Cell::setVerticalAlignment → NO_COVERAGE
        cell.setVerticalAlignment(defaultCell.getVerticalAlignment());
775 1 1. addCell : removed call to com/lowagie/text/Cell::setColspan → NO_COVERAGE
        cell.setColspan(defaultCell.getColspan());
776 1 1. addCell : removed call to com/lowagie/text/Cell::setRowspan → NO_COVERAGE
        cell.setRowspan(defaultCell.getRowspan());
777 1 1. addCell : removed call to com/lowagie/text/Table::addCell → NO_COVERAGE
        addCell(cell, location);
778
    }
779
    
780
    /**
781
     * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
782
     * <P>
783
     * This is a shortcut for <CODE>addCell(Cell cell)</CODE>.
784
     * The <CODE>String</CODE> will be converted to a <CODE>Cell</CODE>.
785
     *
786
     * @param       content         a <CODE>String</CODE>
787
     * @throws      BadElementException this should never happen
788
     */
789
    
790
    public void addCell(String content) throws BadElementException {
791 1 1. addCell : removed call to com/lowagie/text/Table::addCell → NO_COVERAGE
        addCell(new Phrase(content), curPosition);
792
    }
793
    
794
    /**
795
     * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
796
     * <P>
797
     * This is a shortcut for <CODE>addCell(Cell cell, Point location)</CODE>.
798
     * The <CODE>String</CODE> will be converted to a <CODE>Cell</CODE>.
799
     *
800
     * @param       content         a <CODE>String</CODE>
801
     * @param       location        a <CODE>Point</CODE>
802
     * @throws      BadElementException this should never happen
803
     */
804
    public void addCell(String content, Point location) throws BadElementException {
805 1 1. addCell : removed call to com/lowagie/text/Table::addCell → NO_COVERAGE
        addCell(new Phrase(content), location);
806
    }
807
    
808
    /**
809
     * To put a table within the existing table at the current position
810
     * generateTable will of course re-arrange the widths of the columns.
811
     *
812
     * @param   aTable      the table you want to insert
813
     */
814
    public void insertTable(Table aTable) {
815 1 1. insertTable : negated conditional → NO_COVERAGE
        if (aTable == null) throw new NullPointerException(MessageLocalization.getComposedMessage("inserttable.table.has.null.value"));
816 1 1. insertTable : removed call to com/lowagie/text/Table::insertTable → NO_COVERAGE
        insertTable(aTable, curPosition);
817
    }
818
    
819
    /**
820
     * To put a table within the existing table at the given position
821
     * generateTable will of course re-arrange the widths of the columns.
822
     *
823
     * @param       aTable  The <CODE>Table</CODE> to add
824
     * @param       row     The row where the <CODE>Cell</CODE> will be added
825
     * @param       column  The column where the <CODE>Cell</CODE> will be added
826
     */
827
    public void insertTable(Table aTable, int row, int column) {
828 1 1. insertTable : negated conditional → NO_COVERAGE
        if (aTable == null) throw new NullPointerException(MessageLocalization.getComposedMessage("inserttable.table.has.null.value"));
829 1 1. insertTable : removed call to com/lowagie/text/Table::insertTable → NO_COVERAGE
        insertTable(aTable, new Point(row, column));
830
    }
831
    
832
    /**
833
     * To put a table within the existing table at the given position
834
     * generateTable will of course re-arrange the widths of the columns.
835
     *
836
     * @param   aTable      the table you want to insert
837
     * @param   aLocation   a <CODE>Point</CODE>
838
     */
839
    public void insertTable(Table aTable, Point aLocation) {
840
        
841 1 1. insertTable : negated conditional → NO_COVERAGE
        if (aTable == null) throw new NullPointerException(MessageLocalization.getComposedMessage("inserttable.table.has.null.value"));
842 1 1. insertTable : negated conditional → NO_COVERAGE
        if (aLocation == null) throw new NullPointerException(MessageLocalization.getComposedMessage("inserttable.point.has.null.value"));
843
        mTableInserted = true;
844 1 1. insertTable : removed call to com/lowagie/text/Table::complete → NO_COVERAGE
        aTable.complete();
845
        
846 2 1. insertTable : changed conditional boundary → NO_COVERAGE
2. insertTable : negated conditional → NO_COVERAGE
        if (aLocation.y > columns) {
847
            throw new IllegalArgumentException(MessageLocalization.getComposedMessage("inserttable.wrong.columnposition.1.of.location.max.eq.2", String.valueOf(aLocation.y), String.valueOf(columns)));
848
        }
849
        
850 2 1. insertTable : Replaced integer addition with subtraction → NO_COVERAGE
2. insertTable : Replaced integer subtraction with addition → NO_COVERAGE
        int rowCount = aLocation.x + 1 - rows.size();
851
        int i = 0;
852 2 1. insertTable : changed conditional boundary → NO_COVERAGE
2. insertTable : negated conditional → NO_COVERAGE
        if ( rowCount > 0 ) {   //create new rows ?
853 3 1. insertTable : changed conditional boundary → NO_COVERAGE
2. insertTable : Changed increment from 1 to -1 → NO_COVERAGE
3. insertTable : negated conditional → NO_COVERAGE
            for (; i < rowCount; i++) {
854
                rows.add(new Row(columns));
855
            }
856
        }
857
        
858 1 1. insertTable : removed call to com/lowagie/text/Row::setElement → NO_COVERAGE
        ((Row) rows.get(aLocation.x)).setElement(aTable,aLocation.y);
859
        
860 1 1. insertTable : removed call to com/lowagie/text/Table::setCurrentLocationToNextValidPosition → NO_COVERAGE
        setCurrentLocationToNextValidPosition(aLocation);
861
    }
862
    
863
    /**
864
     * Gives you the possibility to add columns.
865
     *
866
     * @param   aColumns    the number of columns to add
867
     */
868
    public void addColumns(int aColumns) {
869
        ArrayList newRows = new ArrayList(rows.size());
870
        
871 1 1. addColumns : Replaced integer addition with subtraction → NO_COVERAGE
        int newColumns = columns + aColumns;
872
        Row row;
873 3 1. addColumns : changed conditional boundary → NO_COVERAGE
2. addColumns : Changed increment from 1 to -1 → NO_COVERAGE
3. addColumns : negated conditional → NO_COVERAGE
        for (int i = 0; i < rows.size(); i++) {
874
            row = new Row(newColumns);
875 3 1. addColumns : changed conditional boundary → NO_COVERAGE
2. addColumns : Changed increment from 1 to -1 → NO_COVERAGE
3. addColumns : negated conditional → NO_COVERAGE
            for (int j = 0; j < columns; j++) {
876 1 1. addColumns : removed call to com/lowagie/text/Row::setElement → NO_COVERAGE
                row.setElement(((Row) rows.get(i)).getCell(j) ,j);
877
            }
878 5 1. addColumns : changed conditional boundary → NO_COVERAGE
2. addColumns : changed conditional boundary → NO_COVERAGE
3. addColumns : Changed increment from 1 to -1 → NO_COVERAGE
4. addColumns : negated conditional → NO_COVERAGE
5. addColumns : negated conditional → NO_COVERAGE
            for (int j = columns; j < newColumns && i < curPosition.x; j++) {
879 1 1. addColumns : removed call to com/lowagie/text/Row::setElement → NO_COVERAGE
                row.setElement(null, j);
880
            }
881
            newRows.add(row);
882
        }
883
        // applied 1 column-fix; last column needs to have a width of 0
884
        float [] newWidths = new float[newColumns];
885 1 1. addColumns : removed call to java/lang/System::arraycopy → NO_COVERAGE
        System.arraycopy(widths, 0, newWidths, 0, columns);
886 3 1. addColumns : changed conditional boundary → NO_COVERAGE
2. addColumns : Changed increment from 1 to -1 → NO_COVERAGE
3. addColumns : negated conditional → NO_COVERAGE
        for (int j = columns; j < newColumns ; j++) {
887
            newWidths[j] = 0;
888
        }
889
        columns = newColumns;
890
        widths = newWidths;
891
        rows = newRows;
892
    }
893
    
894
    /**
895
     * Deletes a column in this table.
896
     *
897
     * @param       column  the number of the column that has to be deleted
898
     * @throws BadElementException
899
     */
900
    public void deleteColumn(int column) throws BadElementException {
901 1 1. deleteColumn : Replaced integer subtraction with addition → NO_COVERAGE
        float[] newWidths = new float[--columns];
902 1 1. deleteColumn : removed call to java/lang/System::arraycopy → NO_COVERAGE
        System.arraycopy(widths, 0, newWidths, 0, column);
903 3 1. deleteColumn : Replaced integer addition with subtraction → NO_COVERAGE
2. deleteColumn : Replaced integer subtraction with addition → NO_COVERAGE
3. deleteColumn : removed call to java/lang/System::arraycopy → NO_COVERAGE
        System.arraycopy(widths, column + 1, newWidths, column, columns - column);
904 1 1. deleteColumn : removed call to com/lowagie/text/Table::setWidths → NO_COVERAGE
        setWidths(newWidths);
905 1 1. deleteColumn : removed call to java/lang/System::arraycopy → NO_COVERAGE
        System.arraycopy(widths, 0, newWidths, 0, columns);
906
        widths = newWidths;
907
        Row row;
908
        int size = rows.size();
909 3 1. deleteColumn : changed conditional boundary → NO_COVERAGE
2. deleteColumn : Changed increment from 1 to -1 → NO_COVERAGE
3. deleteColumn : negated conditional → NO_COVERAGE
        for (int i = 0; i < size; i++) {
910
            row = (Row) rows.get(i);
911 1 1. deleteColumn : removed call to com/lowagie/text/Row::deleteColumn → NO_COVERAGE
            row.deleteColumn(column);
912
            rows.set(i, row);
913
        }
914 1 1. deleteColumn : negated conditional → NO_COVERAGE
        if (column == columns) {
915 2 1. deleteColumn : Replaced integer addition with subtraction → NO_COVERAGE
2. deleteColumn : removed call to java/awt/Point::setLocation → NO_COVERAGE
            curPosition.setLocation(curPosition.x+1, 0);
916
        }
917
    }
918
919
    /**
920
     * Deletes a row.
921
     *
922
     * @param       row             the number of the row to delete
923
     * @return      boolean <CODE>true</CODE> if the row was deleted; <CODE>false</CODE> if not
924
     */
925
    public boolean deleteRow(int row) {
926 4 1. deleteRow : changed conditional boundary → NO_COVERAGE
2. deleteRow : changed conditional boundary → NO_COVERAGE
3. deleteRow : negated conditional → NO_COVERAGE
4. deleteRow : negated conditional → NO_COVERAGE
        if (row < 0 || row >= rows.size()) {
927 1 1. deleteRow : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return false;
928
        }
929
        rows.remove(row);
930 2 1. deleteRow : Replaced integer subtraction with addition → NO_COVERAGE
2. deleteRow : removed call to java/awt/Point::setLocation → NO_COVERAGE
        curPosition.setLocation(curPosition.x-1, curPosition.y);
931 1 1. deleteRow : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return true;
932
    }
933
    
934
    /**
935
     * Deletes all rows in this table.
936
     * (contributed by dperezcar@fcc.es)
937
     */
938
    public void deleteAllRows() {
939 1 1. deleteAllRows : removed call to java/util/ArrayList::clear → NO_COVERAGE
        rows.clear();
940
        rows.add(new Row(columns));
941 1 1. deleteAllRows : removed call to java/awt/Point::setLocation → NO_COVERAGE
        curPosition.setLocation(0, 0);
942
        lastHeaderRow = -1;
943
    }
944
    
945
    /**
946
     * Deletes the last row in this table.
947
     *
948
     * @return      boolean <CODE>true</CODE> if the row was deleted; <CODE>false</CODE> if not
949
     */
950
    public boolean deleteLastRow() {
951 2 1. deleteLastRow : Replaced integer subtraction with addition → NO_COVERAGE
2. deleteLastRow : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return deleteRow(rows.size() - 1);
952
    }
953
    
954
    /**
955
     * Will fill empty cells with valid blank <CODE>Cell</CODE>s
956
     */
957
    public void complete() {
958 1 1. complete : negated conditional → NO_COVERAGE
        if (mTableInserted) {
959 1 1. complete : removed call to com/lowagie/text/Table::mergeInsertedTables → NO_COVERAGE
            mergeInsertedTables();  // integrate tables in the table
960
            mTableInserted = false;
961
        }
962 1 1. complete : negated conditional → NO_COVERAGE
        if (autoFillEmptyCells) {
963 1 1. complete : removed call to com/lowagie/text/Table::fillEmptyMatrixCells → NO_COVERAGE
            fillEmptyMatrixCells();
964
        }
965
    }
966
    
967
    // private helper classes
968
    
969
    /**
970
     * returns the element at the position row, column
971
     *          (Cast to Cell or Table)
972
     * 
973
     * @param row
974
     * @param column
975
     * @return  dimension
976
     * @since  2.1.0 (was made private in 2.0.3)
977
     */
978
    public Object getElement(int row, int column) {
979 1 1. getElement : mutated return of Object value for com/lowagie/text/Table::getElement to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return ((Row) rows.get(row)).getCell(column);
980
    }
981
    
982
    /**
983
     * Integrates all added tables and recalculates column widths.
984
     */
985
    private void mergeInsertedTables() {
986
        int i=0, j=0;
987
        float [] lNewWidths = null;
988
        int [] lDummyWidths = new int[columns];     // to keep track in how many new cols this one will be split
989
        float[][] lDummyColumnWidths = new float[columns][]; // bugfix Tony Copping
990
        int [] lDummyHeights = new int[rows.size()]; // to keep track in how many new rows this one will be split
991
        ArrayList newRows = null;
992
        boolean isTable=false;
993
        int lTotalRows  = 0, lTotalColumns      = 0;
994
        int lNewMaxRows = 0, lNewMaxColumns     = 0;
995
        
996
        Table lDummyTable = null;
997
        
998
        // first we'll add new columns when needed
999
        // check one column at a time, find maximum needed nr of cols
1000
        // Search internal tables and find one with max columns
1001 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
        for (j=0; j < columns; j++) {
1002
            lNewMaxColumns = 1; // value to hold in how many columns the current one will be split
1003
            float [] tmpWidths = null;
1004 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
            for (i=0; i < rows.size(); i++) {
1005 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                if (((Row) rows.get(i)).getCell(j) instanceof Table) {
1006
                    isTable=true;
1007
                    lDummyTable = ((Table) ((Row) rows.get(i)).getCell(j));
1008 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                    if( tmpWidths == null) {
1009
                        tmpWidths = lDummyTable.widths;
1010
                        lNewMaxColumns=tmpWidths.length;
1011
                    }
1012
                    else {
1013
                        int cols = lDummyTable.getDimension().width;
1014 1 1. mergeInsertedTables : Replaced integer multiplication with division → NO_COVERAGE
                        float [] tmpWidthsN = new float[ cols * tmpWidths.length];
1015
                        float tpW=0, btW=0, totW=0;
1016
                        int tpI=0, btI=0, totI=0;
1017 1 1. mergeInsertedTables : Replaced float addition with subtraction → NO_COVERAGE
                        tpW+=tmpWidths[0];
1018 1 1. mergeInsertedTables : Replaced float addition with subtraction → NO_COVERAGE
                        btW+=lDummyTable.widths[0];
1019 4 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
4. mergeInsertedTables : negated conditional → NO_COVERAGE
                        while( tpI<tmpWidths.length && btI<cols) {
1020 2 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : negated conditional → NO_COVERAGE
                            if( btW>tpW) {
1021 1 1. mergeInsertedTables : Replaced float subtraction with addition → NO_COVERAGE
                                tmpWidthsN[totI] = tpW-totW;
1022 1 1. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
                                tpI++;
1023 2 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : negated conditional → NO_COVERAGE
                                if(tpI<tmpWidths.length) {
1024 1 1. mergeInsertedTables : Replaced float addition with subtraction → NO_COVERAGE
                                    tpW+=tmpWidths[tpI];
1025
                                }
1026
                            }
1027
                            else {
1028 1 1. mergeInsertedTables : Replaced float subtraction with addition → NO_COVERAGE
                                tmpWidthsN[totI] = btW-totW;
1029 1 1. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
                                btI++;
1030 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Replaced float subtraction with addition → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
                                if(Math.abs(btW - tpW) < 0.0001) {
1031 1 1. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
                                    tpI++;
1032 2 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : negated conditional → NO_COVERAGE
                                    if(tpI<tmpWidths.length) {
1033 1 1. mergeInsertedTables : Replaced float addition with subtraction → NO_COVERAGE
                                        tpW+=tmpWidths[tpI];
1034
                                    }
1035
                                }
1036 2 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : negated conditional → NO_COVERAGE
                                if(btI<cols) {
1037 1 1. mergeInsertedTables : Replaced float addition with subtraction → NO_COVERAGE
                                    btW+=lDummyTable.widths[btI];
1038
                                }
1039
                            }
1040 1 1. mergeInsertedTables : Replaced float addition with subtraction → NO_COVERAGE
                            totW+=tmpWidthsN[totI];
1041 1 1. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
                            totI++;
1042
                        }
1043
                       /*if( tpI<tmpWidths.length)
1044
                       {
1045
                           System.arraycopy(tmpWidths, tpI, tmpWidthsN, totI, tmpWidths.length-tpI);
1046
                           totI +=tmpWidths.length-tpI;
1047
                       }
1048
                       else if(btI<cols)
1049
                       {
1050
                           System.arraycopy(lDummyTable.widths, btI, tmpWidthsN, totI, lDummyTable.widths.length-btI);
1051
                           totI +=lDummyTable.widths.length-btI;                                                  }*/
1052
                        tmpWidths = new float[totI];
1053 1 1. mergeInsertedTables : removed call to java/lang/System::arraycopy → NO_COVERAGE
                        System.arraycopy(tmpWidthsN, 0, tmpWidths, 0, totI);
1054
                        lNewMaxColumns=totI;
1055
                    }
1056
                                     /*if ( lDummyTable.getDimension().width > lNewMaxColumns )
1057
                   {
1058
                       lNewMaxColumns = lDummyTable.getDimension().width;
1059
                       lDummyColumnWidths[j] = lDummyTable.widths; // bugfix Tony Copping
1060
                   }*/
1061
                }
1062
            }
1063
            lDummyColumnWidths[j] = tmpWidths;
1064 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
            lTotalColumns += lNewMaxColumns;
1065
            lDummyWidths [j] = lNewMaxColumns;
1066
        }
1067
        
1068
        // next we'll add new rows when needed
1069 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
        for (i=0; i < rows.size(); i++) {
1070
            lNewMaxRows = 1;    // holds value in how many rows the current one will be split
1071 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
            for (j=0; j < columns; j++) {
1072 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                if (((Row) rows.get(i)).getCell(j) instanceof Table) {
1073
                    isTable=true;
1074
                    lDummyTable = (Table) ((Row) rows.get(i)).getCell(j);
1075 2 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : negated conditional → NO_COVERAGE
                    if ( lDummyTable.getDimension().height > lNewMaxRows ) {
1076
                        lNewMaxRows = lDummyTable.getDimension().height;
1077
                    }
1078
                }
1079
            }
1080 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
            lTotalRows += lNewMaxRows;
1081
            lDummyHeights [i] = lNewMaxRows;
1082
        }
1083
        
1084 3 1. mergeInsertedTables : negated conditional → NO_COVERAGE
2. mergeInsertedTables : negated conditional → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
        if ( (lTotalColumns != columns) || (lTotalRows != rows.size()) || isTable)    // NO ADJUSTMENT
1085
        {
1086
            // ** WIDTH
1087
            // set correct width for new columns
1088
            // divide width over new nr of columns
1089
            // Take new max columns of internal table and work out widths for each col
1090
            lNewWidths = new float [lTotalColumns];
1091
            int lDummy = 0;
1092 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
            for (int tel=0; tel < widths.length;tel++) {
1093 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                if ( lDummyWidths[tel] != 1) {
1094
                    // divide
1095 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
                    for (int tel2 = 0; tel2 < lDummyWidths[tel]; tel2++) {
1096
                        // lNewWidths[lDummy] = widths[tel] / lDummyWidths[tel];
1097 2 1. mergeInsertedTables : Replaced float multiplication with division → NO_COVERAGE
2. mergeInsertedTables : Replaced float division with multiplication → NO_COVERAGE
                        lNewWidths[lDummy] = widths[tel] * lDummyColumnWidths[tel][tel2] / 100f; // bugfix Tony Copping
1098 1 1. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
                        lDummy++;
1099
                    }
1100
                }
1101
                else {
1102
                    lNewWidths[lDummy] = widths[tel];
1103 1 1. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
                    lDummy++;
1104
                }
1105
            }
1106
            
1107
            // ** FILL OUR NEW TABLE
1108
            // generate new table
1109
            // set new widths
1110
            // copy old values
1111
            newRows = new ArrayList(lTotalRows);
1112 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
            for (i = 0; i < lTotalRows; i++) {
1113
                newRows.add(new Row(lTotalColumns));
1114
            }
1115
            int lDummyRow = 0, lDummyColumn = 0;        // to remember where we are in the new, larger table
1116
            Object lDummyElement = null;
1117 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
            for (i=0; i < rows.size(); i++) {
1118
                lDummyColumn = 0;
1119
                lNewMaxRows = 1;
1120 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
                for (j=0; j < columns; j++) {
1121 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                    if (((Row) rows.get(i)).getCell(j) instanceof Table)       // copy values from embedded table
1122
                    {
1123
                        lDummyTable = (Table) ((Row) rows.get(i)).getCell(j);
1124
                        
1125
                        // Work out where columns in table table correspond to columns in current table
1126 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                        int[] colMap = new int[lDummyTable.widths.length + 1];
1127
                        int cb=0, ct=0;
1128
                        
1129 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
                        for( ; cb<lDummyTable.widths.length;cb++) {
1130 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                            colMap[cb] = lDummyColumn+ct;
1131
                            
1132
                            float wb;
1133
                            wb = lDummyTable.widths[cb];
1134
                            
1135
                            float wt=0;
1136 2 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : negated conditional → NO_COVERAGE
                            while( ct<lDummyWidths[j]) {
1137 2 1. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
2. mergeInsertedTables : Replaced float addition with subtraction → NO_COVERAGE
                                wt+=lDummyColumnWidths[j][ct++];
1138 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Replaced float subtraction with addition → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
                                if(Math.abs(wb - wt) < 0.0001) break;
1139
                            }
1140
                        }
1141 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                        colMap[cb] = lDummyColumn+ct;
1142
                        
1143
                        // need to change this to work out how many cols to span
1144 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
                        for (int k=0; k < lDummyTable.getDimension().height; k++) {
1145 3 1. mergeInsertedTables : changed conditional boundary → NO_COVERAGE
2. mergeInsertedTables : Changed increment from 1 to -1 → NO_COVERAGE
3. mergeInsertedTables : negated conditional → NO_COVERAGE
                            for (int l=0; l < lDummyTable.getDimension().width; l++) {
1146
                                lDummyElement = lDummyTable.getElement(k,l);
1147 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                                if (lDummyElement != null) {
1148 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                                    int col=lDummyColumn+l;
1149
                                    
1150 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                                    if (lDummyElement instanceof Cell) {
1151
                                        Cell lDummyC = (Cell)lDummyElement;
1152
                                        // Find col to add cell in and set col span
1153
                                        col = colMap[l];
1154 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                                        int ot = colMap[l+lDummyC.getColspan()];
1155
                                        
1156 2 1. mergeInsertedTables : Replaced integer subtraction with addition → NO_COVERAGE
2. mergeInsertedTables : removed call to com/lowagie/text/Cell::setColspan → NO_COVERAGE
                                        lDummyC.setColspan(ot-col);
1157
                                    }
1158
                                    
1159 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                                    ((Row) newRows.get(k + lDummyRow)).addElement(lDummyElement,col);  // use addElement to set reserved status ok in row
1160
                                }
1161
                            }
1162
                        }
1163
                    }
1164
                    else        // copy others values
1165
                    {
1166
                        Object aElement = getElement(i,j);
1167
                        
1168 1 1. mergeInsertedTables : negated conditional → NO_COVERAGE
                        if (aElement instanceof Cell) {
1169
                            
1170
                            // adjust spans for cell
1171 3 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
2. mergeInsertedTables : Replaced integer subtraction with addition → NO_COVERAGE
3. mergeInsertedTables : removed call to com/lowagie/text/Cell::setRowspan → NO_COVERAGE
                            ((Cell) aElement).setRowspan(((Cell) ((Row) rows.get(i)).getCell(j)).getRowspan() + lDummyHeights[i] - 1);
1172 3 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
2. mergeInsertedTables : Replaced integer subtraction with addition → NO_COVERAGE
3. mergeInsertedTables : removed call to com/lowagie/text/Cell::setColspan → NO_COVERAGE
                            ((Cell) aElement).setColspan(((Cell) ((Row) rows.get(i)).getCell(j)).getColspan() + lDummyWidths[j] - 1);
1173
                            
1174
                            // most likely this cell covers a larger area because of the row/cols splits : define not-to-be-filled cells
1175 1 1. mergeInsertedTables : removed call to com/lowagie/text/Table::placeCell → NO_COVERAGE
                            placeCell(newRows,((Cell) aElement), new Point(lDummyRow,lDummyColumn));
1176
                        }
1177
                    }
1178 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                    lDummyColumn += lDummyWidths[j];
1179
                }
1180 1 1. mergeInsertedTables : Replaced integer addition with subtraction → NO_COVERAGE
                lDummyRow += lDummyHeights[i];
1181
            }
1182
            
1183
            // Set our new matrix
1184
            columns     = lTotalColumns;
1185
            rows = newRows;
1186
            this.widths = lNewWidths;
1187
        }
1188
    }
1189
    
1190
    /**
1191
     * adds new<CODE>Cell</CODE>'s to empty/null spaces.
1192
     */
1193
    private void fillEmptyMatrixCells() {
1194
        try {
1195 3 1. fillEmptyMatrixCells : changed conditional boundary → NO_COVERAGE
2. fillEmptyMatrixCells : Changed increment from 1 to -1 → NO_COVERAGE
3. fillEmptyMatrixCells : negated conditional → NO_COVERAGE
            for (int i=0; i < rows.size(); i++) {
1196 3 1. fillEmptyMatrixCells : changed conditional boundary → NO_COVERAGE
2. fillEmptyMatrixCells : Changed increment from 1 to -1 → NO_COVERAGE
3. fillEmptyMatrixCells : negated conditional → NO_COVERAGE
                for (int j=0; j < columns; j++) {
1197 1 1. fillEmptyMatrixCells : negated conditional → NO_COVERAGE
                    if (!((Row) rows.get(i)).isReserved(j)) {
1198 1 1. fillEmptyMatrixCells : removed call to com/lowagie/text/Table::addCell → NO_COVERAGE
                        addCell(defaultCell, new Point(i, j));
1199
                    }
1200
                }
1201
            }
1202
        }
1203
        catch(BadElementException bee) {
1204
            throw new ExceptionConverter(bee);
1205
        }
1206
    }
1207
    
1208
    /**
1209
     * check if <CODE>Cell</CODE> 'fits' the table.
1210
     * <P>
1211
     * <UL><LI>rowspan/colspan not beyond borders
1212
     *     <LI>spanned cell don't overlap existing cells</UL>
1213
     *
1214
     * @param   aCell       the cell that has to be checked
1215
     * @param   aLocation   the location where the cell has to be placed
1216
     * @return true if the location was valid
1217
     */
1218
    private boolean isValidLocation(Cell aCell, Point aLocation) {
1219
        // rowspan not beyond last column
1220 2 1. isValidLocation : changed conditional boundary → SURVIVED
2. isValidLocation : negated conditional → SURVIVED
        if ( aLocation.x < rows.size() )        // if false : new location is already at new, not-yet-created area so no check
1221
        {
1222 3 1. isValidLocation : changed conditional boundary → SURVIVED
2. isValidLocation : Replaced integer addition with subtraction → SURVIVED
3. isValidLocation : negated conditional → SURVIVED
            if ((aLocation.y + aCell.getColspan()) > columns) {
1223 1 1. isValidLocation : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return false;
1224
            }
1225
            
1226 4 1. isValidLocation : changed conditional boundary → SURVIVED
2. isValidLocation : Replaced integer subtraction with addition → SURVIVED
3. isValidLocation : Replaced integer subtraction with addition → SURVIVED
4. isValidLocation : negated conditional → SURVIVED
            int difx = ((rows.size() - aLocation.x) >  aCell.getRowspan()) ? aCell.getRowspan() : rows.size() - aLocation.x;
1227 4 1. isValidLocation : changed conditional boundary → SURVIVED
2. isValidLocation : Replaced integer subtraction with addition → SURVIVED
3. isValidLocation : Replaced integer subtraction with addition → SURVIVED
4. isValidLocation : negated conditional → SURVIVED
            int dify = ((columns - aLocation.y) >  aCell.getColspan()) ? aCell.getColspan() : columns - aLocation.y;
1228
            // no other content at cells targeted by rowspan/colspan
1229 4 1. isValidLocation : Replaced integer addition with subtraction → SURVIVED
2. isValidLocation : negated conditional → SURVIVED
3. isValidLocation : changed conditional boundary → KILLED
4. isValidLocation : Changed increment from 1 to -1 → KILLED
            for (int i=aLocation.x; i < (aLocation.x + difx); i++) {
1230 4 1. isValidLocation : Replaced integer addition with subtraction → SURVIVED
2. isValidLocation : negated conditional → SURVIVED
3. isValidLocation : changed conditional boundary → KILLED
4. isValidLocation : Changed increment from 1 to -1 → KILLED
                for (int j=aLocation.y; j < (aLocation.y + dify); j++) {
1231 1 1. isValidLocation : negated conditional → SURVIVED
                    if (((Row) rows.get(i)).isReserved(j)) {
1232 1 1. isValidLocation : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                        return false;
1233
                    }
1234
                }
1235
            }
1236
        }
1237
        else {
1238 4 1. isValidLocation : changed conditional boundary → NO_COVERAGE
2. isValidLocation : Replaced integer addition with subtraction → NO_COVERAGE
3. isValidLocation : negated conditional → NO_COVERAGE
4. isValidLocation : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return (aLocation.y + aCell.getColspan()) <= columns;
1239
        }
1240
        
1241 1 1. isValidLocation : replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED
        return true;
1242
    }
1243
    
1244
    /**
1245
     * Sets the unset cell properties to be the table defaults.
1246
     *
1247
     * @param aCell The cell to set to table defaults as necessary.
1248
     */
1249
    private void assumeTableDefaults(Cell aCell) {
1250
        
1251 1 1. assumeTableDefaults : negated conditional → SURVIVED
        if (aCell.getBorder() == Rectangle.UNDEFINED) {
1252 1 1. assumeTableDefaults : removed call to com/lowagie/text/Cell::setBorder → NO_COVERAGE
            aCell.setBorder(defaultCell.getBorder());
1253
        }
1254 1 1. assumeTableDefaults : negated conditional → SURVIVED
        if (aCell.getBorderWidth() == Rectangle.UNDEFINED) {
1255 1 1. assumeTableDefaults : removed call to com/lowagie/text/Cell::setBorderWidth → NO_COVERAGE
            aCell.setBorderWidth(defaultCell.getBorderWidth());
1256
        }
1257 1 1. assumeTableDefaults : negated conditional → SURVIVED
        if (aCell.getBorderColor() == null) {
1258 1 1. assumeTableDefaults : removed call to com/lowagie/text/Cell::setBorderColor → SURVIVED
            aCell.setBorderColor(defaultCell.getBorderColor());
1259
        }
1260 1 1. assumeTableDefaults : negated conditional → SURVIVED
        if (aCell.getBackgroundColor() == null) {
1261 1 1. assumeTableDefaults : removed call to com/lowagie/text/Cell::setBackgroundColor → SURVIVED
            aCell.setBackgroundColor(defaultCell.getBackgroundColor());
1262
        }
1263 1 1. assumeTableDefaults : negated conditional → SURVIVED
        if (aCell.getHorizontalAlignment() == Element.ALIGN_UNDEFINED) {
1264 1 1. assumeTableDefaults : removed call to com/lowagie/text/Cell::setHorizontalAlignment → SURVIVED
            aCell.setHorizontalAlignment(defaultCell.getHorizontalAlignment());
1265
        }
1266 1 1. assumeTableDefaults : negated conditional → SURVIVED
        if (aCell.getVerticalAlignment() == Element.ALIGN_UNDEFINED) {
1267 1 1. assumeTableDefaults : removed call to com/lowagie/text/Cell::setVerticalAlignment → SURVIVED
            aCell.setVerticalAlignment(defaultCell.getVerticalAlignment());
1268
        }
1269
    }
1270
    
1271
    /**
1272
     * Inserts a Cell in a cell-array and reserves cells defined by row-/colspan.
1273
     *
1274
     * @param   someRows    some rows
1275
     * @param   aCell       the cell that has to be inserted
1276
     * @param   aPosition   the position where the cell has to be placed
1277
     */
1278
    private void placeCell(ArrayList someRows, Cell aCell, Point aPosition) {
1279
        int i;
1280
        Row row = null;
1281 2 1. placeCell : Replaced integer addition with subtraction → SURVIVED
2. placeCell : Replaced integer subtraction with addition → SURVIVED
        int rowCount = aPosition.x + aCell.getRowspan() - someRows.size();
1282 1 1. placeCell : removed call to com/lowagie/text/Table::assumeTableDefaults → SURVIVED
        assumeTableDefaults(aCell);
1283 3 1. placeCell : changed conditional boundary → SURVIVED
2. placeCell : Replaced integer addition with subtraction → SURVIVED
3. placeCell : negated conditional → SURVIVED
        if ( (aPosition.x + aCell.getRowspan()) > someRows.size() ) {
1284 3 1. placeCell : changed conditional boundary → NO_COVERAGE
2. placeCell : Changed increment from 1 to -1 → NO_COVERAGE
3. placeCell : negated conditional → NO_COVERAGE
            for (i = 0; i < rowCount; i++) {
1285
                row = new Row(columns);
1286
                someRows.add(row);
1287
            }
1288
        }
1289
        
1290
        // reserve cell in rows below
1291 5 1. placeCell : Changed increment from 1 to -1 → SURVIVED
2. placeCell : Replaced integer addition with subtraction → SURVIVED
3. placeCell : changed conditional boundary → KILLED
4. placeCell : Replaced integer addition with subtraction → KILLED
5. placeCell : negated conditional → KILLED
        for (i = aPosition.x + 1; i < (aPosition.x  + aCell.getRowspan()); i++) {
1292 1 1. placeCell : negated conditional → NO_COVERAGE
            if ( !((Row) someRows.get(i)).reserve(aPosition.y, aCell.getColspan())) {
1293
                
1294
                // should be impossible to come here :-)
1295
                throw new RuntimeException(MessageLocalization.getComposedMessage("addcell.error.in.reserve"));
1296
            }
1297
        }
1298
        row = (Row) someRows.get(aPosition.x);
1299
        row.addElement(aCell, aPosition.y);
1300
        
1301
    }
1302
    
1303
    /**
1304
     *  Sets current col/row to valid(empty) pos after addCell/Table
1305
     * @param aLocation a location in the Table
1306
     */
1307
    private void setCurrentLocationToNextValidPosition(Point aLocation)    {
1308
        // set latest location to next valid position
1309
        int i, j;
1310
        i = aLocation.x;
1311
        j = aLocation.y;
1312
        do {
1313 2 1. setCurrentLocationToNextValidPosition : Replaced integer addition with subtraction → SURVIVED
2. setCurrentLocationToNextValidPosition : negated conditional → SURVIVED
            if ( (j + 1)  == columns ) {    // goto next row
1314 1 1. setCurrentLocationToNextValidPosition : Changed increment from 1 to -1 → KILLED
                i++;
1315
                j = 0;
1316
            }
1317
            else {
1318 1 1. setCurrentLocationToNextValidPosition : Changed increment from 1 to -1 → NO_COVERAGE
                j++;
1319
            }
1320
        }
1321
        while (
1322 5 1. setCurrentLocationToNextValidPosition : changed conditional boundary → SURVIVED
2. setCurrentLocationToNextValidPosition : negated conditional → SURVIVED
3. setCurrentLocationToNextValidPosition : negated conditional → SURVIVED
4. setCurrentLocationToNextValidPosition : changed conditional boundary → KILLED
5. setCurrentLocationToNextValidPosition : negated conditional → KILLED
        (i < rows.size()) && (j < columns) && (((Row) rows.get(i)).isReserved(j))
1323
        );
1324
        curPosition = new Point(i, j);
1325
    }
1326
    
1327
    // public helper methods
1328
    
1329
    /**
1330
     * Gets an array with the positions of the borders between every column.
1331
     * <P>
1332
     * This method translates the widths expressed in percentages into the
1333
     * x-coordinate of the borders of the columns on a real document.
1334
     *
1335
     * @param       left            this is the position of the first border at the left (cellpadding not included)
1336
     * @param       totalWidth      this is the space between the first border at the left
1337
     *                                              and the last border at the right (cellpadding not included)
1338
     * @return      an array with border positions
1339
     */
1340
    public float[] getWidths(float left, float totalWidth) {
1341
        // for x columns, there are x+1 borders
1342 1 1. getWidths : Replaced integer addition with subtraction → NO_COVERAGE
        float[] w = new float[columns + 1];
1343
        float wPercentage;
1344 1 1. getWidths : negated conditional → NO_COVERAGE
        if (locked) {
1345 2 1. getWidths : Replaced float multiplication with division → NO_COVERAGE
2. getWidths : Replaced float division with multiplication → NO_COVERAGE
            wPercentage = 100 * width / totalWidth;
1346
        }
1347
        else {
1348
            wPercentage = width;
1349
        }
1350
        // the border at the left is calculated
1351
        switch(alignment) {
1352
            case Element.ALIGN_LEFT:
1353
                w[0] = left;
1354
                break;
1355
            case Element.ALIGN_RIGHT:
1356 4 1. getWidths : Replaced float subtraction with addition → NO_COVERAGE
2. getWidths : Replaced float multiplication with division → NO_COVERAGE
3. getWidths : Replaced float division with multiplication → NO_COVERAGE
4. getWidths : Replaced float addition with subtraction → NO_COVERAGE
                w[0] = left + (totalWidth * (100 - wPercentage)) / 100;
1357
                break;
1358
            case Element.ALIGN_CENTER:
1359
            default:
1360 4 1. getWidths : Replaced float subtraction with addition → NO_COVERAGE
2. getWidths : Replaced float multiplication with division → NO_COVERAGE
3. getWidths : Replaced float division with multiplication → NO_COVERAGE
4. getWidths : Replaced float addition with subtraction → NO_COVERAGE
                w[0] = left + (totalWidth * (100 - wPercentage)) / 200;
1361
        }
1362
        // the total available width is changed
1363 2 1. getWidths : Replaced float multiplication with division → NO_COVERAGE
2. getWidths : Replaced float division with multiplication → NO_COVERAGE
        totalWidth = (totalWidth * wPercentage) / 100;
1364
        // the inner borders are calculated
1365 3 1. getWidths : changed conditional boundary → NO_COVERAGE
2. getWidths : Changed increment from 1 to -1 → NO_COVERAGE
3. getWidths : negated conditional → NO_COVERAGE
        for (int i = 1; i < columns; i++) {
1366 5 1. getWidths : Replaced integer subtraction with addition → NO_COVERAGE
2. getWidths : Replaced integer subtraction with addition → NO_COVERAGE
3. getWidths : Replaced float multiplication with division → NO_COVERAGE
4. getWidths : Replaced float division with multiplication → NO_COVERAGE
5. getWidths : Replaced float addition with subtraction → NO_COVERAGE
            w[i] = w[i - 1] + (widths[i - 1] * totalWidth / 100);
1367
        }
1368
        // the border at the right is calculated
1369 1 1. getWidths : Replaced float addition with subtraction → NO_COVERAGE
        w[columns] = w[0] + totalWidth;
1370 1 1. getWidths : mutated return of Object value for com/lowagie/text/Table::getWidths to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return w;
1371
    }
1372
    
1373
    /**
1374
     * Gets an <CODE>Iterator</CODE> of all the <CODE>Row</CODE>s.
1375
     *
1376
     * @return      an <CODE>Iterator</CODE>
1377
     */
1378
    public Iterator iterator() {
1379
        return rows.iterator();
1380
    }
1381
1382
    /**
1383
     * Create a PdfPTable based on this Table object.
1384
     * @return a PdfPTable object
1385
     * @throws BadElementException
1386
     */
1387
    public PdfPTable createPdfPTable() throws BadElementException {
1388 1 1. createPdfPTable : negated conditional → NO_COVERAGE
        if (!convert2pdfptable) {
1389
            throw new BadElementException(MessageLocalization.getComposedMessage("no.error.just.an.old.style.table"));
1390
        }
1391 1 1. createPdfPTable : removed call to com/lowagie/text/Table::setAutoFillEmptyCells → NO_COVERAGE
        setAutoFillEmptyCells(true);
1392 1 1. createPdfPTable : removed call to com/lowagie/text/Table::complete → NO_COVERAGE
        complete();
1393
        PdfPTable pdfptable = new PdfPTable(widths);
1394 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setComplete → NO_COVERAGE
        pdfptable.setComplete(complete);
1395 1 1. createPdfPTable : negated conditional → NO_COVERAGE
        if (isNotAddedYet())
1396 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setSkipFirstHeader → NO_COVERAGE
            pdfptable.setSkipFirstHeader(true);
1397
        SimpleTable t_evt = new SimpleTable();
1398 1 1. createPdfPTable : removed call to com/lowagie/text/SimpleTable::cloneNonPositionParameters → NO_COVERAGE
        t_evt.cloneNonPositionParameters(this);
1399 1 1. createPdfPTable : removed call to com/lowagie/text/SimpleTable::setCellspacing → NO_COVERAGE
        t_evt.setCellspacing(cellspacing);
1400 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setTableEvent → NO_COVERAGE
        pdfptable.setTableEvent(t_evt);
1401 2 1. createPdfPTable : Replaced integer addition with subtraction → NO_COVERAGE
2. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setHeaderRows → NO_COVERAGE
        pdfptable.setHeaderRows(lastHeaderRow + 1);
1402 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setSplitLate → NO_COVERAGE
        pdfptable.setSplitLate(cellsFitPage);
1403 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setKeepTogether → NO_COVERAGE
        pdfptable.setKeepTogether(tableFitsPage);
1404 1 1. createPdfPTable : negated conditional → NO_COVERAGE
        if (!Float.isNaN(offset)) {
1405 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setSpacingBefore → NO_COVERAGE
            pdfptable.setSpacingBefore(offset);
1406
        }
1407 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setHorizontalAlignment → NO_COVERAGE
        pdfptable.setHorizontalAlignment(alignment);
1408 1 1. createPdfPTable : negated conditional → NO_COVERAGE
        if (locked) {
1409 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setTotalWidth → NO_COVERAGE
            pdfptable.setTotalWidth(width);
1410 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setLockedWidth → NO_COVERAGE
            pdfptable.setLockedWidth(true);
1411
        }
1412
        else {
1413 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::setWidthPercentage → NO_COVERAGE
            pdfptable.setWidthPercentage(width);
1414
        }
1415
        Row row;
1416 1 1. createPdfPTable : negated conditional → NO_COVERAGE
        for (Iterator iterator = iterator(); iterator.hasNext(); ) {
1417
            row = (Row) iterator.next();
1418
            Element cell;
1419
            PdfPCell pcell;
1420 2 1. createPdfPTable : changed conditional boundary → NO_COVERAGE
2. createPdfPTable : negated conditional → NO_COVERAGE
            for (int i = 0; i < row.getColumns(); i++) {
1421 1 1. createPdfPTable : negated conditional → NO_COVERAGE
                if ((cell = (Element)row.getCell(i)) != null) {
1422 1 1. createPdfPTable : negated conditional → NO_COVERAGE
                    if (cell instanceof Table) {
1423
                        pcell = new PdfPCell(((Table)cell).createPdfPTable());
1424
                    }
1425 1 1. createPdfPTable : negated conditional → NO_COVERAGE
                    else if (cell instanceof Cell) {
1426
                        pcell = ((Cell)cell).createPdfPCell();
1427 3 1. createPdfPTable : Replaced float division with multiplication → NO_COVERAGE
2. createPdfPTable : Replaced float addition with subtraction → NO_COVERAGE
3. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPCell::setPadding → NO_COVERAGE
                        pcell.setPadding(cellpadding + cellspacing / 2f);
1428
                        SimpleCell c_evt = new SimpleCell(SimpleCell.CELL);
1429 1 1. createPdfPTable : removed call to com/lowagie/text/SimpleCell::cloneNonPositionParameters → NO_COVERAGE
                        c_evt.cloneNonPositionParameters((Cell)cell);
1430 2 1. createPdfPTable : Replaced float multiplication with division → NO_COVERAGE
2. createPdfPTable : removed call to com/lowagie/text/SimpleCell::setSpacing → NO_COVERAGE
                        c_evt.setSpacing(cellspacing * 2f);
1431 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPCell::setCellEvent → NO_COVERAGE
                        pcell.setCellEvent(c_evt);
1432
                    }
1433
                    else {
1434
                        pcell = new PdfPCell();
1435
                    }
1436 1 1. createPdfPTable : removed call to com/lowagie/text/pdf/PdfPTable::addCell → NO_COVERAGE
                    pdfptable.addCell(pcell);
1437
                }
1438
            }
1439
        }
1440 1 1. createPdfPTable : mutated return of Object value for com/lowagie/text/Table::createPdfPTable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return pdfptable;
1441
    }
1442
1443
    /**
1444
     * Indicates if this is the first time the section is added.
1445
     * @since    iText2.0.8
1446
     * @return    true if the section wasn't added yet
1447
     */
1448
    public boolean isNotAddedYet() {
1449
        return notAddedYet;
1450
    }
1451
1452
    /**
1453
     * Sets the indication if the section was already added to
1454
     * the document.
1455
     * @since    iText2.0.8
1456
     * @param notAddedYet
1457
     */
1458
    public void setNotAddedYet(boolean notAddedYet) {
1459
        this.notAddedYet = notAddedYet;
1460
    }
1461
    
1462
    /**
1463
     * @since    iText 2.0.8
1464
     * @see com.lowagie.text.LargeElement#flushContent()
1465
     */
1466
    public void flushContent() {        
1467 1 1. flushContent : removed call to com/lowagie/text/Table::setNotAddedYet → NO_COVERAGE
        this.setNotAddedYet(false);
1468
        ArrayList headerrows = new ArrayList();
1469 4 1. flushContent : changed conditional boundary → NO_COVERAGE
2. flushContent : Changed increment from 1 to -1 → NO_COVERAGE
3. flushContent : Replaced integer addition with subtraction → NO_COVERAGE
4. flushContent : negated conditional → NO_COVERAGE
        for (int i = 0; i < getLastHeaderRow() + 1; i++) {
1470
            headerrows.add(rows.get(i));
1471
        }
1472
        rows = headerrows;
1473
    }
1474
1475
    /**
1476
     * @since    iText 2.0.8
1477
     * @see com.lowagie.text.LargeElement#isComplete()
1478
     */
1479
    public boolean isComplete() {
1480
        return complete;
1481
    }
1482
1483
    /**
1484
     * @since    iText 2.0.8
1485
     * @see com.lowagie.text.LargeElement#setComplete(boolean)
1486
     */
1487
    public void setComplete(boolean complete) {
1488
        this.complete = complete;
1489
    }
1490
    
1491
    /**
1492
     * Gets the default layout of the Table.
1493
     * @return a cell with all the defaults
1494
     * @deprecated As of iText 2.0.7, replaced by {@link #getDefaultCell()},
1495
     * scheduled for removal at 2.2.0
1496
     */
1497
    public Cell getDefaultLayout() {
1498
        return getDefaultCell();
1499
    }
1500
    
1501
    /**
1502
     * Sets the default layout of the Table to
1503
     * the provided Cell
1504
     * @param value a cell with all the defaults
1505
     * @deprecated As of iText 2.0.7, replaced by {@link #setDefaultCell(Cell)},
1506
     * scheduled for removal at 2.2.0
1507
     */
1508
    public void setDefaultLayout(Cell value) {
1509
        defaultCell = value;
1510
    }
1511
}

Mutations

250

1.1
Location :
Killed by : none
removed call to com/lowagie/text/Table::setBorder → SURVIVED

251

1.1
Location :
Killed by : none
removed call to com/lowagie/text/Table::setBorderWidth → SURVIVED

252

1.1
Location :
Killed by : none
removed call to com/lowagie/text/Cell::setBorder → SURVIVED

255

1.1
Location :
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location :
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

261

1.1
Location :
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location :
Killed by : none
Changed increment from 1 to -1 → TIMED_OUT

3.3
Location :
Killed by : none
negated conditional → SURVIVED

268

1.1
Location :
Killed by : none
Replaced float division with multiplication → SURVIVED

269

1.1
Location :
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
changed conditional boundary → KILLED

2.2
Location :
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Changed increment from 1 to -1 → KILLED

3.3
Location :
Killed by : none
negated conditional → SURVIVED

279

1.1
Location :
Killed by : none
removed call to com/lowagie/text/Table::cloneNonPositionParameters → NO_COVERAGE

308

1.1
Location : process
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

311

1.1
Location : process
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

331

1.1
Location : getChunks
Killed by : none
mutated return of Object value for com/lowagie/text/Table::getChunks to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

368

1.1
Location : getDimension
Killed by : none
mutated return of Object value for com/lowagie/text/Table::getDimension to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

414

1.1
Location : endHeaders
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

415

1.1
Location : endHeaders
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

460

1.1
Location : setHorizontalAlignment
Killed by : none
negated conditional → NO_COVERAGE

575

1.1
Location : setWidths
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

581

1.1
Location : setWidths
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
changed conditional boundary → KILLED

2.2
Location : setWidths
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Changed increment from 1 to -1 → KILLED

3.3
Location : setWidths
Killed by : none
negated conditional → SURVIVED

582

1.1
Location : setWidths
Killed by : none
Replaced float addition with subtraction → SURVIVED

587

1.1
Location : setWidths
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Replaced integer subtraction with addition → KILLED

588

1.1
Location : setWidths
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : setWidths
Killed by : none
Changed increment from 1 to -1 → SURVIVED

3.3
Location : setWidths
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Replaced integer subtraction with addition → KILLED

4.4
Location : setWidths
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

589

1.1
Location : setWidths
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : setWidths
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

591

1.1
Location : setWidths
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : setWidths
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

607

1.1
Location : setWidths
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : setWidths
Killed by : none
negated conditional → NO_COVERAGE

609

1.1
Location : setWidths
Killed by : none
removed call to com/lowagie/text/Table::setWidths → NO_COVERAGE

631

1.1
Location : setTableFitsPage
Killed by : none
negated conditional → SURVIVED

2.2
Location : setTableFitsPage
Killed by : none
removed call to com/lowagie/text/Table::setCellsFitPage → SURVIVED

704

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::addCell → NO_COVERAGE

715

1.1
Location : addCell
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

716

1.1
Location : addCell
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

717

1.1
Location : addCell
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

2.2
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::insertTable → SURVIVED

719

1.1
Location : addCell
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : addCell
Killed by : none
negated conditional → SURVIVED

720

1.1
Location : addCell
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : addCell
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : addCell
Killed by : none
negated conditional → SURVIVED

4.4
Location : addCell
Killed by : none
negated conditional → SURVIVED

721

1.1
Location : addCell
Killed by : none
negated conditional → SURVIVED

724

1.1
Location : addCell
Killed by : none
negated conditional → SURVIVED

2.2
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setBorder → SURVIVED

725

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::fill → SURVIVED

726

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::placeCell → SURVIVED

727

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::setCurrentLocationToNextValidPosition → SURVIVED

737

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::addCell → SURVIVED

754

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::addCell → NO_COVERAGE

769

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setBorder → NO_COVERAGE

770

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setBorderWidth → NO_COVERAGE

771

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setBorderColor → NO_COVERAGE

772

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setBackgroundColor → NO_COVERAGE

773

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setHorizontalAlignment → NO_COVERAGE

774

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setVerticalAlignment → NO_COVERAGE

775

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setColspan → NO_COVERAGE

776

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Cell::setRowspan → NO_COVERAGE

777

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::addCell → NO_COVERAGE

791

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::addCell → NO_COVERAGE

805

1.1
Location : addCell
Killed by : none
removed call to com/lowagie/text/Table::addCell → NO_COVERAGE

815

1.1
Location : insertTable
Killed by : none
negated conditional → NO_COVERAGE

816

1.1
Location : insertTable
Killed by : none
removed call to com/lowagie/text/Table::insertTable → NO_COVERAGE

828

1.1
Location : insertTable
Killed by : none
negated conditional → NO_COVERAGE

829

1.1
Location : insertTable
Killed by : none
removed call to com/lowagie/text/Table::insertTable → NO_COVERAGE

841

1.1
Location : insertTable
Killed by : none
negated conditional → NO_COVERAGE

842

1.1
Location : insertTable
Killed by : none
negated conditional → NO_COVERAGE

844

1.1
Location : insertTable
Killed by : none
removed call to com/lowagie/text/Table::complete → NO_COVERAGE

846

1.1
Location : insertTable
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : insertTable
Killed by : none
negated conditional → NO_COVERAGE

850

1.1
Location : insertTable
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : insertTable
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

852

1.1
Location : insertTable
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : insertTable
Killed by : none
negated conditional → NO_COVERAGE

853

1.1
Location : insertTable
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : insertTable
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : insertTable
Killed by : none
negated conditional → NO_COVERAGE

858

1.1
Location : insertTable
Killed by : none
removed call to com/lowagie/text/Row::setElement → NO_COVERAGE

860

1.1
Location : insertTable
Killed by : none
removed call to com/lowagie/text/Table::setCurrentLocationToNextValidPosition → NO_COVERAGE

871

1.1
Location : addColumns
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

873

1.1
Location : addColumns
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : addColumns
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : addColumns
Killed by : none
negated conditional → NO_COVERAGE

875

1.1
Location : addColumns
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : addColumns
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : addColumns
Killed by : none
negated conditional → NO_COVERAGE

876

1.1
Location : addColumns
Killed by : none
removed call to com/lowagie/text/Row::setElement → NO_COVERAGE

878

1.1
Location : addColumns
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : addColumns
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : addColumns
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

4.4
Location : addColumns
Killed by : none
negated conditional → NO_COVERAGE

5.5
Location : addColumns
Killed by : none
negated conditional → NO_COVERAGE

879

1.1
Location : addColumns
Killed by : none
removed call to com/lowagie/text/Row::setElement → NO_COVERAGE

885

1.1
Location : addColumns
Killed by : none
removed call to java/lang/System::arraycopy → NO_COVERAGE

886

1.1
Location : addColumns
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : addColumns
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : addColumns
Killed by : none
negated conditional → NO_COVERAGE

901

1.1
Location : deleteColumn
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

902

1.1
Location : deleteColumn
Killed by : none
removed call to java/lang/System::arraycopy → NO_COVERAGE

903

1.1
Location : deleteColumn
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : deleteColumn
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : deleteColumn
Killed by : none
removed call to java/lang/System::arraycopy → NO_COVERAGE

904

1.1
Location : deleteColumn
Killed by : none
removed call to com/lowagie/text/Table::setWidths → NO_COVERAGE

905

1.1
Location : deleteColumn
Killed by : none
removed call to java/lang/System::arraycopy → NO_COVERAGE

909

1.1
Location : deleteColumn
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : deleteColumn
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : deleteColumn
Killed by : none
negated conditional → NO_COVERAGE

911

1.1
Location : deleteColumn
Killed by : none
removed call to com/lowagie/text/Row::deleteColumn → NO_COVERAGE

914

1.1
Location : deleteColumn
Killed by : none
negated conditional → NO_COVERAGE

915

1.1
Location : deleteColumn
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : deleteColumn
Killed by : none
removed call to java/awt/Point::setLocation → NO_COVERAGE

926

1.1
Location : deleteRow
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : deleteRow
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : deleteRow
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : deleteRow
Killed by : none
negated conditional → NO_COVERAGE

927

1.1
Location : deleteRow
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

930

1.1
Location : deleteRow
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : deleteRow
Killed by : none
removed call to java/awt/Point::setLocation → NO_COVERAGE

931

1.1
Location : deleteRow
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

939

1.1
Location : deleteAllRows
Killed by : none
removed call to java/util/ArrayList::clear → NO_COVERAGE

941

1.1
Location : deleteAllRows
Killed by : none
removed call to java/awt/Point::setLocation → NO_COVERAGE

951

1.1
Location : deleteLastRow
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : deleteLastRow
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

958

1.1
Location : complete
Killed by : none
negated conditional → NO_COVERAGE

959

1.1
Location : complete
Killed by : none
removed call to com/lowagie/text/Table::mergeInsertedTables → NO_COVERAGE

962

1.1
Location : complete
Killed by : none
negated conditional → NO_COVERAGE

963

1.1
Location : complete
Killed by : none
removed call to com/lowagie/text/Table::fillEmptyMatrixCells → NO_COVERAGE

979

1.1
Location : getElement
Killed by : none
mutated return of Object value for com/lowagie/text/Table::getElement to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1001

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1004

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1005

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1008

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1014

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

1017

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1018

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1019

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1020

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1021

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1022

1.1
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1023

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1024

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1028

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1029

1.1
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1030

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1031

1.1
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1032

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1033

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1036

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1037

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1040

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1041

1.1
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1053

1.1
Location : mergeInsertedTables
Killed by : none
removed call to java/lang/System::arraycopy → NO_COVERAGE

1064

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1069

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1071

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1072

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1075

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1080

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1084

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1092

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1093

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1095

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1097

1.1
Location : mergeInsertedTables
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

1098

1.1
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1103

1.1
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1112

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1117

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1120

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1121

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1126

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1129

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1130

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1136

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1137

1.1
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1138

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1141

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1144

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1145

1.1
Location : mergeInsertedTables
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1147

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1148

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1150

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1154

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1156

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
removed call to com/lowagie/text/Cell::setColspan → NO_COVERAGE

1159

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1168

1.1
Location : mergeInsertedTables
Killed by : none
negated conditional → NO_COVERAGE

1171

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
removed call to com/lowagie/text/Cell::setRowspan → NO_COVERAGE

1172

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : mergeInsertedTables
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : mergeInsertedTables
Killed by : none
removed call to com/lowagie/text/Cell::setColspan → NO_COVERAGE

1175

1.1
Location : mergeInsertedTables
Killed by : none
removed call to com/lowagie/text/Table::placeCell → NO_COVERAGE

1178

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1180

1.1
Location : mergeInsertedTables
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1195

1.1
Location : fillEmptyMatrixCells
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : fillEmptyMatrixCells
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : fillEmptyMatrixCells
Killed by : none
negated conditional → NO_COVERAGE

1196

1.1
Location : fillEmptyMatrixCells
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : fillEmptyMatrixCells
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : fillEmptyMatrixCells
Killed by : none
negated conditional → NO_COVERAGE

1197

1.1
Location : fillEmptyMatrixCells
Killed by : none
negated conditional → NO_COVERAGE

1198

1.1
Location : fillEmptyMatrixCells
Killed by : none
removed call to com/lowagie/text/Table::addCell → NO_COVERAGE

1220

1.1
Location : isValidLocation
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : isValidLocation
Killed by : none
negated conditional → SURVIVED

1222

1.1
Location : isValidLocation
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : isValidLocation
Killed by : none
Replaced integer addition with subtraction → SURVIVED

3.3
Location : isValidLocation
Killed by : none
negated conditional → SURVIVED

1223

1.1
Location : isValidLocation
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1226

1.1
Location : isValidLocation
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : isValidLocation
Killed by : none
Replaced integer subtraction with addition → SURVIVED

3.3
Location : isValidLocation
Killed by : none
Replaced integer subtraction with addition → SURVIVED

4.4
Location : isValidLocation
Killed by : none
negated conditional → SURVIVED

1227

1.1
Location : isValidLocation
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : isValidLocation
Killed by : none
Replaced integer subtraction with addition → SURVIVED

3.3
Location : isValidLocation
Killed by : none
Replaced integer subtraction with addition → SURVIVED

4.4
Location : isValidLocation
Killed by : none
negated conditional → SURVIVED

1229

1.1
Location : isValidLocation
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
changed conditional boundary → KILLED

2.2
Location : isValidLocation
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Changed increment from 1 to -1 → KILLED

3.3
Location : isValidLocation
Killed by : none
Replaced integer addition with subtraction → SURVIVED

4.4
Location : isValidLocation
Killed by : none
negated conditional → SURVIVED

1230

1.1
Location : isValidLocation
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
changed conditional boundary → KILLED

2.2
Location : isValidLocation
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Changed increment from 1 to -1 → KILLED

3.3
Location : isValidLocation
Killed by : none
Replaced integer addition with subtraction → SURVIVED

4.4
Location : isValidLocation
Killed by : none
negated conditional → SURVIVED

1231

1.1
Location : isValidLocation
Killed by : none
negated conditional → SURVIVED

1232

1.1
Location : isValidLocation
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1238

1.1
Location : isValidLocation
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : isValidLocation
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : isValidLocation
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : isValidLocation
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1241

1.1
Location : isValidLocation
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED

1251

1.1
Location : assumeTableDefaults
Killed by : none
negated conditional → SURVIVED

1252

1.1
Location : assumeTableDefaults
Killed by : none
removed call to com/lowagie/text/Cell::setBorder → NO_COVERAGE

1254

1.1
Location : assumeTableDefaults
Killed by : none
negated conditional → SURVIVED

1255

1.1
Location : assumeTableDefaults
Killed by : none
removed call to com/lowagie/text/Cell::setBorderWidth → NO_COVERAGE

1257

1.1
Location : assumeTableDefaults
Killed by : none
negated conditional → SURVIVED

1258

1.1
Location : assumeTableDefaults
Killed by : none
removed call to com/lowagie/text/Cell::setBorderColor → SURVIVED

1260

1.1
Location : assumeTableDefaults
Killed by : none
negated conditional → SURVIVED

1261

1.1
Location : assumeTableDefaults
Killed by : none
removed call to com/lowagie/text/Cell::setBackgroundColor → SURVIVED

1263

1.1
Location : assumeTableDefaults
Killed by : none
negated conditional → SURVIVED

1264

1.1
Location : assumeTableDefaults
Killed by : none
removed call to com/lowagie/text/Cell::setHorizontalAlignment → SURVIVED

1266

1.1
Location : assumeTableDefaults
Killed by : none
negated conditional → SURVIVED

1267

1.1
Location : assumeTableDefaults
Killed by : none
removed call to com/lowagie/text/Cell::setVerticalAlignment → SURVIVED

1281

1.1
Location : placeCell
Killed by : none
Replaced integer addition with subtraction → SURVIVED

2.2
Location : placeCell
Killed by : none
Replaced integer subtraction with addition → SURVIVED

1282

1.1
Location : placeCell
Killed by : none
removed call to com/lowagie/text/Table::assumeTableDefaults → SURVIVED

1283

1.1
Location : placeCell
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : placeCell
Killed by : none
Replaced integer addition with subtraction → SURVIVED

3.3
Location : placeCell
Killed by : none
negated conditional → SURVIVED

1284

1.1
Location : placeCell
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : placeCell
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : placeCell
Killed by : none
negated conditional → NO_COVERAGE

1291

1.1
Location : placeCell
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
changed conditional boundary → KILLED

2.2
Location : placeCell
Killed by : none
Changed increment from 1 to -1 → SURVIVED

3.3
Location : placeCell
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Replaced integer addition with subtraction → KILLED

4.4
Location : placeCell
Killed by : none
Replaced integer addition with subtraction → SURVIVED

5.5
Location : placeCell
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

1292

1.1
Location : placeCell
Killed by : none
negated conditional → NO_COVERAGE

1313

1.1
Location : setCurrentLocationToNextValidPosition
Killed by : none
Replaced integer addition with subtraction → SURVIVED

2.2
Location : setCurrentLocationToNextValidPosition
Killed by : none
negated conditional → SURVIVED

1314

1.1
Location : setCurrentLocationToNextValidPosition
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
Changed increment from 1 to -1 → KILLED

1318

1.1
Location : setCurrentLocationToNextValidPosition
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1322

1.1
Location : setCurrentLocationToNextValidPosition
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
changed conditional boundary → KILLED

2.2
Location : setCurrentLocationToNextValidPosition
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : setCurrentLocationToNextValidPosition
Killed by : com.lowagie.text.html.HtmlParserTest.testParse_tableWithSpaces()
negated conditional → KILLED

4.4
Location : setCurrentLocationToNextValidPosition
Killed by : none
negated conditional → SURVIVED

5.5
Location : setCurrentLocationToNextValidPosition
Killed by : none
negated conditional → SURVIVED

1342

1.1
Location : getWidths
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

1344

1.1
Location : getWidths
Killed by : none
negated conditional → NO_COVERAGE

1345

1.1
Location : getWidths
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getWidths
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

1356

1.1
Location : getWidths
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

2.2
Location : getWidths
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

3.3
Location : getWidths
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

4.4
Location : getWidths
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1360

1.1
Location : getWidths
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

2.2
Location : getWidths
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

3.3
Location : getWidths
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

4.4
Location : getWidths
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1363

1.1
Location : getWidths
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getWidths
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

1365

1.1
Location : getWidths
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getWidths
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : getWidths
Killed by : none
negated conditional → NO_COVERAGE

1366

1.1
Location : getWidths
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : getWidths
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : getWidths
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

4.4
Location : getWidths
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

5.5
Location : getWidths
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1369

1.1
Location : getWidths
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

1370

1.1
Location : getWidths
Killed by : none
mutated return of Object value for com/lowagie/text/Table::getWidths to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1388

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1391

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/Table::setAutoFillEmptyCells → NO_COVERAGE

1392

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/Table::complete → NO_COVERAGE

1394

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setComplete → NO_COVERAGE

1395

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1396

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setSkipFirstHeader → NO_COVERAGE

1398

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/SimpleTable::cloneNonPositionParameters → NO_COVERAGE

1399

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/SimpleTable::setCellspacing → NO_COVERAGE

1400

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setTableEvent → NO_COVERAGE

1401

1.1
Location : createPdfPTable
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setHeaderRows → NO_COVERAGE

1402

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setSplitLate → NO_COVERAGE

1403

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setKeepTogether → NO_COVERAGE

1404

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1405

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setSpacingBefore → NO_COVERAGE

1407

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setHorizontalAlignment → NO_COVERAGE

1408

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1409

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setTotalWidth → NO_COVERAGE

1410

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setLockedWidth → NO_COVERAGE

1413

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::setWidthPercentage → NO_COVERAGE

1416

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1420

1.1
Location : createPdfPTable
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1421

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1422

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1425

1.1
Location : createPdfPTable
Killed by : none
negated conditional → NO_COVERAGE

1427

1.1
Location : createPdfPTable
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : createPdfPTable
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

3.3
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPCell::setPadding → NO_COVERAGE

1429

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/SimpleCell::cloneNonPositionParameters → NO_COVERAGE

1430

1.1
Location : createPdfPTable
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/SimpleCell::setSpacing → NO_COVERAGE

1431

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPCell::setCellEvent → NO_COVERAGE

1436

1.1
Location : createPdfPTable
Killed by : none
removed call to com/lowagie/text/pdf/PdfPTable::addCell → NO_COVERAGE

1440

1.1
Location : createPdfPTable
Killed by : none
mutated return of Object value for com/lowagie/text/Table::createPdfPTable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1467

1.1
Location : flushContent
Killed by : none
removed call to com/lowagie/text/Table::setNotAddedYet → NO_COVERAGE

1469

1.1
Location : flushContent
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : flushContent
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : flushContent
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : flushContent
Killed by : none
negated conditional → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.4.2