Bug 54758

Summary: [PATCH] ConditionalFormattingRule: "stopIfTrue" attribute is missing
Product: POI Reporter: gaukler <gg>
Component: SS CommonAssignee: POI Developers List <dev>
Status: NEEDINFO ---    
Severity: enhancement CC: dominik.stadler, innocentliny
Priority: P2 Keywords: PatchAvailable
Version: 3.10-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Simple patch for the changes proposed in this bug

Description gaukler 2013-03-27 13:46:58 UTC
There is no method to set the "stopIfTrue" attribute in ConditionalFormattingRule


Solution:

CHANGES IN org.apache.poi.ss.usermodel.ConditionalFormattingRule

ADD:

    /**
     * Sets the "stopIfTrue" attribute
     */
    public void setStopIfTrue(boolean bln);

    /**
     * Unsets the "stopIfTrue" attribute
     */
    public void unsetStopIfTrue();




CHANGES IN org.apache.poi.xssf.usermodel.XSSFConditionalFormattingRule

ADD:

    /**
     * Sets the "stopIfTrue" attribute
     */
    @Override
    public void setStopIfTrue(boolean bln) {
        _cfRule.setStopIfTrue(bln);
    }

    /**
     * Unsets the "stopIfTrue" attribute
     */
    @Override
    public void unsetStopIfTrue() {
        _cfRule.unsetStopIfTrue();
    }



CHANGES IN org.apache.poi.hssf.usermodel.HSSFConditionalFormattingRule

ADD:

    /**
     * Sets the "stopIfTrue" attribute
     */
    @Override
    public void setStopIfTrue(boolean bln) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    /**
     * Unsets the "stopIfTrue" attribute
     */
    @Override
    public void unsetStopIfTrue() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
Comment 1 Dominik Stadler 2013-05-25 16:52:37 UTC
Created attachment 30325 [details]
Simple patch for the changes proposed in this bug

A patch adding the changes mentioned in this bug together with some simple unit tests to at least cover the new code.
Comment 2 Nick Burch 2013-06-25 15:16:57 UTC
Patch looks good to apply

One thing that might be good is to create a file in excel conditional formatting but not this rule, save, then enable stop if true, save, and then diff the BiffViewer output to try to see what record(s) get set/changed. Hopefully that will show what (little...) is needed to implement for hssf too!