Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/release/v7.5.0' into dev…
Browse files Browse the repository at this point in the history
…elop
  • Loading branch information
SergeyLuzyanin committed Aug 31, 2023
2 parents f15c7fa + dac344f commit c802466
Show file tree
Hide file tree
Showing 121 changed files with 7,477 additions and 1,755 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/common_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
node-qunit-puppeteer tests/cell/spreadsheet-calculation/SheetStructureTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/autoFilterTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/UserProtectedRangesTest.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/FormulaTrace.html
node-qunit-puppeteer tests/word/unit-tests/paragraphContentPos.html
node-qunit-puppeteer tests/word/content-control/block-level/cursorAndSelection.html
node-qunit-puppeteer tests/word/content-control/inline-level/cursorAndSelection.html
Expand All @@ -48,6 +49,7 @@ jobs:
node-qunit-puppeteer tests/word/document-calculation/table/flowTablePosition.html
node-qunit-puppeteer tests/word/document-calculation/table/pageBreak.html
node-qunit-puppeteer tests/word/document-calculation/textShaper/textShaper.html
node-qunit-puppeteer tests/word/document-calculation/text-hyphenator/text-hyphenator.html
node-qunit-puppeteer tests/word/forms/forms.html
node-qunit-puppeteer tests/word/forms/complexForm.html
node-qunit-puppeteer tests/word/numbering/numberingApplicator.html
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dev_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
node-qunit-puppeteer tests/cell/spreadsheet-calculation/SheetStructureTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/autoFilterTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/UserProtectedRangesTest.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/FormulaTrace.html
node-qunit-puppeteer tests/word/unit-tests/paragraphContentPos.html
node-qunit-puppeteer tests/word/content-control/block-level/cursorAndSelection.html
node-qunit-puppeteer tests/word/content-control/inline-level/cursorAndSelection.html
Expand All @@ -48,6 +49,7 @@ jobs:
node-qunit-puppeteer tests/word/document-calculation/table/flowTablePosition.html
node-qunit-puppeteer tests/word/document-calculation/table/pageBreak.html
node-qunit-puppeteer tests/word/document-calculation/textShaper/textShaper.html
node-qunit-puppeteer tests/word/document-calculation/text-hyphenator/text-hyphenator.html
node-qunit-puppeteer tests/word/forms/forms.html
node-qunit-puppeteer tests/word/forms/complexForm.html
node-qunit-puppeteer tests/word/numbering/numberingApplicator.html
Expand Down
83 changes: 48 additions & 35 deletions cell/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,32 +589,6 @@ var editor;
}
};

spreadsheet_api.prototype._getFileFromUrl = function (url, fileType, token, outputFormat, callback) {
if (this.canEdit()) {
var document = {url: url, format: fileType, token: token};
this.insertDocumentUrlsData = {
imageMap: null, documents: [document], convertCallback: function (_api, url) {
_api.insertDocumentUrlsData.imageMap = url;
if (url['output.xlsx']) {
callback(url['output.xlsx']);
} else if (url['output.xlst']) {
callback(url['output.xlst']);
} else {
callback(null);
}
_api.endInsertDocumentUrls();
}, endCallback: function (_api) {
callback(null);
}
};

var _options = new Asc.asc_CDownloadOptions(outputFormat);
_options.isNaturalDownload = true;
_options.isGetTextFromUrl = true;
this.downloadAs(Asc.c_oAscAsyncAction.DownloadAs, _options);
}
};

spreadsheet_api.prototype._getTextFromFile = function (options, callback) {
let t = this;

Expand Down Expand Up @@ -868,15 +842,6 @@ var editor;
this.downloadAs(Asc.c_oAscAsyncAction.DownloadAs, options);
};

spreadsheet_api.prototype.endInsertDocumentUrls = function()
{
if (this.insertDocumentUrlsData) {
this.insertDocumentUrlsData.endCallback(this);
this.insertDocumentUrlsData = null;
//this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
}
};

spreadsheet_api.prototype.asc_TextToColumns = function (options, opt_text, opt_activeRange) {
if (this.canEdit()) {
var ws = this.wb.getWorksheet();
Expand Down Expand Up @@ -1779,6 +1744,10 @@ var editor;
if (this.wbModel.DrawingDocument) {
this.wbModel.DrawingDocument.CloseFile();
}

if(this.wb.MobileTouchManager) {
this.wb.MobileTouchManager.Destroy();
}
};

spreadsheet_api.prototype.openDocumentFromZip = function (wb, data) {
Expand Down Expand Up @@ -6687,6 +6656,8 @@ var editor;
};

spreadsheet_api.prototype.asc_nativePrint = function (_printer, _page, _options) {
//calc to fix case where file has formulas with no cache values and no changes
this.wbModel.dependencyFormulas.calcTree();
var _adjustPrint = (window.AscDesktopEditor_PrintOptions && window.AscDesktopEditor_PrintOptions.advancedOptions) || new Asc.asc_CAdjustPrint();
window.AscDesktopEditor_PrintOptions = undefined;

Expand Down Expand Up @@ -8909,6 +8880,44 @@ var editor;
};


spreadsheet_api.prototype.asc_TracePrecedents = function() {
if (this.collaborativeEditing.getGlobalLock() || !this.canEdit()) {
return;
}
let wb = this.wb;
if (!wb) {
return;
}
let ws = wb.getWorksheet();
return ws.tracePrecedents();
};

spreadsheet_api.prototype.asc_TraceDependents = function() {
if (this.collaborativeEditing.getGlobalLock() || !this.canEdit()) {
return;
}
let wb = this.wb;
if (!wb) {
return;
}
let ws = wb.getWorksheet();
return ws.traceDependents();
};

spreadsheet_api.prototype.asc_RemoveTraceArrows = function(type) {
if (this.collaborativeEditing.getGlobalLock() || !this.canEdit()) {
return;
}
let wb = this.wb;
if (!wb) {
return;
}
let ws = wb.getWorksheet();
return ws.removeTraceArrows(type);
};



/*
* Export
* -----------------------------------------------------------------------------
Expand Down Expand Up @@ -9073,6 +9082,7 @@ var editor;
prot["asc_setDisplayHeadings"] = prot.asc_setDisplayHeadings;
prot["asc_setShowZeros"] = prot.asc_setShowZeros;
prot["asc_setShowFormulas"] = prot.asc_setShowFormulas;
prot["asc_getShowFormulas"] = prot.asc_getShowFormulas;


// Defined Names
Expand Down Expand Up @@ -9474,6 +9484,9 @@ var editor;
prot["asc_GetSheetViewType"] = prot.asc_GetSheetViewType;

prot["asc_ChangeTextCase"] = prot.asc_ChangeTextCase;
prot["asc_TracePrecedents"] = prot.asc_TracePrecedents;
prot["asc_TraceDependents"] = prot.asc_TraceDependents;
prot["asc_RemoveTraceArrows"] = prot.asc_RemoveTraceArrows;

prot["asc_InsertPageBreak"] = prot.asc_InsertPageBreak;
prot["asc_RemovePageBreak"] = prot.asc_RemovePageBreak;
Expand Down
11 changes: 11 additions & 0 deletions cell/apiDefines.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ var c_oAscPopUpSelectorType = {
};


var c_oAscRemoveArrowsType = {
all: 0,
precedent: 1,
dependent: 2
};

//----------------------------------------------------------export----------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
window['AscCommonExcel'].c_oAscDrawDepOptions = c_oAscDrawDepOptions;
Expand Down Expand Up @@ -983,6 +989,11 @@ var c_oAscPopUpSelectorType = {
prot['all'] = prot.all;
prot['insertRemove'] = prot.insertRemove;
prot['reset'] = prot.reset;
window['Asc']['c_oAscRemoveArrowsType'] = window['Asc'].c_oAscRemoveArrowsType = c_oAscRemoveArrowsType;
prot = c_oAscRemoveArrowsType;
prot['all'] = prot.all;
prot['precedent'] = prot.precedent;
prot['dependent'] = prot.dependent;


})(window);
2 changes: 1 addition & 1 deletion cell/model/FormulaObjects/dateandtimeFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1957,7 +1957,7 @@
}

return new cNumber(
weekday[new cDate((arg0.getValue() - (AscCommonExcel.c_DateCorrectConst + 1)) * c_msPerDay).getUTCDay()]);
weekday[new cDate((arg0.getValue() - (AscCommonExcel.c_DateCorrectConst + (AscCommon.bDate1904 ? 0 : 1))) * c_msPerDay).getUTCDay()]);
};

/**
Expand Down
8 changes: 4 additions & 4 deletions cell/model/FormulaObjects/parserFormula.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,16 +1197,16 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
if (!emptyReplaceOn) {
emptyReplaceOn = new cEmpty();
}
let elem;
for (let i = bbox.r1; i <= Math.min(bbox.r2, maxRowCount != null ? bbox.r1 + maxRowCount : bbox.r2); i++) {
if ( !arr.array[i - bbox.r1] ) {
arr.addRow();
}
for (let j = bbox.c1; j <= Math.min(bbox.c2, maxColCount != null ? bbox.c1 + maxColCount : bbox.c2); j++) {
let elem = null;
if (elemsNoEmpty && elemsNoEmpty[i - bbox.r1] && elemsNoEmpty[i - bbox.r1][j - bbox.c1]) {
elem = elemsNoEmpty[i - bbox.r1][j - bbox.c1];
}
if (!elem || elem.type === cElementType.empty) {
if (elem === null || elem.type === cElementType.empty) {
elem = emptyReplaceOn;
}

Expand Down Expand Up @@ -1605,16 +1605,16 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
if (!emptyReplaceOn) {
emptyReplaceOn = new cEmpty();
}
let elem;
for (let i = bbox.r1; i <= Math.min(bbox.r2, maxRowCount != null ? bbox.r1 + maxRowCount : bbox.r2); i++) {
if (!arr.array[i - bbox.r1]) {
arr.addRow();
}
for (let j = bbox.c1; j <= Math.min(bbox.c2, maxColCount != null ? bbox.c1 + maxColCount : bbox.c2); j++) {
let elem = null;
if (elemsNoEmpty && elemsNoEmpty[0] && elemsNoEmpty[0][i - bbox.r1] && elemsNoEmpty[0][i - bbox.r1][j - bbox.c1]) {
elem = elemsNoEmpty[0][i - bbox.r1][j - bbox.c1];
}
if (!elem || elem.type === cElementType.empty) {
if (elem === null || elem.type === cElementType.empty) {
elem = emptyReplaceOn;
}

Expand Down
4 changes: 2 additions & 2 deletions cell/model/FormulaObjects/textanddataFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ function (window, undefined) {
cTEXTBEFORE.prototype.argumentsMin = 2;
cTEXTBEFORE.prototype.argumentsMax = 6;
cTEXTBEFORE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cTEXTBEFORE.prototype.argumentsType = [argType.text, argType.text, argType.number, argType.number, argType.number, argType.any];
cTEXTBEFORE.prototype.argumentsType = [argType.text, argType.text, argType.number, argType.logical, argType.logical, argType.any];
cTEXTBEFORE.prototype.isXLFN = true;
cTEXTBEFORE.prototype.arrayIndexes = {1: 1};
cTEXTBEFORE.prototype.Calculate = function (arg) {
Expand All @@ -2454,7 +2454,7 @@ function (window, undefined) {
cTEXTAFTER.prototype.argumentsMin = 2;
cTEXTAFTER.prototype.argumentsMax = 6;
cTEXTAFTER.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cTEXTAFTER.prototype.argumentsType = [argType.text, argType.text, argType.number, argType.number, argType.number, argType.any];
cTEXTAFTER.prototype.argumentsType = [argType.text, argType.text, argType.number, argType.logical, argType.logical, argType.any];
cTEXTAFTER.prototype.isXLFN = true;
cTEXTAFTER.prototype.arrayIndexes = {1: 1};
cTEXTAFTER.prototype.Calculate = function (arg) {
Expand Down
Loading

0 comments on commit c802466

Please sign in to comment.