devexpress-richedit 24.1.4-build-24183-0102 → 24.1.4-build-24186-1015

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.
@@ -68206,7 +68206,8 @@ class HtmlImgTagImporter extends HtmlTagImporterBase {
68206
68206
  importBefore() {
68207
68207
  const imageElement = this.importer.currElement;
68208
68208
  const originalSize = new geometry_size.Size(imageElement.naturalWidth, imageElement.naturalHeight);
68209
- const actualSize = new geometry_size.Size(imageElement.width, imageElement.height);
68209
+ const styleSize = new geometry_size.Size(parseFloat(imageElement.style.width), parseFloat(imageElement.style.height));
68210
+ const actualSize = new geometry_size.Size(imageElement.width || styleSize.width, imageElement.height || styleSize.height);
68210
68211
  if (originalSize.width !== undefined && originalSize.height !== undefined)
68211
68212
  originalSize.applyConverter(unit_converter/* UnitConverter */.u.pixelsToTwips);
68212
68213
  if (actualSize.width !== undefined && actualSize.height !== undefined)
@@ -69599,6 +69600,10 @@ class HtmlImporterTabStops {
69599
69600
 
69600
69601
 
69601
69602
 
69603
+
69604
+
69605
+
69606
+
69602
69607
 
69603
69608
 
69604
69609
 
@@ -69631,7 +69636,7 @@ class HtmlImportData {
69631
69636
  }
69632
69637
  }
69633
69638
  class HtmlImporter {
69634
- constructor(modelManager, measurer, subDocPosition, initElements, charPropsBundle) {
69639
+ constructor(modelManager, measurer, subDocPosition, initElements, charPropsBundle, formatImagesImporter) {
69635
69640
  this.fieldsId = 0;
69636
69641
  this.listIndex = 0;
69637
69642
  this.listInfos = [];
@@ -69672,6 +69677,7 @@ class HtmlImporter {
69672
69677
  this.measurer = measurer;
69673
69678
  this.currPosition = this.subDocPosition.position;
69674
69679
  this.levelInfo = [new LevelInfo(null, initElements, true)];
69680
+ this.formatImagesImporter = formatImagesImporter;
69675
69681
  this.loadFontInfos = [];
69676
69682
  this.tempFontInfoCache = new FontInfoCache(this.modelManager.model.cache.fontInfoCache.fontMeasurer);
69677
69683
  this.htmlImporterMaskedCharacterProperties =
@@ -69705,6 +69711,8 @@ class HtmlImporter {
69705
69711
  insertedInterval = new fixed.FixedInterval(this.subDocPosition.position, 0);
69706
69712
  for (let info of this.loadFontInfos)
69707
69713
  this.modelManager.modelManipulator.font.loadFontInfo(info.fontInfo, info.subDocument, [info.applyNewFontOnIntervalsAfterLoad], this.measurer);
69714
+ if (this.formatImagesImporter)
69715
+ this.registerImageRuns();
69708
69716
  });
69709
69717
  return insertedInterval;
69710
69718
  }
@@ -69811,6 +69819,28 @@ class HtmlImporter {
69811
69819
  return ColumnCalculator.findMinimalColumnSize(section.sectionProperties)
69812
69820
  .applyConverter(unit_converter/* UnitConverter */.u.pixelsToTwips);
69813
69821
  }
69822
+ registerImageRuns() {
69823
+ let importedRunsInfoIndex = -1;
69824
+ this.subDocument.chunks.forEach((chunk) => {
69825
+ chunk.textRuns.forEach((run) => {
69826
+ if (run instanceof InlinePictureRun) {
69827
+ importedRunsInfoIndex = this.findIndexImportedInlinePictureRunInfo(run.info.publicAPIID, ++importedRunsInfoIndex);
69828
+ const subDocPos = new SubDocumentPosition(this.subDocument, run.startOffset);
69829
+ const importedRunsInfo = this.importedRunsInfo[importedRunsInfoIndex];
69830
+ const options = ImageLoadingOptions.initByActualSize(importedRunsInfo.actualSize);
69831
+ const importerData = new FormatImagesImporterData(subDocPos, options, run);
69832
+ this.formatImagesImporter.registerImageRun(importerData);
69833
+ }
69834
+ });
69835
+ });
69836
+ }
69837
+ findIndexImportedInlinePictureRunInfo(publicAPIID, startIndex = 0) {
69838
+ for (let i = startIndex, runInfo; runInfo = this.importedRunsInfo[i]; i++) {
69839
+ if (runInfo instanceof ImportedInlinePictureRunInfo && runInfo.picInfo.publicAPIID === publicAPIID)
69840
+ return i;
69841
+ }
69842
+ return -1;
69843
+ }
69814
69844
  static convertHtml(html) {
69815
69845
  Log.print(LogSource.HtmlImporter, "convertHtml", () => html);
69816
69846
  html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
@@ -69977,7 +70007,7 @@ class HtmlDocumentImporter {
69977
70007
  const measurer = new Measurer('');
69978
70008
  const position = new SubDocumentPosition(this.documentModel.mainSubDocument, 0);
69979
70009
  const initElements = container.childNodes;
69980
- new HtmlImporter(this.modelManager, measurer, position, initElements, charPropsBundle).import();
70010
+ new HtmlImporter(this.modelManager, measurer, position, initElements, charPropsBundle, this.formatImagesImporter).import();
69981
70011
  this.removeLastParagraph();
69982
70012
  }
69983
70013
  finally {
@@ -89414,7 +89444,7 @@ class ControlFontsLoader {
89414
89444
  const xhr = new XMLHttpRequest();
89415
89445
  xhr.onload = (_e) => {
89416
89446
  const contentType = xhr.getResponseHeader("Content-Type");
89417
- if (contentType != null && contentType.startsWith('font')) {
89447
+ if (contentType !== 'text/html') {
89418
89448
  const fontSource = xhr.response;
89419
89449
  if (xhr.status >= 400 || !fontSource) {
89420
89450
  if (fontInfo.next())