Hello
The link is dead.
Actually I'm getting some troubles to make working the new lines breaks on placeholders replacement.
Here is the code:
{...}
- Code: Select all
TextMetaItem tmi1 = arr[replaceCommand.getFoundResult().getStart()];
TextMetaItem tmi2 = arr[replaceCommand.getFoundResult().getEnd()];
ObjectFactory factory = Context.getWmlObjectFactory();
Br br = factory.createBr();
// do replacement inside a single Text-object
String t1 = tmi1.getText().getValue();
LOGGER.debug("tmi1.getText().getValue() :" + tmi1.getText().getValue());
int beginIndex = tmi1.getPositionInsideTextObject(replaceCommand.getFoundResult().getStart());
int endIndex = tmi2.getPositionInsideTextObject(replaceCommand.getFoundResult().getEnd());
String keepBefore = t1.substring(0, beginIndex);
String keepAfter = t1.substring(endIndex + 1);
tmi1.getText().setValue(keepBefore + replaceCommand.getNewValue() + keepAfter);
{...}
replaceCommand.getNewValue() contains the new String to replace the placeholder String.
I would like to know how to add the <w:br/> between each line within the replaceCommand.getNewValue() which already contains the new line character(s),
Thanks in advance