Search in sources :

Example 1 with Paragraph

use of com.vladsch.flexmark.ast.Paragraph in project flexmark-java by vsch.

the class QuotedFormatProvider method adjustPPrForFormatting.

@Override
public void adjustPPrForFormatting(PPr pPr) {
    // here we need to adjust for inherited left margin
    final BigInteger newLeftInd = myDocx.getHelper().safeIndLeft(pPr);
    final PPr styledPPr = myDocx.getHelper().getExplicitPPr(pPr);
    if (styledPPr != null && styledPPr.getPBdr() != null && newLeftInd != null && newLeftInd.compareTo(myLeftInd) > 0) {
        // it grew, word has the border hanging and we want the we shift it by our left border spacing
        CTBorder leftBorder = styledPPr.getPBdr().getLeft();
        if (leftBorder != null && leftBorder.getSpace() != null && leftBorder.getSpace().compareTo(BigInteger.ZERO) > 0) {
            // pPr.getInd().setLeft(newLeftInd.add(leftBorder.getSpace().multiply(BigInteger.valueOf(20))));
            final T currentNode = myDocx.getContextFrame();
            if (currentNode instanceof Paragraph) {
                int tmp = 0;
            }
        }
    }
}
Also used : PPr(org.docx4j.wml.PPr) CTBorder(org.docx4j.wml.CTBorder) BigInteger(java.math.BigInteger) Paragraph(com.vladsch.flexmark.ast.Paragraph)

Aggregations

Paragraph (com.vladsch.flexmark.ast.Paragraph)1 BigInteger (java.math.BigInteger)1 CTBorder (org.docx4j.wml.CTBorder)1 PPr (org.docx4j.wml.PPr)1