Merge pull request #460 from ONLYOFFICE/feature/new-function

Add new function Select in ApiRange
This commit is contained in:
Alexander Trofimov
2019-02-07 18:08:29 +03:00
committed by GitHub
2 changed files with 15 additions and 2 deletions

View File

@ -25,7 +25,7 @@ Selection
* Fix selection when selecting row/col/all
* Add new classes in apiBuilder: ApiName, ApiComment.
* Add new functions in ApiName: GetName, SetName, Delete, GetRefersTo, SetRefersTo and properties: Name, RefersTo.
* Add new functions in ApiRange: GetDefName, GetRows, Clear, GetWorksheet, GetComment and propoerties: DefName, Rows, Worksheet, Comment.
* Add new functions in ApiRange: GetDefName, GetRows, Clear, GetWorksheet, GetComment, Select and propoerties: DefName, Rows, Worksheet, Comment.
* Add new functions in ApiWorksheet: GetDefNames, GetDefName, AddDefName SetActive, GetComments and propoerties: DefNames, Active, Comments.
* Add new functions in Api: Intersect, GetSelection, GetDefName, AddDefName and propoerty: Selection.
* Add new functions in WorkBook: addDefName, getDefinedNamesWS.

View File

@ -1915,6 +1915,18 @@
}
});
/**
* Selects the object.
* @memberof ApiRange
*/
ApiRange.prototype.Select = function () {
if (this.range.worksheet.getId() === this.range.worksheet.workbook.getActiveWs().getId()) {
var newSelection = new AscCommonExcel.SelectionRange(this.range.worksheet);
newSelection.assign2(this.range.bbox);
newSelection.Select();
}
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiDrawing
@ -2510,7 +2522,8 @@
ApiRange.prototype["AddComment"] = ApiRange.prototype.AddComment;
ApiRange.prototype["GetWorksheet"] = ApiRange.prototype.GetWorksheet;
ApiRange.prototype["GetDefName"] = ApiRange.prototype.GetDefName;
ApiRange.prototype["GetComment"] = ApiRange.prototype.GetComment;
ApiRange.prototype["GetComment"] = ApiRange.prototype.GetComment;
ApiRange.prototype["Select"] = ApiRange.prototype.Select;
ApiDrawing.prototype["GetClassType"] = ApiDrawing.prototype.GetClassType;