newDocument function
DraftDocument
newDocument(
- TextMeasurer measurer, {
- DecimalSeparator decimalSeparator = DecimalSeparator.point,
The document New and launch open (spec 12a D4): prepareDocument, then
defaultPage with decimalSeparator attached through the log (spec Q0
N1), then the history cleared, so a fresh document has Undo disabled
and the host's save point finds it clean.
Implementation
DraftDocument newDocument(TextMeasurer measurer,
{DecimalSeparator decimalSeparator = DecimalSeparator.point}) {
final doc = prepareDocument(measurer);
doc.commands.execute(SetComponentCommand<PageComponent>(
doc.rootHandle, defaultPage(decimalSeparator: decimalSeparator)));
doc.commands.clearHistory();
return doc;
}