git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@391084
13f79535-47bb-0310-9956-
ffa450edef68
{
parentPAP = _styleDescriptions[baseIndex].getPAP();
- if(parentPAP == null)
+ if(parentPAP == null)
{
- createPap(baseIndex);
- parentPAP = _styleDescriptions[baseIndex].getPAP();
+ if(baseIndex == istd) {
+ // Oh dear, style claims that it is its own parent
+ throw new IllegalStateException("Pap style " + istd + " claimed to have itself as its parent, which isn't allowed");
+ } else {
+ // Create the parent style
+ createPap(baseIndex);
+ parentPAP = _styleDescriptions[baseIndex].getPAP();
+ }
}
}