{
text = String.valueOf(value);
}
final ElementStyleSheet style = element.getStyle();
final ReportAttributeMap attrs = element.getAttributes();
final TextCache.Result result =
textCache.get(style.getId(), style.getChangeTracker(), attrs.getChangeTracker(), text);
if (result != null)
{
addTextNodes(element, rawValue, result.getText(), result.getFinish(),
parentBox, result.getStyleSheet(), stateKey);
return;
}
final SimpleStyleSheet elementStyle;
if ((parentBox.getNodeType() & LayoutNodeTypes.MASK_BOX_CANVAS) == LayoutNodeTypes.MASK_BOX_CANVAS)
{
if (element.isDynamicContent() == false)
{
elementStyle = textStyleCache.getStyleSheet(new NonDynamicHeightWrapperStyleSheet(style));
}
else
{
elementStyle = styleCache.getStyleSheet(new DynamicHeightWrapperStyleSheet(style));
}
}
else
{
elementStyle = styleCache.getStyleSheet(style);
}
if (buffer != null)
{
buffer.setCursor(0);
}
buffer = Utf16LE.getInstance().decodeString(text, buffer);
bufferArray = buffer.getBuffer(bufferArray);
if (((parentBox.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE) == false)
{
textFactory.startText();
}
final RenderNode[] renderNodes = textFactory.createText
(bufferArray, 0, buffer.getLength(), elementStyle, element.getElementType(), element.getObjectID(), attrs);
final RenderNode[] finishNodes = textFactory.finishText();
addTextNodes(element, rawValue, renderNodes, finishNodes, parentBox, elementStyle, stateKey);
textCache.store(style.getId(), style.getChangeTracker(), attrs.getChangeTracker(),
text, elementStyle, attrs, renderNodes, finishNodes);
}