Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch hotfix/v7.2.1 into master #3056

Merged
merged 154 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
befb1ee
Fix insert image to cell editor
Sep 7, 2022
d963483
Insert image to frame editors
Sep 7, 2022
c47183c
Revert "Fix insert image to cell editor"
Sep 7, 2022
40f6261
Fix name of methods for tests
Sep 7, 2022
9a64596
Fix open ole editor with images
Sep 8, 2022
a3a7348
Fix insert images to ole editor
Sep 8, 2022
6929a10
Merge branch 'release/v7.2.0' of https://github.com/ONLYOFFICE/sdkjs …
Sep 8, 2022
3876a43
Fix insert images to diagram editor
Sep 8, 2022
a39a07e
Hide window with errors and loading images in general editor
Sep 8, 2022
2bf9d7d
End long action "load images" if editor was closed before image was l…
Sep 8, 2022
7528aa4
Open frame with creating ole table
Sep 9, 2022
0f72275
Add images from ole table content to history for collaborative changes
Sep 9, 2022
cddb92b
Merge branch 'release/v7.2.0' of https://github.com/ONLYOFFICE/sdkjs …
Sep 9, 2022
93dbce3
Add upload image from file dialog in frame editor
Sep 12, 2022
6dc769a
Merge branch 'release/v7.2.0' of https://github.com/ONLYOFFICE/sdkjs …
Sep 12, 2022
b9cd29f
Lock ole table with editing in right panel
Sep 13, 2022
ae2ba63
Fix check selected objects for spreadsheet editor
Sep 13, 2022
7f6d4e7
Merge branch 'release/v7.2.0' of https://github.com/ONLYOFFICE/sdkjs …
Sep 14, 2022
8b503b2
Add history for ole size selection
Sep 14, 2022
7263bb8
Add history for ole size selection by keys
Sep 14, 2022
d959341
Draw visible area with select drawing objects
Sep 14, 2022
57830da
Fix draw single chart on preview of ole object
Sep 14, 2022
db5a476
Remove unused type
Sep 14, 2022
1450896
Fix save in single user mode after changing ole table
Sep 14, 2022
d1a1b8f
Fix start upload image action when files in file dialog was selected
Sep 14, 2022
c264c31
Check available obj in show image file dialog
Sep 15, 2022
e428725
Revert "Fix insert shapes from word to ole editor"
Sep 20, 2022
8e989f3
Revert "Fix draw single chart for ole object preview"
Sep 20, 2022
e3f3b42
Revert "Block insert and change images in frame editor for 7.2.0"
Sep 20, 2022
6103da5
Revert "Fix lock object with editing ole object in right panel"
Sep 20, 2022
a5ff084
Revert "Fix open images in frame editor"
Sep 20, 2022
a2bf238
Merge branch 'fix/image_insert_into_frame_editor' of https://github.c…
Sep 20, 2022
583e04c
Add point to local history for visible area selection with move and r…
Sep 20, 2022
3d2f61d
[all] Fix licenseResult override
konovalovsergey Sep 26, 2022
cc6047b
For bug #58867
KirillovIlya Sep 21, 2022
72d1a84
Fix bug #59091
Sep 21, 2022
f421d09
[de] Improve function CheckAllRunContent
KirillovIlya Sep 21, 2022
768ed86
fix bug 58867
SergeyLuzyanin Sep 21, 2022
ac6a65f
for bug 58867
SergeyLuzyanin Sep 21, 2022
1f81dbf
fix crash on inserting charts
SergeyLuzyanin Sep 23, 2022
aaa217f
[bug] fix bug 59120
SergeyLuzyanin Sep 23, 2022
bb72da2
Fix bug #59159
KirillovIlya Sep 26, 2022
ac2113b
Fix bug #59105
KirillovIlya Sep 27, 2022
4748bd2
[de] Fix duplicating fixed forms when saving to PDF
KirillovIlya Sep 27, 2022
1d9c8a5
For bug #58606
KirillovIlya Sep 27, 2022
f3c7b27
Update module (changes in core)
K0R0L Sep 28, 2022
06a0ff8
Feature/new input (#3021)
K0R0L Sep 28, 2022
bb9304f
Fix bug #58606
KirillovIlya Sep 28, 2022
b62ebd8
refactoring:
SergeyLuzyanin Sep 28, 2022
4362bde
fix copying image from frame to main editor
SergeyLuzyanin Sep 28, 2022
7bec9ff
fix copying image from frame to main editor in pe
SergeyLuzyanin Sep 28, 2022
c34de6a
[de] Add function for entering text from api
KirillovIlya Sep 28, 2022
48ad92f
[de] Add methods for plugins for accept/reject and move to next/previ…
KirillovIlya Sep 28, 2022
b587f71
[de] Fix check on entering text
KirillovIlya Sep 28, 2022
9624a2a
enterText for pe and drawing objects in se
SergeyLuzyanin Sep 28, 2022
86dddc8
Merge remote-tracking branch 'remotes/origin/hotfix/v7.2.1' into fix/…
SergeyLuzyanin Sep 28, 2022
eed4989
remove bSkipStartEndAction flag
SergeyLuzyanin Sep 28, 2022
6157eff
Merge pull request #3014 from ONLYOFFICE/fix/changes_for_oleeditor_in…
SergeyLuzyanin Sep 28, 2022
56808fa
Fix bug #58512
KirillovIlya Sep 28, 2022
6fc8272
[bug] Calling separate callback for each pathurl request
konovalovsergey Sep 28, 2022
aba2661
Fix bug #59149
KirillovIlya Sep 29, 2022
c431cc2
[se] Fix bug 58112
GoshaZotov Sep 29, 2022
6a44d4c
[bug] fix bug 59102
SergeyLuzyanin Sep 29, 2022
fb9de90
Fix bug 59202
K0R0L Sep 29, 2022
b186b89
[bug] fix bug 59212
SergeyLuzyanin Sep 29, 2022
294ec30
Fix bug #59205
KirillovIlya Sep 29, 2022
0527fbd
For bug #58901
KirillovIlya Sep 30, 2022
3207dd2
fix typo
SergeyLuzyanin Sep 30, 2022
2316407
Fix/enter text (#3025)
GoshaZotov Oct 3, 2022
b75c2e6
Use enterText instead of keyDown/keyPress
K0R0L Oct 3, 2022
ad35929
Add GetVisibleRegion method
K0R0L Oct 3, 2022
d580a9e
Fix visible region calculation
K0R0L Oct 3, 2022
c12ef3b
Fix bug 59240
K0R0L Oct 3, 2022
0f3bb87
For bug 52732
K0R0L Oct 4, 2022
b826503
Fix typo
K0R0L Oct 4, 2022
3120be2
Fix bug 59243
K0R0L Oct 4, 2022
c98cc6a
fix crash on opening
SergeyLuzyanin Oct 4, 2022
9bf80a7
Disable logs
K0R0L Oct 4, 2022
6f6dba6
Merge branch 'hotfix/v7.2.1' of https://github.com/ONLYOFFICE/sdkjs i…
K0R0L Oct 4, 2022
52ba3f8
For bug #57928
KirillovIlya Oct 4, 2022
71b8201
Fix build
K0R0L Oct 5, 2022
00571b1
Fix embed worker creation
K0R0L Oct 5, 2022
1e957c6
Fix bug #57928
KirillovIlya Oct 5, 2022
2bba905
Fix bug 59267
K0R0L Oct 5, 2022
9ffe9e0
Feature/event macros (#3026)
AlexeyMatveev686 Oct 5, 2022
87152e4
updated api descriptions for new macro event
ovchinnikova-natalya Oct 5, 2022
766a326
Refactoring embed worker
K0R0L Oct 5, 2022
4024d64
Fix bug #59270
KirillovIlya Oct 6, 2022
13cace1
Fix bug 59273
K0R0L Oct 6, 2022
548893a
Fix bug 59274
K0R0L Oct 6, 2022
4c2363f
Fix bug #59262
KirillovIlya Oct 6, 2022
36eb9fc
Fix bug #59278
KirillovIlya Oct 6, 2022
383c6c9
[de] Turn off check for document modification when composite input in…
KirillovIlya Oct 6, 2022
9a42464
[de] Do not send events for clearing search if it is empty
KirillovIlya Oct 6, 2022
e78403e
[all] Move xml serializers
konovalovsergey Oct 2, 2022
38726e9
[se] Move constants
GoshaZotov Oct 3, 2022
b931ef7
[se] Move CT_Workbook/CT_Sheets/CT_Sheet/CT_PivotCache
GoshaZotov Oct 3, 2022
223c069
remove opening from xml
SergeyLuzyanin Oct 4, 2022
d4a2a22
[se] Move AutoFilter,FilterColumn,ColorFilter,DynamicFilter,Top10,Cus…
konovalovsergey Oct 6, 2022
b056715
[bug] fix bug 59301
SergeyLuzyanin Oct 7, 2022
93952d7
[de] Check for format of a text form on the end of composite input
KirillovIlya Oct 7, 2022
049650a
fix bug 59308
SergeyLuzyanin Oct 7, 2022
6bfbd50
[de] Implement function to correct the text just entered
KirillovIlya Oct 9, 2022
e30313c
Start use asc_correctEnterText instead of simple removeText
K0R0L Oct 9, 2022
96acb86
fix the problem with creating CChangesDrawingsContent in base class
SergeyLuzyanin Oct 9, 2022
675ca89
[de] Add ability to correct entered text after composite input
KirillovIlya Oct 10, 2022
b0386c6
remove CreateFromParams and redefine methods used it in the derived c…
SergeyLuzyanin Oct 10, 2022
303a652
Fix bug #59290
KirillovIlya Oct 10, 2022
6ec50ee
Fix bug #59289
KirillovIlya Oct 10, 2022
c7c3b6f
Fix bug #59069 (#3031)
KhromovNikita Oct 10, 2022
609e2d2
For bug #59278
KirillovIlya Oct 10, 2022
d8f94ca
Fix bug 59327
K0R0L Oct 10, 2022
8877f63
[de] Add simple tests for entering text
KirillovIlya Oct 11, 2022
9107be5
Refacroting embed addon
K0R0L Oct 11, 2022
0767cee
Merge branch 'hotfix/v7.2.1' of https://github.com/ONLYOFFICE/sdkjs i…
K0R0L Oct 11, 2022
cc4dd0a
[se] Add confirmation dialog when maxChangesCount is reached
konovalovsergey Oct 4, 2022
d7a91c0
[all] Move c_oAscConfirm to commonDefines.js
konovalovsergey Oct 4, 2022
0833903
[all] Fix api.checkChangesSize
konovalovsergey Oct 5, 2022
3e408be
[de] Implement function to get the size of unsaved changes
KirillovIlya Oct 9, 2022
bed749b
[all] Add checkChangesSize to FinalizeAction
konovalovsergey Oct 10, 2022
8a424a2
[se] Fix CHistory.GetLocalChangesSize
konovalovsergey Oct 10, 2022
9cdf9d8
fix copy paste from html
SergeyLuzyanin Oct 11, 2022
b8ba76a
Add checkChangesSize in pe
SergeyLuzyanin Oct 11, 2022
228b84d
[se] Fix FormulaTests.html test
konovalovsergey Oct 11, 2022
ff3c2c3
Clear text input value on focus with delay
K0R0L Oct 11, 2022
ab558c2
Fix bug #59345
KirillovIlya Oct 12, 2022
2b1efd7
[pe] check userId and user name on writing comments additional data
SergeyLuzyanin Oct 12, 2022
ad06ed6
Fix bug with focus
K0R0L Oct 12, 2022
a75b60b
fix crash on click in paragraph
SergeyLuzyanin Oct 12, 2022
3f77470
fix crash on copying shape from smartart
SergeyLuzyanin Oct 12, 2022
b0ecfc7
[feature] Add acknowledge to authChanges
konovalovsergey Oct 12, 2022
4cdc7f5
[se] Fixed problem with ApiBuilder method "ApiRange.GetText".
Oct 12, 2022
6d07a7e
Fix bug 59347
K0R0L Oct 13, 2022
ca137fa
added the CreateTextPr method to the CSE and CPE api docs (#3037)
ovchinnikova-natalya Oct 13, 2022
ca6d8ee
[de] Add form key generator
KirillovIlya Oct 13, 2022
73ba3a4
[de] Fix form key generator for radio buttons
KirillovIlya Oct 13, 2022
db6a5dc
Fix bug #59364
KirillovIlya Oct 13, 2022
3547d2a
fixed for api docs (#3040)
ovchinnikova-natalya Oct 14, 2022
8596355
Refactoring api.js correction (#3042)
K0R0L Oct 14, 2022
0c880eb
fix removing all modifiers after alpha
SergeyLuzyanin Oct 14, 2022
6d3013f
Fix zoom in cells
K0R0L Oct 14, 2022
0e87434
For bug #59377
KirillovIlya Oct 14, 2022
a331459
Fix bug #59364
KirillovIlya Oct 14, 2022
104083f
Fix bug #59373
KirillovIlya Oct 14, 2022
49b6f69
[de] Fix GetSpecificType function for sub forms
KirillovIlya Oct 14, 2022
1ad884b
Fix bug #59374
KirillovIlya Oct 14, 2022
d1efcc6
Fix bug #59375
KirillovIlya Oct 14, 2022
93c49b0
[de] Add ability to get new key by form properties
KirillovIlya Oct 14, 2022
4def5c7
Fix bug #59378
KirillovIlya Oct 14, 2022
96faae3
Fix bug 59393
K0R0L Oct 17, 2022
eddc516
[bug] fix bug 59393
SergeyLuzyanin Oct 17, 2022
96d08ac
[se] Fix bug 59417 (#3051)
GoshaZotov Oct 18, 2022
d1310f5
Fix bug 59414 (#3053)
K0R0L Oct 18, 2022
0587ec6
added description for the InpurHelper class (#3054)
ovchinnikova-natalya Oct 19, 2022
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
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
node-qunit-puppeteer tests/word/forms/forms.html
node-qunit-puppeteer tests/word/forms/complexForm.html
node-qunit-puppeteer tests/word/api/api.html
node-qunit-puppeteer tests/word/api/textInput.html
node-qunit-puppeteer tests/word/styles/paraPr.html
builder-tests:
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion cell/Local/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ var c_oAscError = Asc.c_oAscError;
}
}
};

spreadsheet_api.prototype._saveLocalCheck = function()
{
return this._saveCheck();
};
spreadsheet_api.prototype.asc_Save = function (isNoUserSave, isSaveAs, isResaveAttack)
{
if (this.isFrameEditor() || AscCommon.c_oAscAdvancedOptionsAction.None !== this.advancedOptionsAction)
Expand All @@ -145,7 +150,7 @@ var c_oAscError = Asc.c_oAscError;
this.LastUserSavedIndex = AscCommon.History.UserSavedIndex;
}

if (true === this.canSave && this._saveCheck())
if (true === this.canSave && this._saveLocalCheck())
{
var _isNaturalSave = this.IsUserSave;
this.canSave = false;
Expand Down
121 changes: 83 additions & 38 deletions cell/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ var editor;
// ToDo select txt params
oAdditionalData["codepage"] = AscCommon.c_oAscCodePageUtf8;
dataContainer.data = last.data;
} else if(this.isOpenOOXInBrowser) {
} else if(this.isOpenOOXInBrowser && this.saveDocumentToZip) {
var t = this;
var title = this.documentTitle;
AscCommonExcel.executeInR1C1Mode(false, function () {
Expand Down Expand Up @@ -1448,7 +1448,7 @@ var editor;
if (file.changes && this.VersionHistory) {
this.VersionHistory.changes = file.changes;
}
this.isOpenOOXInBrowser = AscCommon.checkOOXMLSignature(file.data);
this.isOpenOOXInBrowser = this["asc_isSupportFeature"]("ooxml") && AscCommon.checkOOXMLSignature(file.data);
if (this.isOpenOOXInBrowser) {
this.openOOXInBrowserZip = file.data;
}
Expand Down Expand Up @@ -3950,32 +3950,40 @@ var editor;
* @param {{}} [oOleObjectInfo] info from oleObject
*/
spreadsheet_api.prototype.asc_addTableOleObjectInOleEditor = function(oOleObjectInfo) {
this.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.Open);
oOleObjectInfo = oOleObjectInfo || {"binary": AscCommon.getEmpty()};
const sStream = oOleObjectInfo["binary"];
const oThis = this;
const oFile = new AscCommon.OpenFileResult();
oFile.bSerFormat = AscCommon.checkStreamSignature(sStream, AscCommon.c_oSerFormat.Signature);
oFile.data = sStream;
this.isEditOleMode = true;
this.isChartEditor = false;
this.isFromSheetEditor = oOleObjectInfo["isFromSheetEditor"];
const oDocumentImageUrls = oOleObjectInfo["documentImageUrls"];
this.asc_CloseFile();
this.fAfterLoad = function () {
const nImageWidth = oOleObjectInfo["imageWidth"];
const nImageHeight = oOleObjectInfo["imageHeight"];
if (nImageWidth && nImageHeight) {
oThis.saveImageCoefficients = oThis.getScaleCoefficientsForOleTableImage(nImageWidth, nImageHeight);
}
oThis.wb.scrollToOleSize();
oThis.wb.onOleEditorReady();
delete oThis.imagesFromGeneralEditor;
oThis.sync_EndAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.Open);
}
this.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.Open);
// на случай, если изображение поставили на загрузку, закрыли редактор, и потом опять открыли
this.sync_EndAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.LoadImage);
this.sendFromFrameToGeneralEditor({
"type": AscCommon.c_oAscFrameDataType.OpenFrame
});
oOleObjectInfo = oOleObjectInfo || {"binary": AscCommon.getEmpty()};
const sStream = oOleObjectInfo["binary"];
const oThis = this;
const oFile = new AscCommon.OpenFileResult();
oFile.bSerFormat = AscCommon.checkStreamSignature(sStream, AscCommon.c_oSerFormat.Signature);
oFile.data = sStream;
this.isEditOleMode = true;
this.isChartEditor = false;
this.isFromSheetEditor = oOleObjectInfo["isFromSheetEditor"];
const oDocumentImageUrls = oOleObjectInfo["documentImageUrls"];
this.asc_CloseFile();
this.fAfterLoad = function () {
const nImageWidth = oOleObjectInfo["imageWidth"];
const nImageHeight = oOleObjectInfo["imageHeight"];
if (nImageWidth && nImageHeight) {
oThis.saveImageCoefficients = oThis.getScaleCoefficientsForOleTableImage(nImageWidth, nImageHeight);
}
oThis.wb.scrollToOleSize();
// добавляем первый поинт после загрузки, чтобы в локальную историю добавился либо стандартный oleSize, либо заданный пользователем
const oleSize = oThis.wb.getOleSize();
oleSize.addPointToLocalHistory();

oThis.wb.onOleEditorReady();
oThis.sync_EndAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.Open);
}

this.imagesFromGeneralEditor = oDocumentImageUrls;
this.openDocument(oFile);
this.imagesFromGeneralEditor = oDocumentImageUrls || {};
this.openDocument(oFile);
};
/**
* get binary info about changed ole object
Expand All @@ -3987,10 +3995,31 @@ var editor;
const arrBinaryData = oBinaryFileWriter.Write().split(';');
const sCleanBinaryData = arrBinaryData[arrBinaryData.length - 1];
const oBinaryInfo = {};
const arrWorksheets = this.wb.wsViews;
const arrRasterImageIds = [];
for (let i = 0; i < arrWorksheets.length; i += 1) {
const oWorksheet = arrWorksheets[i];
const arrDrawings = oWorksheet.model.Drawings;
if (arrDrawings) {
for (let i = 0; i < arrDrawings.length; i += 1) {
const oDrawing = arrDrawings[i];
oDrawing.graphicObject.getAllRasterImages(arrRasterImageIds);
}
}
}
const urlsForAddToHistory = [];
for (let i = 0; i < arrRasterImageIds.length; i += 1) {
const url = AscCommon.g_oDocumentUrls.mediaPrefix + arrRasterImageIds[i];
if (!(this.imagesFromGeneralEditor && this.imagesFromGeneralEditor[url] && this.imagesFromGeneralEditor[url] === AscCommon.g_oDocumentUrls.getUrls()[url])) {
urlsForAddToHistory.push(arrRasterImageIds[i]);
}
}


oBinaryInfo["binary"] = sCleanBinaryData;
oBinaryInfo["base64Image"] = sDataUrl;
oBinaryInfo["isFromSheetEditor"] = this.isFromSheetEditor;
oBinaryInfo["imagesForAddToHistory"] = urlsForAddToHistory;
if (this.saveImageCoefficients) {
oBinaryInfo["widthCoefficient"] = this.saveImageCoefficients.widthCoefficient;
oBinaryInfo["heightCoefficient"] = this.saveImageCoefficients.heightCoefficient;
Expand All @@ -4001,10 +4030,11 @@ var editor;
}

spreadsheet_api.prototype.asc_toggleChangeVisibleAreaOleEditor = function (bForceValue) {
var ws = this.wb.getWorksheet();
const ws = this.wb.getWorksheet();
ws.cleanSelection();
ws.endEditChart();
ws._endSelectionShape();
const previousValue = this.isEditVisibleAreaOleEditor;
if (typeof bForceValue === 'boolean') {
this.isEditVisibleAreaOleEditor = bForceValue;
} else {
Expand All @@ -4013,6 +4043,11 @@ var editor;
if (this.isEditVisibleAreaOleEditor) {
this.wb.setCellEditMode(false);
}
const currentValue = this.isEditVisibleAreaOleEditor;
if (previousValue === true && currentValue === false) {
const oOleSize = this.wbModel.getOleSize();
oOleSize.addToGlobalHistory();
}
ws._drawSelection();
};

Expand Down Expand Up @@ -4078,6 +4113,10 @@ var editor;
this.asc_addImage();
};
spreadsheet_api.prototype._addImageUrl = function(urls, obj) {
if (obj && obj.sendUrlsToFrameEditor && this.isOpenedChartFrame) {
this.addImageUrlsFromGeneralToFrameEditor(urls);
return;
}
var ws = this.wb.getWorksheet();
if (ws) {
if (obj && (obj.isImageChangeUrl || obj.isShapeImageChangeUrl || obj.isTextArtChangeUrl || obj.fAfterUploadOleObjectImage)) {
Expand Down Expand Up @@ -4411,7 +4450,7 @@ var editor;
}
};

spreadsheet_api.prototype.asc_addOleObjectAction = function(sLocalUrl, sData, sApplicationId, fWidth, fHeight, nWidthPix, nHeightPix, bSelect)
spreadsheet_api.prototype.asc_addOleObjectAction = function(sLocalUrl, sData, sApplicationId, fWidth, fHeight, nWidthPix, nHeightPix, bSelect, arrImagesForAddToHistory)
{
var _image = this.ImageLoader.LoadImage(AscCommon.getFullImageSrc2(sLocalUrl), 1);
if (null != _image){
Expand All @@ -4422,20 +4461,20 @@ var editor;

if(ws.objectRender){
this.asc_canPaste();
ws.objectRender.addOleObject(fWidth, fHeight, nWidthPix, nHeightPix, sLocalUrl, sData, sApplicationId, bSelect);
ws.objectRender.addOleObject(fWidth, fHeight, nWidthPix, nHeightPix, sLocalUrl, sData, sApplicationId, bSelect, arrImagesForAddToHistory);
this.asc_endPaste();
}
}
};

spreadsheet_api.prototype.asc_editOleObjectAction = function(bResize, oOleObject, sImageUrl, sData, fWidth, fHeight, nPixWidth, nPixHeight)
spreadsheet_api.prototype.asc_editOleObjectAction = function(oOleObject, sImageUrl, sData, fWidth, fHeight, nPixWidth, nPixHeight, arrImagesForAddToHistory)
{
if (oOleObject)
{
var ws = this.wb.getWorksheet();
if(ws.objectRender){
this.asc_canPaste();
ws.objectRender.editOleObject(oOleObject, sData, sImageUrl, fWidth, fHeight, nPixWidth, nPixHeight, bResize);
ws.objectRender.editOleObject(oOleObject, sData, sImageUrl, fWidth, fHeight, nPixWidth, nPixHeight, arrImagesForAddToHistory);
this.asc_endPaste();
}
}
Expand Down Expand Up @@ -4508,9 +4547,6 @@ var editor;
if (!this.canEdit()) {
return;
}
if (this.isFrameEditor() && !AscCommon.isNullOrEmptyString(props.ImageUrl)) {
props.ImageUrl = null;
}
var ws = this.wb.getWorksheet();
var fReplaceCallback = null, sImageUrl = null, sToken = undefined;
if(!AscCommon.isNullOrEmptyString(props.ImageUrl)){
Expand Down Expand Up @@ -4559,7 +4595,7 @@ var editor;
ws.objectRender.setGraphicObjectProps(props);
}

}, true, undefined, sToken);
}, undefined, sToken);
}
else{
var sBulletSymbol = props.asc_getBulletSymbol && props.asc_getBulletSymbol();
Expand Down Expand Up @@ -5838,7 +5874,7 @@ var editor;
}

let xlsxData;
this.isOpenOOXInBrowser = AscCommon.checkOOXMLSignature(base64File);
this.isOpenOOXInBrowser = this["asc_isSupportFeature"]("ooxml") && AscCommon.checkOOXMLSignature(base64File);
if (this.isOpenOOXInBrowser) {
//slice because array contains garbage after end of function
this.openOOXInBrowserZip = base64File.slice();
Expand Down Expand Up @@ -5907,7 +5943,7 @@ var editor;
return { data: oBinaryFileWriter.Write(true, true), header: oBinaryFileWriter.WriteFileHeader(oBinaryFileWriter.Memory.GetCurPosition(), Asc.c_nVersionNoBase64) };
};
spreadsheet_api.prototype.asc_nativeGetFileData = function() {
if (this.isOpenOOXInBrowser) {
if (this.isOpenOOXInBrowser && this.saveDocumentToZip) {
let res;
this.saveDocumentToZip(this.wb.model, this.editorId, function(data) {
res = data;
Expand Down Expand Up @@ -7621,6 +7657,15 @@ var editor;
this.sendEvent('onWorksheetChange', range);
};

spreadsheet_api.prototype.asc_enterText = function(codePoints)
{
let wb = this.wb;
if (!wb)
return;

wb.EnterText(codePoints);
};

/*
* Export
* -----------------------------------------------------------------------------
Expand Down
35 changes: 32 additions & 3 deletions cell/apiBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
*/
var Api = window["Asc"]["spreadsheet_api"];

/**
* The callback function which is called when the specified range of the current sheet changes.
* <note>Please note that the event is not called for the undo/redo operations.</note>
* @event Api#onWorksheetChange
* @property {ApiRange} range - The modified range represented as the ApiRange object.
*/

/**
* Class representing a sheet.
* @constructor
Expand Down Expand Up @@ -86,6 +93,7 @@
* @property {number} Col - Returns the column number for the selected cell.
* @property {ApiRange} Rows - Returns the ApiRange object that represents the rows of the specified range.
* @property {ApiRange} Cols - Returns the ApiRange object that represents the columns of the specified range.
* @property {ApiRange} Cells - Returns a Range object that represents all the cells in the specified range or a specified cell.
* @property {number} Count - Returns the rows or columns count.
* @property {string} Address - Returns the range address.
* @property {string} Value - Returns a value from the first cell of the specified range or sets it to this cell.
Expand All @@ -103,8 +111,10 @@
* @property {'center' | 'bottom' | 'top' | 'distributed' | 'justify'} AlignVertical - Sets the text vertical alignment to the current cell range.
* @property {'left' | 'right' | 'center' | 'justify'} AlignHorizontal - Sets the text horizontal alignment to the current cell range.
* @property {boolean} Bold - Sets the bold property to the text characters from the current cell or cell range.
* @property {boolean} Italic - Sets the italic property to the text characters in the current cell or cell range.
* @property {'none' | 'single' | 'singleAccounting' | 'double' | 'doubleAccounting'} Underline - Sets the type of underline applied to the font.
* @property {boolean} Strikeout - Sets a value that indicates whether the contents of the current cell or cell range are displayed struck through.
* @property {boolean} WrapText - Returns the information about the wrapping cell style or specifies whether the words in the cell must be wrapped to fit the cell size or not.
* @property {ApiColor|'No Fill'} FillColor - Returns or sets the background color of the current cell range.
* @property {string} NumberFormat - Sets a value that represents the format code for the object.
* @property {ApiRange} MergeArea - Returns the cell or cell range from the merge area.
Expand Down Expand Up @@ -749,6 +759,25 @@
}
};

/**
* Subscribes to the specified event and calls the callback function when the event fires.
* @memberof Api
* @typeofeditors ["CSE"]
* @param {string} eventName - The event name.
* @param {function} callback - Function to be called when the event fires.
* @fires Api#onWorksheetChange
*/
Api.prototype["attachEvent"] = Api.prototype.attachEvent;

/**
* Unsubscribes from the specified event.
* @memberof Api
* @typeofeditors ["CSE"]
* @param {string} eventName - The event name.
* @fires Api#onWorksheetChange
*/
Api.prototype["detachEvent"] = Api.prototype.detachEvent;

/**
* Returns the state of sheet visibility.
* @memberof ApiWorksheet
Expand Down Expand Up @@ -2088,7 +2117,7 @@
var nRow = bbox.r2 - bbox.r1 + 1;
var res;
if (this.range.isOneCell()) {
res = this.range.getValue();
res = this.range.getValueWithoutFormat();
} else {
res = [];
for (var i = 0; i < nRow; i++) {
Expand Down Expand Up @@ -2124,7 +2153,7 @@
var nRow = bbox.r2 - bbox.r1 + 1;
var res;
if (this.range.isOneCell()) {
res = this.range.getValue();
res = this.range.getValueWithFormat();
} else {
res = [];
for (var i = 0; i < nRow; i++) {
Expand All @@ -2141,7 +2170,7 @@

Object.defineProperty(ApiRange.prototype, "Text", {
get: function () {
return this.range.getValueWithFormat();
return this.GetText();
},
set: function (value) {
this.SetValue(value);
Expand Down
12 changes: 0 additions & 12 deletions cell/apiDefines.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ function (window, undefined) {
// Import
var CColor = AscCommon.CColor;

var c_oAscConfirm = {
ConfirmReplaceRange: 0,
ConfirmPutMergeRange: 1,
ConfirmReplaceFormulaInTable: 2,
ConfirmChangeProtectRange: 3
};

var c_oAscMergeOptions = {
Disabled: -1,
None: 0,
Expand Down Expand Up @@ -611,11 +604,6 @@ var c_oAscPopUpSelectorType = {
prot['ByColorFont'] = prot.ByColorFont;
prot['ByIcon'] = prot.ByIcon;
prot['ByValue'] = prot.ByValue;
window['Asc']['c_oAscConfirm'] = window['Asc'].c_oAscConfirm = c_oAscConfirm;
prot = c_oAscConfirm;
prot['ConfirmReplaceRange'] = prot.ConfirmReplaceRange;
prot['ConfirmPutMergeRange'] = prot.ConfirmPutMergeRange;
prot['ConfirmChangeProtectRange'] = prot.ConfirmChangeProtectRange;

prot['ConfirmReplaceFormulaInTable'] = prot.ConfirmReplaceFormulaInTable;
window['Asc']['c_oAscMergeOptions'] = window['Asc'].c_oAscMergeOptions = c_oAscMergeOptions;
Expand Down
Loading