Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#246: Added better handling for default 'leading' value of a Paragraph. #674

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}

}