From c47fcea6f9dca06875ee0edb649b81516ae18c5c Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Tue, 2 Dec 2025 19:17:29 +0300 Subject: [PATCH] [se] Check and update sharedStrings in initWithSharedStrings; Fix bug 78869 --- cell/model/WorkbookElems.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cell/model/WorkbookElems.js b/cell/model/WorkbookElems.js index 1f55f2fbb0..206d807092 100644 --- a/cell/model/WorkbookElems.js +++ b/cell/model/WorkbookElems.js @@ -13058,9 +13058,21 @@ function RangeDataManagerElem(bbox, data) }; /** * Initialize with sharedStrings from file. rely on uniqines + * Adds new shared strings to existing ones without removing existing data * @param {Array>} sharedStrings */ CSharedStrings.prototype.initWithSharedStrings = function(sharedStrings) { + if (this.all.length > 0) { + for (let i = 0; i < sharedStrings.length; i++) { + const item = sharedStrings[i]; + if (typeof item === 'string') { + this.addText(item); + } else { + this.addMultiText(item); + } + } + return; + } this.all = sharedStrings.slice(); //copy this.text = Object.create(null); this.multiTextMap = Object.create(null);