devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
25 lines (24 loc) • 1.12 kB
JavaScript
import { MapCreator } from '../../../../../utils/map-creator';
import { StringUtils } from '@devexpress/utils/lib/utils/string';
import { DestinationType } from '../utils/destination-type';
import { UnicodeStringValueDestination } from './unicode-string-value-destination';
export class StringPropertyDestination extends UnicodeStringValueDestination {
get destinationType() { return DestinationType.StringPropertyDestination; }
get controlCharHT() { return StringPropertyDestination.controlCharHT; }
constructor(importer, setProperty) {
super(importer);
this.setProperty = setProperty;
}
createEmptyClone() {
return new StringPropertyDestination(this.importer, this.setProperty);
}
afterPopRtfState() {
if (!StringUtils.isNullOrEmpty(this.value))
this.setProperty(this.value);
}
}
StringPropertyDestination.controlCharHT = new MapCreator()
.add('\\', StringPropertyDestination.onEscapedChar)
.add('{', StringPropertyDestination.onEscapedChar)
.add('}', StringPropertyDestination.onEscapedChar)
.get();