8265574: Improve handling of sheets

Reviewed-by: azvegint, prr, rhalade, mschoene, ahgross
This commit is contained in:
Prasanta Sadhukhan 2021-07-12 15:37:22 +00:00 committed by Henry Jen
parent f2c5728a86
commit 3ab356335d

View File

@ -1002,19 +1002,27 @@ class StylesheetDestination
return true;
}
public Style realize()
public Style realize() {
return realize(null);
}
private Style realize(Set<Integer> alreadyMetBasisIndexSet)
{
Style basis = null;
Style next = null;
if (alreadyMetBasisIndexSet == null) {
alreadyMetBasisIndexSet = new HashSet<>();
}
if (realizedStyle != null)
return realizedStyle;
if (basedOn != STYLENUMBER_NONE) {
if (basedOn != STYLENUMBER_NONE && alreadyMetBasisIndexSet.add(basedOn)) {
StyleDefiningDestination styleDest;
styleDest = definedStyles.get(Integer.valueOf(basedOn));
styleDest = definedStyles.get(basedOn);
if (styleDest != null && styleDest != this) {
basis = styleDest.realize();
basis = styleDest.realize(alreadyMetBasisIndexSet);
}
}