Bug 54758 - [PATCH] ConditionalFormattingRule: "stopIfTrue" attribute is missing
Summary: [PATCH] ConditionalFormattingRule: "stopIfTrue" attribute is missing
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.10-dev
Hardware: PC All
: P2 enhancement with 1 vote (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2013-03-27 13:46 UTC by gaukler
Modified: 2020-09-25 06:16 UTC (History)
2 users (show)



Attachments
Simple patch for the changes proposed in this bug (6.36 KB, patch)
2013-05-25 16:52 UTC, Dominik Stadler
Details | Diff

Note You need to log in before you can comment on or make changes to 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!
Comment 3 gkokmdam 2020-09-24 12:44:28 UTC
@ Nick: the system suggests this bug needs additional information before it can be dealt with. But I presume this would already add value for the users of the XSSF format. Could it be applied without the solution for HSSF? Or would that violate some symmetricity requirement? I would very much like to have this for XFFS.
Comment 4 gkokmdam 2020-09-24 13:14:01 UTC
As additional information: HSSF format does not even support this as per POI code and via-via per "Microsoft Excel documentation":

    /**
     * Always true for HSSF files, per Microsoft Excel documentation
     * @see org.apache.poi.ss.usermodel.ConditionalFormattingRule#getStopIfTrue()
     */
    public boolean getStopIfTrue() {
        return true;
    }
Comment 5 gkokmdam 2020-09-25 06:16:34 UTC
Turn back to NEW as I think this could be applied. (maybe it needs a polish due to new locations of stuff but that should be simple and I volunteer to do so.)