try to avoid recreating HSLFShapePlaceholderDetails

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1925869 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2025-05-27 17:34:05 +00:00
parent c1dc0c6130
commit 67b0dc3966

View File

@ -80,6 +80,8 @@ public abstract class HSLFSimpleShape extends HSLFShape implements SimpleShape<H
*/ */
protected HSLFHyperlink _hyperlink; protected HSLFHyperlink _hyperlink;
protected HSLFShapePlaceholderDetails _placeholderDetails;
/** /**
* Create a SimpleShape object and initialize it from the supplied Record container. * Create a SimpleShape object and initialize it from the supplied Record container.
* *
@ -564,10 +566,12 @@ public abstract class HSLFSimpleShape extends HSLFShape implements SimpleShape<H
@Override @Override
public HSLFShapePlaceholderDetails getPlaceholderDetails() { public HSLFShapePlaceholderDetails getPlaceholderDetails() {
return new HSLFShapePlaceholderDetails(this); if (_placeholderDetails == null) {
_placeholderDetails = new HSLFShapePlaceholderDetails(this);
}
return _placeholderDetails;
} }
@Override @Override
public Placeholder getPlaceholder() { public Placeholder getPlaceholder() {
return getPlaceholderDetails().getPlaceholder(); return getPlaceholderDetails().getPlaceholder();