|
50 | 50 |
|
51 | 51 | import java.util.ArrayList; |
52 | 52 | import java.util.HashMap; |
53 | | -import java.util.UUID; |
54 | 53 |
|
55 | 54 | /** |
56 | 55 | * A <CODE>Paragraph</CODE> is a series of <CODE>Chunk</CODE>s and/or <CODE>Phrases</CODE>. |
@@ -83,9 +82,6 @@ public class Paragraph extends Phrase implements Indentable, Spaceable, IAccessi |
83 | 82 | /** The alignment of the text. */ |
84 | 83 | protected int alignment = Element.ALIGN_UNDEFINED; |
85 | 84 |
|
86 | | - /** The text leading that is multiplied by the biggest font size in the line. */ |
87 | | - protected float multipliedLeading = 0; |
88 | | - |
89 | 85 | /** The indentation of this paragraph on the left side. */ |
90 | 86 | protected float indentationLeft; |
91 | 87 |
|
@@ -202,7 +198,6 @@ public Paragraph(Phrase phrase) { |
202 | 198 | if (phrase instanceof Paragraph) { |
203 | 199 | Paragraph p = (Paragraph)phrase; |
204 | 200 | setAlignment(p.alignment); |
205 | | - setLeading(phrase.getLeading(), p.multipliedLeading); |
206 | 201 | setIndentationLeft(p.getIndentationLeft()); |
207 | 202 | setIndentationRight(p.getIndentationRight()); |
208 | 203 | setFirstLineIndent(p.getFirstLineIndent()); |
@@ -237,6 +232,7 @@ public Paragraph cloneShallow(boolean spacingBefore) { |
237 | 232 | if (accessibleAttributes != null) |
238 | 233 | copy.accessibleAttributes = new HashMap<PdfName, PdfObject>(accessibleAttributes); |
239 | 234 | copy.setTabSettings(getTabSettings()); |
| 235 | + copy.setKeepTogether(getKeepTogether()); |
240 | 236 | return copy; |
241 | 237 | } |
242 | 238 |
|
@@ -356,38 +352,6 @@ public void setAlignment(int alignment) { |
356 | 352 | this.alignment = alignment; |
357 | 353 | } |
358 | 354 |
|
359 | | - /** |
360 | | - * @see com.itextpdf.text.Phrase#setLeading(float) |
361 | | - */ |
362 | | - @Override |
363 | | - public void setLeading(float fixedLeading) { |
364 | | - this.leading = fixedLeading; |
365 | | - this.multipliedLeading = 0; |
366 | | - } |
367 | | - |
368 | | - /** |
369 | | - * Sets the variable leading. The resultant leading will be |
370 | | - * multipliedLeading*maxFontSize where maxFontSize is the |
371 | | - * size of the biggest font in the line. |
372 | | - * @param multipliedLeading the variable leading |
373 | | - */ |
374 | | - public void setMultipliedLeading(float multipliedLeading) { |
375 | | - this.leading = 0; |
376 | | - this.multipliedLeading = multipliedLeading; |
377 | | - } |
378 | | - |
379 | | - /** |
380 | | - * Sets the leading fixed and variable. The resultant leading will be |
381 | | - * fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the |
382 | | - * size of the biggest font in the line. |
383 | | - * @param fixedLeading the fixed leading |
384 | | - * @param multipliedLeading the variable leading |
385 | | - */ |
386 | | - public void setLeading(float fixedLeading, float multipliedLeading) { |
387 | | - this.leading = fixedLeading; |
388 | | - this.multipliedLeading = multipliedLeading; |
389 | | - } |
390 | | - |
391 | 355 | /* (non-Javadoc) |
392 | 356 | * @see com.itextpdf.text.Indentable#setIndentationLeft(float) |
393 | 357 | */ |
@@ -453,31 +417,6 @@ public int getAlignment() { |
453 | 417 | return alignment; |
454 | 418 | } |
455 | 419 |
|
456 | | - /** |
457 | | - * Gets the variable leading |
458 | | - * @return the leading |
459 | | - */ |
460 | | - public float getMultipliedLeading() { |
461 | | - return multipliedLeading; |
462 | | - } |
463 | | - |
464 | | - /** |
465 | | - * Gets the total leading. |
466 | | - * This method is based on the assumption that the |
467 | | - * font of the Paragraph is the font of all the elements |
468 | | - * that make part of the paragraph. This isn't necessarily |
469 | | - * true. |
470 | | - * @return the total leading (fixed and multiplied) |
471 | | - */ |
472 | | - public float getTotalLeading() { |
473 | | - float m = font == null ? |
474 | | - Font.DEFAULTSIZE * multipliedLeading : font.getCalculatedLeading(multipliedLeading); |
475 | | - if (m > 0 && !hasLeading()) { |
476 | | - return m; |
477 | | - } |
478 | | - return getLeading() + m; |
479 | | - } |
480 | | - |
481 | 420 | /* (non-Javadoc) |
482 | 421 | * @see com.itextpdf.text.Indentable#getIndentationLeft() |
483 | 422 | */ |
|
0 commit comments