Skip to content

Commit

Permalink
#246: Added better handling for default 'leading' value of a Paragraph.
Browse files Browse the repository at this point in the history
  • Loading branch information
ase379 authored and angelozerr committed May 25, 2024
1 parent 615d914 commit e90e7e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ protected void visitRun( XWPFRun docxRun, boolean pageNumber, String url, IIText

StylableParagraph pdfParagraph = (StylableParagraph) pdfParagraphContainer;
pdfParagraph.adjustMultipliedLeading( currentRunFontAscii );
pdfParagraph.adjustLeading(currentRunFontAscii);

// addd symbol list item chunk if needed.
String listItemText = pdfParagraph.getListItemText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,23 @@ public class StylableParagraph

private Color listItemFontColor;

private boolean defaultLeading = true;

public StylableParagraph( StylableDocument ownerDocument, IITextContainer parent )
{
super();
this.ownerDocument = ownerDocument;
this.parent = parent;
this.originMultipliedLeading = null;
this.defaultLeading = false;
}

public StylableParagraph( StylableDocument ownerDocument, Paragraph title, IITextContainer parent )
{
super( title );
this.ownerDocument = ownerDocument;
this.parent = parent;
this.defaultLeading = false;
}

// FIXME check with Angelo the purpose of this method....
Expand Down Expand Up @@ -276,4 +280,11 @@ public void adjustMultipliedLeading( Font font )
}
}

public void adjustLeading( Font font ){
if ( font != null ){
super.setLeading(font.getSize());
this.defaultLeading = false;
}
}

}

0 comments on commit e90e7e9

Please sign in to comment.