devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
15 lines (14 loc) • 464 B
JavaScript
export class ImportBookmarkInfoCore {
start = -1;
end = -1;
validate(subDocument) {
if (this.start < 0 || this.end < 0)
return false;
const maxPos = subDocument.getDocumentEndPosition();
this.start = Math.min(maxPos, this.start);
this.end = Math.min(maxPos, this.end);
if (this.start > this.end)
[this.start, this.end] = [this.end, this.start];
return true;
}
}