#include "stdafx.h"

#include "xtr/doc/Documents.h"

namespace xtr::doc {

void XTRDocument::SetModifiedFlag(const BOOL modified) {
  if (IsModified() != modified) {
    CDocument::SetModifiedFlag(modified);

    const auto& curTitle = GetTitle();
    if (modified) {
      SetTitle(curTitle + "*");
    } else {
      SetTitle(curTitle.Left(curTitle.GetLength() - 1));
    }
  }
}

} // namespace xtr::doc