Skip to content

Add an API to PhraseContent to find root phrase content

Now PhraseContent practices decorator pattern. It's tedious to use a while loop to find the root content and do needed things. We should provide an API to do so.

PhraseContent PhaseContent::originalContent()
{
  auto content = this;
  // Find the original content without any decoration
  for (; content->peek(); content = content->peek());
  return content;
}
Edited by Haocheng LIU