Exemple #1
0
bool WText::RichText::setText(const WString& newText)
{
  text = newText;

  bool ok = checkWellFormed();
  if (!ok)
    format = PlainText;

  return ok;
}
Exemple #2
0
bool WText::RichText::setFormat(TextFormat newFormat)
{
  if (format != newFormat) {
    TextFormat oldFormat = format;
    format = newFormat;
    bool ok = checkWellFormed();

    if (!ok)
      format = oldFormat;

    return ok;
  } else
    return true;
}
Exemple #3
0
bool WText::setTextFormat(TextFormat textFormat)
{
  if (textFormat_ != textFormat) {
    TextFormat oldTextFormat = textFormat_;

    textFormat_ = textFormat;
    bool textok = checkWellFormed();

    if (!textok)
      textFormat_ = oldTextFormat;

    return textok;
  } else
    return true;
}
Exemple #4
0
bool WText::setText(const WString& text)
{
  if (canOptimizeUpdates() && (text == text_))
    return true;

  text_ = text;

  bool textok = checkWellFormed();
  if (!textok)
    textFormat_ = PlainText;

  flags_.set(BIT_TEXT_CHANGED);
  repaint(RepaintInnerHtml);

  return textok;
}