devexpress-richedit 24.1.5-build-24204-0102 → 24.1.5-build-24221-1027
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dx.richedit.js +410 -328
- package/dist/dx.richedit.min.js +1 -1
- package/lib/client/client-rich-edit.js +2 -2
- package/lib/common/formats/html/import/importers/table.js +1 -1
- package/lib/common/formats/html/import/utils/paragraph-properties-utils.d.ts +1 -2
- package/lib/common/formats/html/import/utils/paragraph-properties-utils.js +6 -35
- package/lib/common/formats/html/import/utils/utils.d.ts +3 -0
- package/lib/common/formats/html/import/utils/utils.js +52 -3
- package/lib/common/formats/rtf/import/destination/numbering-list/destination-old-paragraph-numbering-base.js +5 -0
- package/lib/common/formats/rtf/import/destination/numbering-list/destination-old-paragraph-numbering.js +9 -1
- package/lib/common/formats/rtf/import/keyword-tables/keyword-table-holder.js +1 -0
- package/lib/common/formats/rtf/import/keyword-tables/paragraph-numbering-desc-keywords.js +3 -0
- package/lib/common/formats/rtf/import/model/numbering-lists/rtf-old-list-level-info.js +10 -1
- package/lib/common/model/manipulators/document/sub-document-inserter.js +2 -0
- package/lib/common/model/numbering-lists/numbering-list.js +2 -2
- package/lib/common/model/paragraph/paragraph-properties.d.ts +13 -0
- package/lib/common/model/paragraph/paragraph-properties.js +31 -0
- package/lib/common/model/tables/main-structures/table-cell.js +3 -1
- package/lib/common/model/tables/main-structures/table-row.js +3 -1
- package/lib/common/model/tables/secondary-structures/table-units.d.ts +2 -2
- package/lib/common/model/tables/secondary-structures/table-units.js +3 -3
- package/package.json +3 -3
package/dist/dx.richedit.js
CHANGED
@@ -13829,6 +13829,37 @@ class MaskedParagraphProperties extends ParagraphProperties {
|
|
13829
13829
|
this.setUseValue(desc.maskValue(), true);
|
13830
13830
|
}
|
13831
13831
|
}
|
13832
|
+
class LineSpacingUnit {
|
13833
|
+
init(value, type) {
|
13834
|
+
this.value = value;
|
13835
|
+
this.type = type;
|
13836
|
+
return this;
|
13837
|
+
}
|
13838
|
+
clone() {
|
13839
|
+
return new LineSpacingUnit().init(this.value, this.type);
|
13840
|
+
}
|
13841
|
+
static create(value, type) {
|
13842
|
+
return new LineSpacingUnit().init(value, type);
|
13843
|
+
}
|
13844
|
+
static createSingle() {
|
13845
|
+
return new LineSpacingUnit().init(1, ParagraphLineSpacingType.Single);
|
13846
|
+
}
|
13847
|
+
static createSesquialteral() {
|
13848
|
+
return new LineSpacingUnit().init(1.5, ParagraphLineSpacingType.Sesquialteral);
|
13849
|
+
}
|
13850
|
+
static createDouble() {
|
13851
|
+
return new LineSpacingUnit().init(2, ParagraphLineSpacingType.Double);
|
13852
|
+
}
|
13853
|
+
static createMultiple(value) {
|
13854
|
+
return new LineSpacingUnit().init(value, ParagraphLineSpacingType.Multiple);
|
13855
|
+
}
|
13856
|
+
static createExactly(value) {
|
13857
|
+
return new LineSpacingUnit().init(value, ParagraphLineSpacingType.Exactly);
|
13858
|
+
}
|
13859
|
+
static createAtLeast(value) {
|
13860
|
+
return new LineSpacingUnit().init(value, ParagraphLineSpacingType.AtLeast);
|
13861
|
+
}
|
13862
|
+
}
|
13832
13863
|
|
13833
13864
|
;// CONCATENATED MODULE: ./src/common/model/history/items/character-properties-history-items.ts
|
13834
13865
|
|
@@ -14701,7 +14732,7 @@ class TableWidthUnit extends TableCustomUnit {
|
|
14701
14732
|
return 0;
|
14702
14733
|
}
|
14703
14734
|
}
|
14704
|
-
asNumber(
|
14735
|
+
asNumber(availableWidth, converter) {
|
14705
14736
|
switch (this.type) {
|
14706
14737
|
case TableWidthUnitType.Nil:
|
14707
14738
|
case TableWidthUnitType.Auto:
|
@@ -14709,7 +14740,7 @@ class TableWidthUnit extends TableCustomUnit {
|
|
14709
14740
|
case TableWidthUnitType.ModelUnits:
|
14710
14741
|
return converter(this.value);
|
14711
14742
|
case TableWidthUnitType.FiftiethsOfPercent:
|
14712
|
-
return
|
14743
|
+
return availableWidth * this.value / TableWidthUnit.MAX_PERCENT_WIDTH;
|
14713
14744
|
}
|
14714
14745
|
}
|
14715
14746
|
divide(n) {
|
@@ -14718,7 +14749,7 @@ class TableWidthUnit extends TableCustomUnit {
|
|
14718
14749
|
}
|
14719
14750
|
}
|
14720
14751
|
TableWidthUnit.MAX_PERCENT_WIDTH = 5000;
|
14721
|
-
TableWidthUnit.
|
14752
|
+
TableWidthUnit.MULTIPLIER_FOR_PERCENTS = 50;
|
14722
14753
|
class TableHeightUnit extends TableCustomUnit {
|
14723
14754
|
init(value, type) {
|
14724
14755
|
this.value = Math.floor(value);
|
@@ -17159,8 +17190,8 @@ class AbstractNumberingList extends numbering_list_NumberingListBase {
|
|
17159
17190
|
return this.documentModel.abstractNumberingListsIdProvider.getNextId();
|
17160
17191
|
}
|
17161
17192
|
createLevel(_index) {
|
17162
|
-
|
17163
|
-
|
17193
|
+
const characterProperties = MaskedCharacterProperties.createDefault(this.documentModel);
|
17194
|
+
const paragraphProperties = MaskedParagraphProperties.createDefault(this.documentModel);
|
17164
17195
|
return new ListLevel(this.documentModel, characterProperties, paragraphProperties, new ListLevelProperties());
|
17165
17196
|
}
|
17166
17197
|
copyLevelsFrom(levels) {
|
@@ -25486,12 +25517,14 @@ class TableCell {
|
|
25486
25517
|
return new TableCellPropertiesMergerShadingInfo().getProperty(this.properties, this.parentRow.parentTable.style, this.conditionalFormatting, defaultTableProperties);
|
25487
25518
|
}
|
25488
25519
|
clone(subDocument, parentRow) {
|
25489
|
-
const
|
25520
|
+
const properties = subDocument.documentModel.cache.tableCellPropertiesCache.getItem(this.properties);
|
25521
|
+
const result = new TableCell(parentRow, properties);
|
25490
25522
|
result.preferredWidth = this.preferredWidth.clone();
|
25491
25523
|
result.columnSpan = this.columnSpan;
|
25492
25524
|
result.verticalMerging = this.verticalMerging;
|
25493
25525
|
result.startParagraphPosition = subDocument.positionManager.registerPosition(this.startParagraphPosition.value);
|
25494
25526
|
result.endParagrapPosition = subDocument.positionManager.registerPosition(this.endParagrapPosition.value);
|
25527
|
+
result.conditionalFormatting = this.conditionalFormatting;
|
25495
25528
|
return result;
|
25496
25529
|
}
|
25497
25530
|
}
|
@@ -25548,7 +25581,8 @@ class TableRow {
|
|
25548
25581
|
return cells;
|
25549
25582
|
}
|
25550
25583
|
clone(subDocument, parentTable) {
|
25551
|
-
const
|
25584
|
+
const properties = subDocument.documentModel.cache.tableRowPropertiesCache.getItem(this.properties);
|
25585
|
+
const result = new TableRow(parentTable, properties);
|
25552
25586
|
result.parentTable = parentTable;
|
25553
25587
|
result.cells = utils_list.ListUtils.map(this.cells, r => r.clone(subDocument, result));
|
25554
25588
|
result.widthBefore = this.widthBefore.clone();
|
@@ -25557,6 +25591,7 @@ class TableRow {
|
|
25557
25591
|
result.gridAfter = this.gridAfter;
|
25558
25592
|
result.height = this.height.clone();
|
25559
25593
|
result.tablePropertiesException = this.tablePropertiesException.clone();
|
25594
|
+
result.conditionalFormatting = this.conditionalFormatting;
|
25560
25595
|
return result;
|
25561
25596
|
}
|
25562
25597
|
}
|
@@ -30944,7 +30979,7 @@ function hexToBase64(hexStr) {
|
|
30944
30979
|
return hexadecimal_converter_btoa(result.join(""));
|
30945
30980
|
}
|
30946
30981
|
function base64ToHex(base64Str) {
|
30947
|
-
for (var i = 0, bin =
|
30982
|
+
for (var i = 0, bin = atob(base64Str.replace(/[ \r\n]+$/, "")), hex = []; i < bin.length; ++i) {
|
30948
30983
|
var tmp = bin.charCodeAt(i).toString(16);
|
30949
30984
|
if (tmp.length === 1)
|
30950
30985
|
tmp = "0" + tmp;
|
@@ -30967,7 +31002,7 @@ function hexadecimal_converter_btoa(bin) {
|
|
30967
31002
|
}
|
30968
31003
|
return base64.join("");
|
30969
31004
|
}
|
30970
|
-
function
|
31005
|
+
function atob(base64) {
|
30971
31006
|
if (/(=[^=]+|={3,})$/.test(base64))
|
30972
31007
|
throw new Error("String contains an invalid character");
|
30973
31008
|
base64 = base64.replace(/=/g, "");
|
@@ -41138,9 +41173,11 @@ class SubDocumentInserter {
|
|
41138
41173
|
for (const targetRow of targetTable.rows) {
|
41139
41174
|
targetRow.properties = this.getTableRowProperties(targetRow.properties);
|
41140
41175
|
targetRow.tablePropertiesException = this.getTableProperties(targetRow.tablePropertiesException);
|
41176
|
+
targetRow.conditionalFormatting = targetRow.conditionalFormatting;
|
41141
41177
|
for (const targetCell of targetRow.cells) {
|
41142
41178
|
targetCell.properties = this.getTableCellProperties(targetCell.properties);
|
41143
41179
|
targetCell.style = this.getTableCellStyle(targetCell.style);
|
41180
|
+
targetCell.conditionalFormatting = targetCell.conditionalFormatting;
|
41144
41181
|
}
|
41145
41182
|
}
|
41146
41183
|
return targetTable;
|
@@ -62357,9 +62394,18 @@ class RtfOldListLevelInfo {
|
|
62357
62394
|
this.indent = 0;
|
62358
62395
|
}
|
62359
62396
|
clone() {
|
62360
|
-
|
62397
|
+
const result = new RtfOldListLevelInfo();
|
62398
|
+
result.copyFrom(this);
|
62399
|
+
return result;
|
62361
62400
|
}
|
62362
62401
|
copyFrom(_obj) {
|
62402
|
+
this.skipNumbering = _obj.skipNumbering;
|
62403
|
+
this.includeInformationFromPreviousLevel = _obj.includeInformationFromPreviousLevel;
|
62404
|
+
this.characterProperties = _obj.characterProperties.clone();
|
62405
|
+
this.listLevelProperties = _obj.listLevelProperties.clone();
|
62406
|
+
this.textBefore = _obj.textBefore;
|
62407
|
+
this.textAfter = _obj.textAfter;
|
62408
|
+
this.indent = _obj.indent;
|
62363
62409
|
}
|
62364
62410
|
}
|
62365
62411
|
|
@@ -64599,6 +64645,11 @@ const documentPropertiesKeywords = new MapCreator()
|
|
64599
64645
|
|
64600
64646
|
|
64601
64647
|
class DestinationOldParagraphNumberingBase extends DestinationBase {
|
64648
|
+
constructor() {
|
64649
|
+
super(...arguments);
|
64650
|
+
this.textBefore = '';
|
64651
|
+
this.textAfter = '';
|
64652
|
+
}
|
64602
64653
|
get destinationType() { return DestinationType.DestinationOldParagraphNumberingBase; }
|
64603
64654
|
get controlCharHT() { return null; }
|
64604
64655
|
static setNumberingListFormat(importer, format) {
|
@@ -64756,10 +64807,296 @@ class DestinationOldParagraphNumberingBase extends DestinationBase {
|
|
64756
64807
|
}
|
64757
64808
|
}
|
64758
64809
|
|
64810
|
+
;// CONCATENATED MODULE: ./src/common/formats/rtf/import/destination/numbering-list/destination-old-paragraph-numbering.ts
|
64811
|
+
|
64812
|
+
|
64813
|
+
|
64814
|
+
|
64815
|
+
|
64816
|
+
|
64817
|
+
|
64818
|
+
|
64819
|
+
|
64820
|
+
class DestinationOldParagraphNumbering extends DestinationOldParagraphNumberingBase {
|
64821
|
+
constructor(importer) {
|
64822
|
+
super(importer);
|
64823
|
+
this.oldLevelNumber = -1;
|
64824
|
+
if (importer.importers.numbering.oldListLevelInfo == null)
|
64825
|
+
importer.importers.numbering.oldListLevelInfo = new RtfOldListLevelInfo();
|
64826
|
+
importer.importers.character.characterFormatting.coreProperties.setAllUse();
|
64827
|
+
this.multiLevelListIndex = NumberingListIndexConstants.listIndexNotSetted;
|
64828
|
+
this.simpleListIndex = NumberingListIndexConstants.listIndexNotSetted;
|
64829
|
+
}
|
64830
|
+
get destinationType() { return DestinationType.DestinationOldParagraphNumbering; }
|
64831
|
+
static onParagraphLevelKeyword(importer, parameterValue, hasParameter) {
|
64832
|
+
if (hasParameter && parameterValue == 10) {
|
64833
|
+
DestinationOldParagraphNumbering.onSimpleNumberingKeyword(importer, 0, false);
|
64834
|
+
return;
|
64835
|
+
}
|
64836
|
+
importer.destination.oldLevelNumber = parameterValue;
|
64837
|
+
importer.destination.simpleList = false;
|
64838
|
+
}
|
64839
|
+
static onBulletedParagraphKeyword(importer, _parameterValue, _hasParameter) {
|
64840
|
+
importer.importers.numbering.oldListLevelInfo.listLevelProperties.format = NumberingFormat.Bullet;
|
64841
|
+
}
|
64842
|
+
static onSimpleNumberingKeyword(importer, _parameterValue, _hasParameter) {
|
64843
|
+
importer.destination.simpleList = true;
|
64844
|
+
}
|
64845
|
+
static onSkipNumberingKeyword(importer, _parameterValue, _hasParameter) {
|
64846
|
+
importer.importers.numbering.oldListLevelInfo.skipNumbering = true;
|
64847
|
+
}
|
64848
|
+
static onListOverrideKeyword(importer, parameterValue, _hasParameter) {
|
64849
|
+
const index = importer.importers.numbering.listOverrideIndexToNumberingListIndexMap[parameterValue];
|
64850
|
+
if (index !== undefined)
|
64851
|
+
importer.importers.paragraph.paragraphFormatting.paragraphListInfo.numberingListIndex = index;
|
64852
|
+
importer.destination.explicitNumberingListIndex = true;
|
64853
|
+
}
|
64854
|
+
static onListLevelKeyword(importer, parameterValue, _hasParameter) {
|
64855
|
+
importer.importers.paragraph.paragraphFormatting.paragraphListInfo.listLevelIndex = parameterValue;
|
64856
|
+
importer.destination.explicitListLevelIndex = true;
|
64857
|
+
}
|
64858
|
+
createClone() {
|
64859
|
+
const result = new DestinationOldParagraphNumbering(this.importer);
|
64860
|
+
return result;
|
64861
|
+
}
|
64862
|
+
beforePopRtfState() {
|
64863
|
+
super.beforePopRtfState();
|
64864
|
+
if (this.shouldCreateNewList()) {
|
64865
|
+
this.createNewList();
|
64866
|
+
}
|
64867
|
+
else {
|
64868
|
+
this.skipNumbering = this.isSkipNumbering();
|
64869
|
+
this.simpleListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
64870
|
+
this.multiLevelListIndex = this.importer.importers.numbering.currentOldMultiLevelListIndex;
|
64871
|
+
}
|
64872
|
+
if (this.explicitNumberingListIndex && this.explicitListLevelIndex) {
|
64873
|
+
this.listLevelIndex = this.importer.importers.paragraph.paragraphFormatting.listLevelIndex;
|
64874
|
+
this.numberingListIndex = this.importer.importers.paragraph.paragraphFormatting.numberingListIndex;
|
64875
|
+
}
|
64876
|
+
else
|
64877
|
+
this.listLevelIndex = this.oldLevelNumber >= 0 ? this.oldLevelNumber - 1 : 0;
|
64878
|
+
}
|
64879
|
+
afterPopRtfState() {
|
64880
|
+
super.afterPopRtfState();
|
64881
|
+
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.listLevelIndex = this.listLevelIndex;
|
64882
|
+
const actualNumberingListIndex = this.isSimpleList() ? this.simpleListIndex : this.multiLevelListIndex;
|
64883
|
+
this.importer.importers.numbering.currentOldListSkipNumbering = this.skipNumbering;
|
64884
|
+
if (this.isOldNumberingListCreated) {
|
64885
|
+
this.importer.importers.numbering.currentOldMultiLevelListIndex = this.multiLevelListIndex;
|
64886
|
+
this.importer.importers.numbering.currentOldSimpleListIndex = this.simpleListIndex;
|
64887
|
+
this.importer.importers.numbering.currentOldSimpleList = this.simpleList;
|
64888
|
+
}
|
64889
|
+
if (this.explicitListLevelIndex && this.explicitNumberingListIndex) {
|
64890
|
+
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.numberingListIndex = this.numberingListIndex;
|
64891
|
+
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.listLevelIndex = this.listLevelIndex;
|
64892
|
+
}
|
64893
|
+
else
|
64894
|
+
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.numberingListIndex = !this.skipNumbering ?
|
64895
|
+
actualNumberingListIndex : NumberingListIndexConstants.noNumberingList;
|
64896
|
+
}
|
64897
|
+
createNewList() {
|
64898
|
+
const oldListLevelInfo = this.importer.importers.numbering.oldListLevelInfo;
|
64899
|
+
if (this.simpleList) {
|
64900
|
+
this.createSimpleNumberingListLevels();
|
64901
|
+
this.simpleListIndex = this.importer.documentModel.numberingLists.length - 1;
|
64902
|
+
this.multiLevelListIndex = this.importer.importers.numbering.currentOldMultiLevelListIndex;
|
64903
|
+
}
|
64904
|
+
else if (oldListLevelInfo.listLevelProperties.format == NumberingFormat.Bullet) {
|
64905
|
+
this.createBulletedListLevels();
|
64906
|
+
this.multiLevelListIndex = this.importer.documentModel.numberingLists.length - 1;
|
64907
|
+
this.simpleListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
64908
|
+
}
|
64909
|
+
else {
|
64910
|
+
this.createMultilevelListLevels();
|
64911
|
+
this.multiLevelListIndex = this.importer.documentModel.numberingLists.length - 1;
|
64912
|
+
this.simpleListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
64913
|
+
}
|
64914
|
+
}
|
64915
|
+
createMultilevelListLevels() {
|
64916
|
+
const documentModel = this.importer.documentModel;
|
64917
|
+
const abstractNumberingList = new AbstractNumberingList(documentModel);
|
64918
|
+
documentModel.abstractNumberingLists.push(abstractNumberingList);
|
64919
|
+
for (let i = 0; i < abstractNumberingList.levels.length; i++) {
|
64920
|
+
const levelInfo = this.importer.importers.numbering.oldListLevelInfoCollection.getByIndex(i + 1);
|
64921
|
+
const level = abstractNumberingList.levels[i];
|
64922
|
+
const firstLineIndent = levelInfo.indent;
|
64923
|
+
const listLevelProperties = level.getListLevelProperties().clone();
|
64924
|
+
level.setListLevelProperties(listLevelProperties);
|
64925
|
+
this.setFirstLineIndent(abstractNumberingList.levels[i], firstLineIndent);
|
64926
|
+
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
64927
|
+
let formatString = `${levelInfo.textBefore}{${i}}${levelInfo.textAfter}`;
|
64928
|
+
if (i > 0 && levelInfo.includeInformationFromPreviousLevel)
|
64929
|
+
formatString = abstractNumberingList.levels[i - 1].getListLevelProperties().displayFormatString + formatString;
|
64930
|
+
this.setDisplayFormatString(level, formatString);
|
64931
|
+
this.setLegacyProperties(level, 0, 0);
|
64932
|
+
}
|
64933
|
+
this.isOldNumberingListCreated = true;
|
64934
|
+
documentModel.numberingLists.push(new NumberingList(documentModel, documentModel.abstractNumberingLists.length - 1));
|
64935
|
+
}
|
64936
|
+
createBulletedListLevels() {
|
64937
|
+
const documentModel = this.importer.documentModel;
|
64938
|
+
const levelOffset = unit_converter/* UnitConverter */.u.documentsToTwips(150);
|
64939
|
+
const abstractNumberingList = new AbstractNumberingList(documentModel);
|
64940
|
+
documentModel.abstractNumberingLists.push(abstractNumberingList);
|
64941
|
+
for (let i = 0; i < abstractNumberingList.levels.length; i++) {
|
64942
|
+
const level = abstractNumberingList.levels[i];
|
64943
|
+
const listLevelProperties = level.getListLevelProperties().clone();
|
64944
|
+
level.setListLevelProperties(listLevelProperties);
|
64945
|
+
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
64946
|
+
level.getListLevelProperties().format = NumberingFormat.Bullet;
|
64947
|
+
const firstLineIndent = levelOffset * i + this.importer.importers.paragraph.paragraphFormatting.coreProperties.firstLineIndent;
|
64948
|
+
this.setFirstLineIndent(level, firstLineIndent);
|
64949
|
+
this.setDisplayFormatString(level, this.importer.importers.numbering.oldListLevelInfo.textBefore + this.importer.importers.numbering.oldListLevelInfo.textAfter);
|
64950
|
+
this.setTemplateCode(level, NumberingHelper.generateNewTemplateCode(documentModel));
|
64951
|
+
this.setLegacyProperties(level, 0, 0);
|
64952
|
+
}
|
64953
|
+
this.isOldNumberingListCreated = true;
|
64954
|
+
documentModel.numberingLists.push(new NumberingList(documentModel, documentModel.abstractNumberingLists.length - 1));
|
64955
|
+
}
|
64956
|
+
createSimpleNumberingListLevels() {
|
64957
|
+
const documentModel = this.importer.documentModel;
|
64958
|
+
const addResult = this.shouldCreateNewAbstractSimpleList();
|
64959
|
+
const existingNumberingListIndex = addResult.existingNumberingListIndex;
|
64960
|
+
if (addResult.isSecceed) {
|
64961
|
+
const abstractNumberingList = new AbstractNumberingList(documentModel);
|
64962
|
+
documentModel.abstractNumberingLists.push(abstractNumberingList);
|
64963
|
+
for (let i = 0; i < abstractNumberingList.levels.length; i++) {
|
64964
|
+
const level = abstractNumberingList.levels[i];
|
64965
|
+
const listLevelProperties = level.getListLevelProperties().clone();
|
64966
|
+
level.setListLevelProperties(listLevelProperties);
|
64967
|
+
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
64968
|
+
const firstLineIndent = this.importer.importers.paragraph.paragraphFormatting.coreProperties.firstLineIndent + 150 * i;
|
64969
|
+
this.setFirstLineIndent(level, firstLineIndent);
|
64970
|
+
this.setDisplayFormatString(level, `${this.importer.importers.numbering.oldListLevelInfo.textBefore}{${i}}${this.importer.importers.numbering.oldListLevelInfo.textAfter}`);
|
64971
|
+
this.setTemplateCode(level, NumberingHelper.generateNewTemplateCode(documentModel));
|
64972
|
+
this.setLegacyProperties(level, 0, 0);
|
64973
|
+
const start = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.start;
|
64974
|
+
if (start > 0)
|
64975
|
+
level.getListLevelProperties().start = start;
|
64976
|
+
const numberingFormat = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.format;
|
64977
|
+
if (numberingFormat != NumberingFormat.Decimal)
|
64978
|
+
level.getListLevelProperties().format = numberingFormat;
|
64979
|
+
}
|
64980
|
+
this.isOldNumberingListCreated = true;
|
64981
|
+
documentModel.numberingLists.push(new NumberingList(documentModel, documentModel.abstractNumberingLists.length - 1));
|
64982
|
+
this.importer.importers.numbering.numberingListToOldListLevelInfoMap[documentModel.numberingLists.length - 1] = this.importer.importers.numbering.oldListLevelInfo.clone();
|
64983
|
+
}
|
64984
|
+
else {
|
64985
|
+
const abstractNumberingListIndex = documentModel.numberingLists[existingNumberingListIndex].abstractNumberingListIndex;
|
64986
|
+
const prevNumberingList = utils_list.ListUtils.last(documentModel.numberingLists);
|
64987
|
+
const newList = new NumberingList(documentModel, abstractNumberingListIndex);
|
64988
|
+
const level = newList.levels[0];
|
64989
|
+
const start = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.start;
|
64990
|
+
if (start >= 0)
|
64991
|
+
level.getListLevelProperties().start = start;
|
64992
|
+
const numberingFormat = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.format;
|
64993
|
+
if (numberingFormat != NumberingFormat.Decimal)
|
64994
|
+
level.getListLevelProperties().format = numberingFormat;
|
64995
|
+
if (prevNumberingList != null && prevNumberingList.levels[0].getListLevelProperties().format != level.getListLevelProperties().format)
|
64996
|
+
level.overrideStart = true;
|
64997
|
+
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
64998
|
+
const firstLineIndent = this.importer.importers.paragraph.paragraphFormatting.coreProperties.firstLineIndent;
|
64999
|
+
this.setFirstLineIndent(level, firstLineIndent);
|
65000
|
+
this.setDisplayFormatString(level, `${this.importer.importers.numbering.oldListLevelInfo.textBefore}{${0}}${this.importer.importers.numbering.oldListLevelInfo.textAfter}`);
|
65001
|
+
this.setTemplateCode(level, NumberingHelper.generateNewTemplateCode(documentModel));
|
65002
|
+
this.setLegacyProperties(level, 0, 0);
|
65003
|
+
documentModel.numberingLists.push(newList);
|
65004
|
+
this.importer.importers.numbering.numberingListToOldListLevelInfoMap[documentModel.numberingLists.length - 1] = this.importer.importers.numbering.oldListLevelInfo.clone();
|
65005
|
+
}
|
65006
|
+
}
|
65007
|
+
shouldCreateNewAbstractSimpleList() {
|
65008
|
+
let existingNumberingListIndex;
|
65009
|
+
if (this.importer.importers.numbering.currentOldSimpleList &&
|
65010
|
+
this.importer.importers.numbering.currentOldSimpleListIndex >= NumberingListIndexConstants.minValue) {
|
65011
|
+
existingNumberingListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
65012
|
+
let oldListLevelInfo = this.importer.importers.numbering.numberingListToOldListLevelInfoMap[existingNumberingListIndex];
|
65013
|
+
if (!oldListLevelInfo)
|
65014
|
+
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65015
|
+
return { isSecceed: !this.areSameInfo(oldListLevelInfo, this.importer.importers.numbering.oldListLevelInfo), existingNumberingListIndex: existingNumberingListIndex };
|
65016
|
+
}
|
65017
|
+
existingNumberingListIndex = NumberingListIndexConstants.listIndexNotSetted;
|
65018
|
+
let prevParagraphIndex = this.importer.subDocument.paragraphs.length - 1 - 1;
|
65019
|
+
for (; prevParagraphIndex >= 0; prevParagraphIndex--) {
|
65020
|
+
const prevParagraph = this.importer.subDocument.paragraphs[prevParagraphIndex];
|
65021
|
+
if (!prevParagraph.isInList()) {
|
65022
|
+
if (prevParagraph.numberingListIndex == NumberingListIndexConstants.noNumberingList)
|
65023
|
+
continue;
|
65024
|
+
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65025
|
+
}
|
65026
|
+
const numberingListIndex = prevParagraph.numberingListIndex;
|
65027
|
+
const prevOldListLevelInfo = this.importer.importers.numbering.numberingListToOldListLevelInfoMap[numberingListIndex];
|
65028
|
+
if (!prevOldListLevelInfo)
|
65029
|
+
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65030
|
+
if (!this.areSameInfo(prevOldListLevelInfo, this.importer.importers.numbering.oldListLevelInfo))
|
65031
|
+
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65032
|
+
existingNumberingListIndex = numberingListIndex;
|
65033
|
+
return { isSecceed: false, existingNumberingListIndex: existingNumberingListIndex };
|
65034
|
+
}
|
65035
|
+
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65036
|
+
}
|
65037
|
+
setLegacyProperties(level, legacyIndent, legacySpace) {
|
65038
|
+
level.getListLevelProperties().legacy = true;
|
65039
|
+
level.getListLevelProperties().legacySpace = legacyIndent;
|
65040
|
+
level.getListLevelProperties().legacyIndent = legacySpace;
|
65041
|
+
}
|
65042
|
+
setDisplayFormatString(level, displayFormatString) {
|
65043
|
+
level.getListLevelProperties().displayFormatString = displayFormatString;
|
65044
|
+
}
|
65045
|
+
setFirstLineIndent(level, lineIndent) {
|
65046
|
+
level.getParagraphProperties().leftIndent = lineIndent;
|
65047
|
+
}
|
65048
|
+
setTemplateCode(level, templateCode) {
|
65049
|
+
level.getListLevelProperties().templateCode = templateCode;
|
65050
|
+
}
|
65051
|
+
shouldCreateNewList() {
|
65052
|
+
if (this.isNewListLevelInfoPresent())
|
65053
|
+
return false;
|
65054
|
+
if (this.isMultilevelList())
|
65055
|
+
return (!this.sectionMultiLevelListCreated());
|
65056
|
+
if (this.isSimpleList())
|
65057
|
+
return true;
|
65058
|
+
if (this.isSkipNumbering())
|
65059
|
+
return false;
|
65060
|
+
return true;
|
65061
|
+
}
|
65062
|
+
isNewListLevelInfoPresent() {
|
65063
|
+
if (this.explicitListLevelIndex && this.explicitNumberingListIndex)
|
65064
|
+
return true;
|
65065
|
+
if (this.isSimpleList()) {
|
65066
|
+
if (this.simpleListIndex < NumberingListIndexConstants.minValue)
|
65067
|
+
return false;
|
65068
|
+
const existingListLevelInfo = this.importer.importers.numbering.numberingListToOldListLevelInfoMap[this.simpleListIndex];
|
65069
|
+
if (!existingListLevelInfo)
|
65070
|
+
return false;
|
65071
|
+
return this.areSameInfo(existingListLevelInfo, this.importer.importers.numbering.oldListLevelInfo);
|
65072
|
+
}
|
65073
|
+
else
|
65074
|
+
return this.multiLevelListIndex >= NumberingListIndexConstants.minValue;
|
65075
|
+
}
|
65076
|
+
areSameInfo(existingListLevelInfo, rtfOldListLevelInfo) {
|
65077
|
+
return existingListLevelInfo.textAfter === rtfOldListLevelInfo.textAfter
|
65078
|
+
&& existingListLevelInfo.textBefore === rtfOldListLevelInfo.textBefore
|
65079
|
+
&& existingListLevelInfo.listLevelProperties.format === rtfOldListLevelInfo.listLevelProperties.format;
|
65080
|
+
}
|
65081
|
+
isSimpleList() {
|
65082
|
+
return this.simpleList;
|
65083
|
+
}
|
65084
|
+
isMultilevelList() {
|
65085
|
+
return (this.oldLevelNumber >= 0) && !this.simpleList;
|
65086
|
+
}
|
65087
|
+
sectionMultiLevelListCreated() {
|
65088
|
+
return this.importer.importers.numbering.currentOldMultiLevelListIndex >= NumberingListIndexConstants.minValue;
|
65089
|
+
}
|
65090
|
+
isSkipNumbering() {
|
65091
|
+
return this.importer.importers.numbering.oldListLevelInfo.skipNumbering;
|
65092
|
+
}
|
65093
|
+
}
|
65094
|
+
|
64759
65095
|
;// CONCATENATED MODULE: ./src/common/formats/rtf/import/keyword-tables/paragraph-numbering-desc-keywords.ts
|
64760
65096
|
|
64761
65097
|
|
64762
65098
|
|
65099
|
+
|
64763
65100
|
const paragraphNumberingDescKeywords = new MapCreator()
|
64764
65101
|
.add("pncard", DestinationOldParagraphNumberingBase.onCardinalKeyword)
|
64765
65102
|
.add("pndec", DestinationOldParagraphNumberingBase.onDecimalKeyword)
|
@@ -64800,6 +65137,8 @@ const paragraphNumberingDescKeywords = new MapCreator()
|
|
64800
65137
|
.add("pnqr", DestinationOldParagraphNumberingBase.onRightAlignmentKeyword)
|
64801
65138
|
.add("pntxtb", DestinationOldParagraphNumberingBase.onTextBeforeKeyword)
|
64802
65139
|
.add("pntxta", DestinationOldParagraphNumberingBase.onTextAfterKeyword)
|
65140
|
+
.add("pnlvlbody", DestinationOldParagraphNumbering.onSimpleNumberingKeyword)
|
65141
|
+
.add("pnlvlblt", DestinationOldParagraphNumbering.onBulletedParagraphKeyword)
|
64803
65142
|
.get();
|
64804
65143
|
|
64805
65144
|
;// CONCATENATED MODULE: ./src/common/formats/rtf/import/keyword-tables/paragraph-properties.ts
|
@@ -65073,283 +65412,6 @@ class DocumentVariableDestination extends StringValueDestination {
|
|
65073
65412
|
}
|
65074
65413
|
}
|
65075
65414
|
|
65076
|
-
;// CONCATENATED MODULE: ./src/common/formats/rtf/import/destination/numbering-list/destination-old-paragraph-numbering.ts
|
65077
|
-
|
65078
|
-
|
65079
|
-
|
65080
|
-
|
65081
|
-
|
65082
|
-
|
65083
|
-
|
65084
|
-
|
65085
|
-
|
65086
|
-
class DestinationOldParagraphNumbering extends DestinationOldParagraphNumberingBase {
|
65087
|
-
constructor(importer) {
|
65088
|
-
super(importer);
|
65089
|
-
this.oldLevelNumber = -1;
|
65090
|
-
if (importer.importers.numbering.oldListLevelInfo == null)
|
65091
|
-
importer.importers.numbering.oldListLevelInfo = new RtfOldListLevelInfo();
|
65092
|
-
importer.importers.character.characterFormatting.coreProperties.setAllUse();
|
65093
|
-
this.multiLevelListIndex = NumberingListIndexConstants.listIndexNotSetted;
|
65094
|
-
this.simpleListIndex = NumberingListIndexConstants.listIndexNotSetted;
|
65095
|
-
}
|
65096
|
-
get destinationType() { return DestinationType.DestinationOldParagraphNumbering; }
|
65097
|
-
static onParagraphLevelKeyword(importer, parameterValue, hasParameter) {
|
65098
|
-
if (hasParameter && parameterValue == 10) {
|
65099
|
-
DestinationOldParagraphNumbering.onSimpleNumberingKeyword(importer, 0, false);
|
65100
|
-
return;
|
65101
|
-
}
|
65102
|
-
importer.destination.oldLevelNumber = parameterValue;
|
65103
|
-
importer.destination.simpleList = false;
|
65104
|
-
}
|
65105
|
-
static onBulletedParagraphKeyword(importer, _parameterValue, _hasParameter) {
|
65106
|
-
importer.importers.numbering.oldListLevelInfo.listLevelProperties.format = NumberingFormat.Bullet;
|
65107
|
-
}
|
65108
|
-
static onSimpleNumberingKeyword(importer, _parameterValue, _hasParameter) {
|
65109
|
-
importer.destination.simpleList = true;
|
65110
|
-
}
|
65111
|
-
static onSkipNumberingKeyword(importer, _parameterValue, _hasParameter) {
|
65112
|
-
importer.importers.numbering.oldListLevelInfo.skipNumbering = true;
|
65113
|
-
}
|
65114
|
-
static onListOverrideKeyword(importer, parameterValue, _hasParameter) {
|
65115
|
-
const index = importer.importers.numbering.listOverrideIndexToNumberingListIndexMap[parameterValue];
|
65116
|
-
if (index !== undefined)
|
65117
|
-
importer.importers.paragraph.paragraphFormatting.paragraphListInfo.numberingListIndex = index;
|
65118
|
-
importer.destination.explicitNumberingListIndex = true;
|
65119
|
-
}
|
65120
|
-
static onListLevelKeyword(importer, parameterValue, _hasParameter) {
|
65121
|
-
importer.importers.paragraph.paragraphFormatting.paragraphListInfo.listLevelIndex = parameterValue;
|
65122
|
-
importer.destination.explicitListLevelIndex = true;
|
65123
|
-
}
|
65124
|
-
createClone() {
|
65125
|
-
const result = new DestinationOldParagraphNumbering(this.importer);
|
65126
|
-
return result;
|
65127
|
-
}
|
65128
|
-
beforePopRtfState() {
|
65129
|
-
super.beforePopRtfState();
|
65130
|
-
if (this.shouldCreateNewList()) {
|
65131
|
-
this.createNewList();
|
65132
|
-
}
|
65133
|
-
else {
|
65134
|
-
this.skipNumbering = this.isSkipNumbering();
|
65135
|
-
this.simpleListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
65136
|
-
this.multiLevelListIndex = this.importer.importers.numbering.currentOldMultiLevelListIndex;
|
65137
|
-
}
|
65138
|
-
if (this.explicitNumberingListIndex && this.explicitListLevelIndex) {
|
65139
|
-
this.listLevelIndex = this.importer.importers.paragraph.paragraphFormatting.listLevelIndex;
|
65140
|
-
this.numberingListIndex = this.importer.importers.paragraph.paragraphFormatting.numberingListIndex;
|
65141
|
-
}
|
65142
|
-
else
|
65143
|
-
this.listLevelIndex = this.oldLevelNumber >= 0 ? this.oldLevelNumber - 1 : 0;
|
65144
|
-
}
|
65145
|
-
afterPopRtfState() {
|
65146
|
-
super.afterPopRtfState();
|
65147
|
-
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.listLevelIndex = this.listLevelIndex;
|
65148
|
-
const actualNumberingListIndex = this.isSimpleList() ? this.simpleListIndex : this.multiLevelListIndex;
|
65149
|
-
this.importer.importers.numbering.currentOldListSkipNumbering = this.skipNumbering;
|
65150
|
-
if (this.isOldNumberingListCreated) {
|
65151
|
-
this.importer.importers.numbering.currentOldMultiLevelListIndex = this.multiLevelListIndex;
|
65152
|
-
this.importer.importers.numbering.currentOldSimpleListIndex = this.simpleListIndex;
|
65153
|
-
this.importer.importers.numbering.currentOldSimpleList = this.simpleList;
|
65154
|
-
}
|
65155
|
-
if (this.explicitListLevelIndex && this.explicitNumberingListIndex) {
|
65156
|
-
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.numberingListIndex = this.numberingListIndex;
|
65157
|
-
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.listLevelIndex = this.listLevelIndex;
|
65158
|
-
}
|
65159
|
-
else
|
65160
|
-
this.importer.importers.paragraph.paragraphFormatting.paragraphListInfo.numberingListIndex = !this.skipNumbering ?
|
65161
|
-
actualNumberingListIndex : NumberingListIndexConstants.noNumberingList;
|
65162
|
-
}
|
65163
|
-
createNewList() {
|
65164
|
-
const oldListLevelInfo = this.importer.importers.numbering.oldListLevelInfo;
|
65165
|
-
if (this.simpleList) {
|
65166
|
-
this.createSimpleNumberingListLevels();
|
65167
|
-
this.simpleListIndex = this.importer.documentModel.numberingLists.length - 1;
|
65168
|
-
this.multiLevelListIndex = this.importer.importers.numbering.currentOldMultiLevelListIndex;
|
65169
|
-
}
|
65170
|
-
else if (oldListLevelInfo.listLevelProperties.format == NumberingFormat.Bullet) {
|
65171
|
-
this.createBulletedListLevels();
|
65172
|
-
this.multiLevelListIndex = this.importer.documentModel.numberingLists.length - 1;
|
65173
|
-
this.simpleListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
65174
|
-
}
|
65175
|
-
else {
|
65176
|
-
this.createMultilevelListLevels();
|
65177
|
-
this.multiLevelListIndex = this.importer.documentModel.numberingLists.length - 1;
|
65178
|
-
this.simpleListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
65179
|
-
}
|
65180
|
-
}
|
65181
|
-
createMultilevelListLevels() {
|
65182
|
-
const documentModel = this.importer.documentModel;
|
65183
|
-
const abstractNumberingList = new AbstractNumberingList(documentModel);
|
65184
|
-
documentModel.abstractNumberingLists.push(abstractNumberingList);
|
65185
|
-
for (let i = 0; i < abstractNumberingList.levels.length; i++) {
|
65186
|
-
const levelInfo = this.importer.importers.numbering.oldListLevelInfoCollection.getByIndex(i + 1);
|
65187
|
-
const level = abstractNumberingList.levels[i];
|
65188
|
-
const firstLineIndent = levelInfo.indent;
|
65189
|
-
this.setFirstLineIndent(abstractNumberingList.levels[i], firstLineIndent);
|
65190
|
-
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
65191
|
-
let formatString = `${levelInfo.textBefore}{${i}}${levelInfo.textAfter}`;
|
65192
|
-
if (i > 0 && levelInfo.includeInformationFromPreviousLevel)
|
65193
|
-
formatString = abstractNumberingList.levels[i - 1].getListLevelProperties().displayFormatString + formatString;
|
65194
|
-
this.setDisplayFormatString(level, formatString);
|
65195
|
-
this.setLegacyProperties(level, 0, 0);
|
65196
|
-
}
|
65197
|
-
this.isOldNumberingListCreated = true;
|
65198
|
-
documentModel.numberingLists.push(new NumberingList(documentModel, documentModel.abstractNumberingLists.length - 1));
|
65199
|
-
}
|
65200
|
-
createBulletedListLevels() {
|
65201
|
-
const documentModel = this.importer.documentModel;
|
65202
|
-
const levelOffset = unit_converter/* UnitConverter */.u.documentsToTwips(150);
|
65203
|
-
const abstractNumberingList = new AbstractNumberingList(documentModel);
|
65204
|
-
documentModel.abstractNumberingLists.push(abstractNumberingList);
|
65205
|
-
for (let i = 0; i < abstractNumberingList.levels.length; i++) {
|
65206
|
-
const level = abstractNumberingList.levels[i];
|
65207
|
-
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
65208
|
-
level.getListLevelProperties().format = NumberingFormat.Bullet;
|
65209
|
-
const firstLineIndent = levelOffset * i + this.importer.importers.paragraph.paragraphFormatting.coreProperties.firstLineIndent;
|
65210
|
-
this.setFirstLineIndent(level, firstLineIndent);
|
65211
|
-
this.setDisplayFormatString(level, this.importer.importers.numbering.oldListLevelInfo.textBefore + this.importer.importers.numbering.oldListLevelInfo.textAfter);
|
65212
|
-
this.setTemplateCode(level, NumberingHelper.generateNewTemplateCode(documentModel));
|
65213
|
-
this.setLegacyProperties(level, 0, 0);
|
65214
|
-
}
|
65215
|
-
this.isOldNumberingListCreated = true;
|
65216
|
-
documentModel.numberingLists.push(new NumberingList(documentModel, documentModel.abstractNumberingLists.length - 1));
|
65217
|
-
}
|
65218
|
-
createSimpleNumberingListLevels() {
|
65219
|
-
const documentModel = this.importer.documentModel;
|
65220
|
-
const addResult = this.shouldCreateNewAbstractSimpleList();
|
65221
|
-
const existingNumberingListIndex = addResult.existingNumberingListIndex;
|
65222
|
-
if (addResult.isSecceed) {
|
65223
|
-
const abstractNumberingList = new AbstractNumberingList(documentModel);
|
65224
|
-
documentModel.abstractNumberingLists.push(abstractNumberingList);
|
65225
|
-
for (let i = 0; i < abstractNumberingList.levels.length; i++) {
|
65226
|
-
const level = abstractNumberingList.levels[i];
|
65227
|
-
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
65228
|
-
const firstLineIndent = this.importer.importers.paragraph.paragraphFormatting.coreProperties.firstLineIndent + 150 * i;
|
65229
|
-
this.setFirstLineIndent(level, firstLineIndent);
|
65230
|
-
this.setDisplayFormatString(level, `${this.importer.importers.numbering.oldListLevelInfo.textBefore}{${i}}${this.importer.importers.numbering.oldListLevelInfo.textAfter}`);
|
65231
|
-
this.setTemplateCode(level, NumberingHelper.generateNewTemplateCode(documentModel));
|
65232
|
-
this.setLegacyProperties(level, 0, 0);
|
65233
|
-
const start = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.start;
|
65234
|
-
if (start > 0)
|
65235
|
-
level.getListLevelProperties().start = start;
|
65236
|
-
const numberingFormat = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.format;
|
65237
|
-
if (numberingFormat != NumberingFormat.Decimal)
|
65238
|
-
level.getListLevelProperties().format = numberingFormat;
|
65239
|
-
}
|
65240
|
-
this.isOldNumberingListCreated = true;
|
65241
|
-
documentModel.numberingLists.push(new NumberingList(documentModel, documentModel.abstractNumberingLists.length - 1));
|
65242
|
-
this.importer.importers.numbering.numberingListToOldListLevelInfoMap[documentModel.numberingLists.length - 1] = this.importer.importers.numbering.oldListLevelInfo.clone();
|
65243
|
-
}
|
65244
|
-
else {
|
65245
|
-
const abstractNumberingListIndex = documentModel.numberingLists[existingNumberingListIndex].abstractNumberingListIndex;
|
65246
|
-
const prevNumberingList = utils_list.ListUtils.last(documentModel.numberingLists);
|
65247
|
-
const newList = new NumberingList(documentModel, abstractNumberingListIndex);
|
65248
|
-
const level = newList.levels[0];
|
65249
|
-
const start = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.start;
|
65250
|
-
if (start >= 0)
|
65251
|
-
level.getListLevelProperties().start = start;
|
65252
|
-
const numberingFormat = this.importer.importers.numbering.oldListLevelInfo.listLevelProperties.format;
|
65253
|
-
if (numberingFormat != NumberingFormat.Decimal)
|
65254
|
-
level.getListLevelProperties().format = numberingFormat;
|
65255
|
-
if (prevNumberingList != null && prevNumberingList.levels[0].getListLevelProperties().format != level.getListLevelProperties().format)
|
65256
|
-
level.overrideStart = true;
|
65257
|
-
level.getCharacterProperties().copyFrom(this.importer.importers.character.characterFormatting.coreProperties);
|
65258
|
-
const firstLineIndent = this.importer.importers.paragraph.paragraphFormatting.coreProperties.firstLineIndent;
|
65259
|
-
this.setFirstLineIndent(level, firstLineIndent);
|
65260
|
-
this.setDisplayFormatString(level, `${this.importer.importers.numbering.oldListLevelInfo.textBefore}{${0}}${this.importer.importers.numbering.oldListLevelInfo.textAfter}`);
|
65261
|
-
this.setTemplateCode(level, NumberingHelper.generateNewTemplateCode(documentModel));
|
65262
|
-
this.setLegacyProperties(level, 0, 0);
|
65263
|
-
documentModel.numberingLists.push(newList);
|
65264
|
-
this.importer.importers.numbering.numberingListToOldListLevelInfoMap[documentModel.numberingLists.length - 1] = this.importer.importers.numbering.oldListLevelInfo.clone();
|
65265
|
-
}
|
65266
|
-
}
|
65267
|
-
shouldCreateNewAbstractSimpleList() {
|
65268
|
-
let existingNumberingListIndex;
|
65269
|
-
if (this.importer.importers.numbering.currentOldSimpleList &&
|
65270
|
-
this.importer.importers.numbering.currentOldSimpleListIndex >= NumberingListIndexConstants.minValue) {
|
65271
|
-
existingNumberingListIndex = this.importer.importers.numbering.currentOldSimpleListIndex;
|
65272
|
-
let oldListLevelInfo = this.importer.importers.numbering.numberingListToOldListLevelInfoMap[existingNumberingListIndex];
|
65273
|
-
if (!oldListLevelInfo)
|
65274
|
-
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65275
|
-
return { isSecceed: !this.areSameInfo(oldListLevelInfo, this.importer.importers.numbering.oldListLevelInfo), existingNumberingListIndex: existingNumberingListIndex };
|
65276
|
-
}
|
65277
|
-
existingNumberingListIndex = NumberingListIndexConstants.listIndexNotSetted;
|
65278
|
-
let prevParagraphIndex = this.importer.subDocument.paragraphs.length - 1 - 1;
|
65279
|
-
for (; prevParagraphIndex >= 0; prevParagraphIndex--) {
|
65280
|
-
const prevParagraph = this.importer.subDocument.paragraphs[prevParagraphIndex];
|
65281
|
-
if (!prevParagraph.isInList()) {
|
65282
|
-
if (prevParagraph.numberingListIndex == NumberingListIndexConstants.noNumberingList)
|
65283
|
-
continue;
|
65284
|
-
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65285
|
-
}
|
65286
|
-
const numberingListIndex = prevParagraph.numberingListIndex;
|
65287
|
-
const prevOldListLevelInfo = this.importer.importers.numbering.numberingListToOldListLevelInfoMap[numberingListIndex];
|
65288
|
-
if (!prevOldListLevelInfo)
|
65289
|
-
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65290
|
-
if (!this.areSameInfo(prevOldListLevelInfo, this.importer.importers.numbering.oldListLevelInfo))
|
65291
|
-
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65292
|
-
existingNumberingListIndex = numberingListIndex;
|
65293
|
-
return { isSecceed: false, existingNumberingListIndex: existingNumberingListIndex };
|
65294
|
-
}
|
65295
|
-
return { isSecceed: true, existingNumberingListIndex: existingNumberingListIndex };
|
65296
|
-
}
|
65297
|
-
setLegacyProperties(level, legacyIndent, legacySpace) {
|
65298
|
-
level.getListLevelProperties().legacy = true;
|
65299
|
-
level.getListLevelProperties().legacySpace = legacyIndent;
|
65300
|
-
level.getListLevelProperties().legacyIndent = legacySpace;
|
65301
|
-
}
|
65302
|
-
setDisplayFormatString(level, displayFormatString) {
|
65303
|
-
level.getListLevelProperties().displayFormatString = displayFormatString;
|
65304
|
-
}
|
65305
|
-
setFirstLineIndent(level, lineIndent) {
|
65306
|
-
level.getParagraphProperties().leftIndent = lineIndent;
|
65307
|
-
}
|
65308
|
-
setTemplateCode(level, templateCode) {
|
65309
|
-
level.getListLevelProperties().templateCode = templateCode;
|
65310
|
-
}
|
65311
|
-
shouldCreateNewList() {
|
65312
|
-
if (this.isNewListLevelInfoPresent())
|
65313
|
-
return false;
|
65314
|
-
if (this.isMultilevelList())
|
65315
|
-
return (!this.sectionMultiLevelListCreated());
|
65316
|
-
if (this.isSimpleList())
|
65317
|
-
return true;
|
65318
|
-
if (this.isSkipNumbering())
|
65319
|
-
return false;
|
65320
|
-
return true;
|
65321
|
-
}
|
65322
|
-
isNewListLevelInfoPresent() {
|
65323
|
-
if (this.explicitListLevelIndex && this.explicitNumberingListIndex)
|
65324
|
-
return true;
|
65325
|
-
if (this.isSimpleList()) {
|
65326
|
-
if (this.simpleListIndex < NumberingListIndexConstants.minValue)
|
65327
|
-
return false;
|
65328
|
-
const existingListLevelInfo = this.importer.importers.numbering.numberingListToOldListLevelInfoMap[this.simpleListIndex];
|
65329
|
-
if (!existingListLevelInfo)
|
65330
|
-
return false;
|
65331
|
-
return this.areSameInfo(existingListLevelInfo, this.importer.importers.numbering.oldListLevelInfo);
|
65332
|
-
}
|
65333
|
-
else
|
65334
|
-
return this.multiLevelListIndex >= NumberingListIndexConstants.minValue;
|
65335
|
-
}
|
65336
|
-
areSameInfo(existingListLevelInfo, rtfOldListLevelInfo) {
|
65337
|
-
return existingListLevelInfo.textAfter == rtfOldListLevelInfo.textAfter && existingListLevelInfo.textBefore == rtfOldListLevelInfo.textBefore;
|
65338
|
-
}
|
65339
|
-
isSimpleList() {
|
65340
|
-
return this.simpleList;
|
65341
|
-
}
|
65342
|
-
isMultilevelList() {
|
65343
|
-
return (this.oldLevelNumber >= 0) && !this.simpleList;
|
65344
|
-
}
|
65345
|
-
sectionMultiLevelListCreated() {
|
65346
|
-
return this.importer.importers.numbering.currentOldMultiLevelListIndex >= NumberingListIndexConstants.minValue;
|
65347
|
-
}
|
65348
|
-
isSkipNumbering() {
|
65349
|
-
return this.importer.importers.numbering.oldListLevelInfo.skipNumbering;
|
65350
|
-
}
|
65351
|
-
}
|
65352
|
-
|
65353
65415
|
;// CONCATENATED MODULE: ./src/common/formats/rtf/import/destination/numbering-list/destination-old-section-numbering-level.ts
|
65354
65416
|
|
65355
65417
|
|
@@ -66314,6 +66376,7 @@ class KeywordTableHolder {
|
|
66314
66376
|
.append(characterPropertiesKeywords)
|
66315
66377
|
.get())
|
66316
66378
|
.add(DestinationType.DestinationOldSectionNumberingLevel, paragraphNumberingDescKeywords)
|
66379
|
+
.add(DestinationType.DestinationOldParagraphNumbering, paragraphNumberingDescKeywords)
|
66317
66380
|
.add(DestinationType.InfoDestination, new MapCreator()
|
66318
66381
|
.add("password", InfoDestination.onLegacyPasswordHash)
|
66319
66382
|
.add("passwordhash", InfoDestination.onPasswordHash)
|
@@ -68259,6 +68322,9 @@ class HtmlLiTagImporter extends HtmlTagImporterBase {
|
|
68259
68322
|
|
68260
68323
|
|
68261
68324
|
|
68325
|
+
|
68326
|
+
|
68327
|
+
|
68262
68328
|
class HtmlImportUtils {
|
68263
68329
|
static getTableWidthUnit(stringValue) {
|
68264
68330
|
if (!stringValue)
|
@@ -68270,7 +68336,7 @@ class HtmlImportUtils {
|
|
68270
68336
|
return null;
|
68271
68337
|
switch (unitType) {
|
68272
68338
|
case "%":
|
68273
|
-
return new TableWidthUnit().init(numberValue * TableWidthUnit.
|
68339
|
+
return new TableWidthUnit().init(numberValue * TableWidthUnit.MULTIPLIER_FOR_PERCENTS, TableWidthUnitType.FiftiethsOfPercent);
|
68274
68340
|
case "px":
|
68275
68341
|
return new TableWidthUnit().init(unit_converter/* UnitConverter */.u.pixelsToTwips(numberValue), TableWidthUnitType.ModelUnits);
|
68276
68342
|
case "in":
|
@@ -68326,8 +68392,54 @@ class HtmlImportUtils {
|
|
68326
68392
|
HtmlImportUtils.importBorder(colorProvider, props, borders, leftMask, (brds, brd) => brds.left = brd, style.borderLeftWidth, style.borderLeftStyle, style.borderLeftColor);
|
68327
68393
|
}
|
68328
68394
|
static getPropertyByMap(map, elementBy, defaultValue) {
|
68329
|
-
const
|
68330
|
-
return
|
68395
|
+
const mappedElement = map[elementBy];
|
68396
|
+
return mappedElement !== undefined ? mappedElement : defaultValue;
|
68397
|
+
}
|
68398
|
+
static getLineSpacing(value, lineHeightRule = '') {
|
68399
|
+
if (value.toLowerCase() === 'normal')
|
68400
|
+
return LineSpacingUnit.createSingle();
|
68401
|
+
if (/^\d+(\.\d+)?$/.test(value)) {
|
68402
|
+
const numberValue = parseFloat(value);
|
68403
|
+
switch (numberValue) {
|
68404
|
+
case 1:
|
68405
|
+
return LineSpacingUnit.createSingle();
|
68406
|
+
case 1.5:
|
68407
|
+
return LineSpacingUnit.createSesquialteral();
|
68408
|
+
case 2:
|
68409
|
+
return LineSpacingUnit.createDouble();
|
68410
|
+
default:
|
68411
|
+
return LineSpacingUnit.createMultiple(numberValue);
|
68412
|
+
}
|
68413
|
+
}
|
68414
|
+
const height = HtmlImportUtils.getTableWidthUnit(value);
|
68415
|
+
if (height == null)
|
68416
|
+
return HtmlImportUtils.getLineSpacingAsMultiple(parseFloat(value));
|
68417
|
+
switch (height.type) {
|
68418
|
+
case TableWidthUnitType.FiftiethsOfPercent:
|
68419
|
+
return this.getLineSpacingAsMultiple(height.value / TableWidthUnit.MAX_PERCENT_WIDTH);
|
68420
|
+
case TableWidthUnitType.ModelUnits:
|
68421
|
+
if (lineHeightRule === 'exactly')
|
68422
|
+
return LineSpacingUnit.createExactly(height.value);
|
68423
|
+
else
|
68424
|
+
return LineSpacingUnit.createAtLeast(height.value);
|
68425
|
+
case TableWidthUnitType.Nil:
|
68426
|
+
case TableWidthUnitType.Auto:
|
68427
|
+
return LineSpacingUnit.createSingle();
|
68428
|
+
default:
|
68429
|
+
throw new Error(errors/* Errors */.D.InternalException);
|
68430
|
+
}
|
68431
|
+
}
|
68432
|
+
static getLineSpacingAsMultiple(multipleValue) {
|
68433
|
+
if (!multipleValue || isNaN(multipleValue))
|
68434
|
+
return LineSpacingUnit.createSingle();
|
68435
|
+
if (math.MathUtils.numberCloseTo(multipleValue, 1))
|
68436
|
+
return LineSpacingUnit.createSingle();
|
68437
|
+
else if (math.MathUtils.numberCloseTo(multipleValue, 1.5))
|
68438
|
+
return LineSpacingUnit.createSesquialteral();
|
68439
|
+
else if (math.MathUtils.numberCloseTo(multipleValue, 2))
|
68440
|
+
return LineSpacingUnit.createDouble();
|
68441
|
+
else
|
68442
|
+
return LineSpacingUnit.createMultiple(multipleValue);
|
68331
68443
|
}
|
68332
68444
|
}
|
68333
68445
|
HtmlImportUtils.MapBorderStyleToType = new MapCreator()
|
@@ -68786,7 +68898,7 @@ class HtmlTableTagImporter extends HtmlTagImporterBase {
|
|
68786
68898
|
if (!(tbl.width.type == TableWidthUnitType.ModelUnits && tbl.width.value > 0))
|
68787
68899
|
if (!utils_list.ListUtils.unsafeAnyOf(this.rows, (row) => utils_list.ListUtils.unsafeAnyOf(row.cells, (cell) => cell.preferredWidth.type == TableWidthUnitType.ModelUnits && cell.preferredWidth.value > 0))) {
|
68788
68900
|
tbl.width.type = TableWidthUnitType.FiftiethsOfPercent;
|
68789
|
-
tbl.width.value = 100 * TableWidthUnit.
|
68901
|
+
tbl.width.value = 100 * TableWidthUnit.MULTIPLIER_FOR_PERCENTS;
|
68790
68902
|
}
|
68791
68903
|
this.importer.importedTablesInfo.push(tbl);
|
68792
68904
|
}
|
@@ -69358,11 +69470,8 @@ class HtmlImporterMaskedCharacterProperties {
|
|
69358
69470
|
|
69359
69471
|
|
69360
69472
|
|
69361
|
-
|
69362
|
-
|
69363
|
-
|
69364
69473
|
class HtmlImporterMaskedParagraphProperties {
|
69365
|
-
import(colorProvider, element, isTableCellTag) {
|
69474
|
+
import(colorProvider, element, isTableCellTag = false) {
|
69366
69475
|
this.result = new MaskedParagraphProperties();
|
69367
69476
|
this.element = element;
|
69368
69477
|
this.elementStyle = element.style;
|
@@ -69443,36 +69552,10 @@ class HtmlImporterMaskedParagraphProperties {
|
|
69443
69552
|
this.result.setUseValue(ParagraphPropertiesMask.UseBeforeAutoSpacing, true);
|
69444
69553
|
this.result.setUseValue(ParagraphPropertiesMask.UseAfterAutoSpacing, true);
|
69445
69554
|
const stringLineHeight = this.elementStyle.lineHeight;
|
69446
|
-
const
|
69447
|
-
|
69448
|
-
|
69449
|
-
|
69450
|
-
}
|
69451
|
-
switch (height.type) {
|
69452
|
-
case TableWidthUnitType.FiftiethsOfPercent:
|
69453
|
-
this.setSpacingAsMultiple(height.value / TableWidthUnit.MAX_PERCENT_WIDTH);
|
69454
|
-
break;
|
69455
|
-
case TableWidthUnitType.ModelUnits:
|
69456
|
-
this.result.lineSpacing = height.value;
|
69457
|
-
this.result.lineSpacingType = this.elementStyle["mso-line-height-rule"] == "exactly" ?
|
69458
|
-
ParagraphLineSpacingType.Exactly :
|
69459
|
-
ParagraphLineSpacingType.AtLeast;
|
69460
|
-
break;
|
69461
|
-
case TableWidthUnitType.Nil:
|
69462
|
-
case TableWidthUnitType.Auto:
|
69463
|
-
break;
|
69464
|
-
default: throw new Error(errors/* Errors */.D.InternalException);
|
69465
|
-
}
|
69466
|
-
}
|
69467
|
-
setSpacingAsMultiple(multipleValue) {
|
69468
|
-
if (!multipleValue || isNaN(multipleValue))
|
69469
|
-
return;
|
69470
|
-
this.result.lineSpacing = multipleValue;
|
69471
|
-
this.result.lineSpacingType =
|
69472
|
-
math.MathUtils.numberCloseTo(multipleValue, 1.5) ? ParagraphLineSpacingType.Sesquialteral :
|
69473
|
-
(math.MathUtils.numberCloseTo(multipleValue, 2) ? ParagraphLineSpacingType.Double :
|
69474
|
-
(math.MathUtils.numberCloseTo(multipleValue, 1) ? ParagraphLineSpacingType.Single :
|
69475
|
-
ParagraphLineSpacingType.Multiple));
|
69555
|
+
const lineHeightRule = this.elementStyle["mso-line-height-rule"];
|
69556
|
+
const lineSpacing = HtmlImportUtils.getLineSpacing(stringLineHeight, lineHeightRule);
|
69557
|
+
this.result.lineSpacing = lineSpacing.value;
|
69558
|
+
this.result.lineSpacingType = lineSpacing.type;
|
69476
69559
|
}
|
69477
69560
|
importTopBorder(colorProvider, calculatedStyle) {
|
69478
69561
|
const borderTopInfo = HtmlImportUtils.getBorderInfo(colorProvider, calculatedStyle.borderTopWidth, calculatedStyle.borderTopStyle, calculatedStyle.borderTopColor);
|
@@ -143634,7 +143717,6 @@ class FullScreenHelper {
|
|
143634
143717
|
|
143635
143718
|
;// CONCATENATED MODULE: external "DevExpress.config"
|
143636
143719
|
var external_DevExpress_config_namespaceObject = DevExpress.config;
|
143637
|
-
var external_DevExpress_config_default = /*#__PURE__*/__webpack_require__.n(external_DevExpress_config_namespaceObject);
|
143638
143720
|
;// CONCATENATED MODULE: ./src/client/client-rich-edit.ts
|
143639
143721
|
|
143640
143722
|
|
@@ -143691,8 +143773,8 @@ class ClientRichEdit {
|
|
143691
143773
|
this.rawDataSource = settings.rawDataSource;
|
143692
143774
|
this.contextMenuSettings = settings.contextMenuSettings;
|
143693
143775
|
this.fullScreenHelper = new FullScreenHelper(element);
|
143694
|
-
if (
|
143695
|
-
|
143776
|
+
if (false)
|
143777
|
+
{}
|
143696
143778
|
this.prepareElement(element, settings);
|
143697
143779
|
this.initDefaultFontsAndStyles();
|
143698
143780
|
this.initBars(settings.ribbon, settings.fonts);
|