Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion cell/model/Serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@
RdRichValueTypes: 33,
// Euro-Office extension: kept far above the ids above so that a record added later in the
// same sequence cannot take it
SourceFileType: 100
SourceFileType: 100,
// Euro-Office extension, next to SourceFileType: sheets the editor cannot show (Excel 4.0
// macro sheets). Opaque here; core writes and parses the payload. The next Euro-Office
// record takes 102, here and in core (OOXML/Binary/Sheets/Common/BinReaderWriterDefines.h).
PreservedSheets: 101
};
/** @enum */
var c_oSerWorkbookPrTypes =
Expand Down Expand Up @@ -3840,6 +3844,11 @@
this.bs.WriteItem(c_oSerWorkbookTypes.ExternalReferences, function() {oThis.WriteExternalReferences();});
}
if (!this.isCopyPaste) {
if (this.wb.preservedSheets) {
this.bs.WriteItem(c_oSerWorkbookTypes.PreservedSheets, function() {
oThis.memory.WriteBuffer(oThis.wb.preservedSheets, 0, oThis.wb.preservedSheets.length);
});
}
if (this.wb.oApi.vbaProject) {
this.bs.WriteItem(c_oSerWorkbookTypes.VbaProject, function() {
var old = new AscCommon.CMemory(true);
Expand Down Expand Up @@ -9641,6 +9650,10 @@
this.oWorkbook.setOleSize(new AscCommonExcel.OleSizeSelectionRange(null, parsedRange));
}
}
else if (c_oSerWorkbookTypes.PreservedSheets === type)
{
this.InitOpenManager.oReadResult.preservedSheets = this.stream.GetBufferUint8(length);
}
else if (c_oSerWorkbookTypes.VbaProject === type)
{
let _end_rec = this.stream.cur + length;
Expand Down Expand Up @@ -14044,6 +14057,7 @@
if (this.InitOpenManager.oReadResult.vbaProject) {
wb.oApi.vbaProject = this.InitOpenManager.oReadResult.vbaProject;
}
wb.preservedSheets = this.InitOpenManager.oReadResult.preservedSheets;
wb.checkCorrectTables();
};
this.PostLoadPrepareDefNames = function(wb)
Expand Down Expand Up @@ -14855,6 +14869,7 @@
pivotCacheDefinitions: {},
vbaMacros: null,
vbaProject: null,
preservedSheets: null,
macros: null,
slicerCaches: {},
tableIds: {},
Expand Down Expand Up @@ -14904,6 +14919,7 @@
if (this.oReadResult.vbaProject) {
wb.oApi.vbaProject = this.oReadResult.vbaProject;
}
wb.preservedSheets = this.oReadResult.preservedSheets;

wb.checkCorrectTables();
};
Expand Down
3 changes: 3 additions & 0 deletions cell/model/Workbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3278,6 +3278,9 @@
// File type (Asc.c_oAscFileType) of the document the workbook was converted from, when the
// converter recorded it; null otherwise.
this.sourceFileType = null;
// Sheets the editor cannot show (Excel 4.0 macro sheets), as an opaque Uint8Array
// that is written back unchanged on save.
this.preservedSheets = null;

AscFormat.ExecuteNoHistory(function () {
this.CustomProperties = new AscCommon.CCustomProperties();
Expand Down
Loading