Search in sources :

Example 1 with CTTextBulletSizePercent

use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBulletSizePercent in project poi by apache.

the class XSLFTextParagraph method setBulletFontSize.

/**
     * Sets the bullet size that is to be used within a paragraph.
     * This may be specified in two different ways, percentage spacing and font point spacing:
     * <p>
     * If bulletSize >= 0, then bulletSize is a percentage of the font size.
     * If bulletSize < 0, then it specifies the size in points
     * </p>
     */
public void setBulletFontSize(double bulletSize) {
    CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
    if (bulletSize >= 0) {
        CTTextBulletSizePercent pt = pr.isSetBuSzPct() ? pr.getBuSzPct() : pr.addNewBuSzPct();
        pt.setVal((int) (bulletSize * 1000));
        if (pr.isSetBuSzPts())
            pr.unsetBuSzPts();
    } else {
        CTTextBulletSizePoint pt = pr.isSetBuSzPts() ? pr.getBuSzPts() : pr.addNewBuSzPts();
        pt.setVal((int) (-bulletSize * 100));
        if (pr.isSetBuSzPct())
            pr.unsetBuSzPct();
    }
}
Also used : CTTextBulletSizePercent(org.openxmlformats.schemas.drawingml.x2006.main.CTTextBulletSizePercent) CTTextParagraphProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties) CTTextBulletSizePoint(org.openxmlformats.schemas.drawingml.x2006.main.CTTextBulletSizePoint)

Aggregations

CTTextBulletSizePercent (org.openxmlformats.schemas.drawingml.x2006.main.CTTextBulletSizePercent)1 CTTextBulletSizePoint (org.openxmlformats.schemas.drawingml.x2006.main.CTTextBulletSizePoint)1 CTTextParagraphProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties)1