Search in sources :

Example 1 with EscherComplexProperty

use of org.apache.poi.ddf.EscherComplexProperty in project poi by apache.

the class HSSFPicture method setFileName.

public void setFileName(String data) {
    // TODO: add trailing ? 
    byte[] bytes = StringUtil.getToUnicodeLE(data);
    EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME, true, bytes);
    setPropertyValue(prop);
}
Also used : EscherComplexProperty(org.apache.poi.ddf.EscherComplexProperty)

Example 2 with EscherComplexProperty

use of org.apache.poi.ddf.EscherComplexProperty in project poi by apache.

the class ActiveXShape method afterInsert.

@Override
protected void afterInsert(HSLFSheet sheet) {
    ExControl ctrl = getExControl();
    if (ctrl == null) {
        throw new NullPointerException("ExControl is not defined");
    }
    ctrl.getExControlAtom().setSlideId(sheet._getSheetNumber());
    String name = ctrl.getProgId() + "-" + getControlIndex() + '';
    byte[] data = StringUtil.getToUnicodeLE(name);
    EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.GROUPSHAPE__SHAPENAME, false, data);
    AbstractEscherOptRecord opt = getEscherOptRecord();
    opt.addEscherProperty(prop);
}
Also used : ExControl(org.apache.poi.hslf.record.ExControl) EscherComplexProperty(org.apache.poi.ddf.EscherComplexProperty) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Example 3 with EscherComplexProperty

use of org.apache.poi.ddf.EscherComplexProperty in project poi by apache.

the class HSLFPictureShape method getPictureName.

/**
     * Name of this picture.
     *
     * @return name of this picture
     */
public String getPictureName() {
    AbstractEscherOptRecord opt = getEscherOptRecord();
    EscherComplexProperty prop = getEscherProperty(opt, EscherProperties.BLIP__BLIPFILENAME);
    if (prop == null)
        return null;
    String name = StringUtil.getFromUnicodeLE(prop.getComplexData());
    return name.trim();
}
Also used : EscherComplexProperty(org.apache.poi.ddf.EscherComplexProperty) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Example 4 with EscherComplexProperty

use of org.apache.poi.ddf.EscherComplexProperty in project poi by apache.

the class HSLFPictureShape method setPictureName.

/**
     * Name of this picture.
     *
     * @param name of this picture
     */
public void setPictureName(String name) {
    AbstractEscherOptRecord opt = getEscherOptRecord();
    byte[] data = StringUtil.getToUnicodeLE(name + '');
    EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME, false, data);
    opt.addEscherProperty(prop);
}
Also used : EscherComplexProperty(org.apache.poi.ddf.EscherComplexProperty) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Example 5 with EscherComplexProperty

use of org.apache.poi.ddf.EscherComplexProperty in project poi by apache.

the class HSSFShape method getShapeName.

/**
     * @return the name of this shape
     */
public String getShapeName() {
    EscherOptRecord eor = getOptRecord();
    if (eor == null) {
        return null;
    }
    EscherProperty ep = eor.lookup(EscherProperties.GROUPSHAPE__SHAPENAME);
    if (ep instanceof EscherComplexProperty) {
        return StringUtil.getFromUnicodeLE(((EscherComplexProperty) ep).getComplexData());
    }
    return null;
}
Also used : EscherComplexProperty(org.apache.poi.ddf.EscherComplexProperty) EscherOptRecord(org.apache.poi.ddf.EscherOptRecord) EscherProperty(org.apache.poi.ddf.EscherProperty)

Aggregations

EscherComplexProperty (org.apache.poi.ddf.EscherComplexProperty)7 AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)3 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)3 EscherProperty (org.apache.poi.ddf.EscherProperty)2 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)1 ExControl (org.apache.poi.hslf.record.ExControl)1 HWPFDocument (org.apache.poi.hwpf.HWPFDocument)1