Commit ed4ed4ff authored by Alexander.Trofimov's avatar Alexander.Trofimov

update import variables

parent 84c68d1f
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
/////////////////////////////////////////////////////////
////////////// OPEN ////////////////////////
/////////////////////////////////////////////////////////
......@@ -28,7 +31,7 @@
g_oIdCounter.m_sUserId = window["AscDesktopEditor"]["CheckUserId"]();
if (_data == "")
{
this.sendEvent("asc_onError", Asc.c_oAscError.ID.ConvertationError, Asc.c_oAscError.Level.Critical);
this.sendEvent("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.Critical);
return;
}
......@@ -218,7 +221,7 @@ window["DesktopOfflineAppDocumentEndSave"] = function(error)
window["Asc"]["editor"].LastUserSavedIndex = undefined;
if (2 == error)
window["Asc"]["editor"].sendEvent("asc_onError", Asc.c_oAscError.ID.ConvertationError, Asc.c_oAscError.Level.NoCritical);
window["Asc"]["editor"].sendEvent("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.NoCritical);
};
window["Asc"]['spreadsheet_api'].prototype["asc_addImageDrawingObject"] = window["Asc"]['spreadsheet_api'].prototype.asc_addImageDrawingObject;
......
This diff is collapsed.
......@@ -6,6 +6,10 @@
* @param {undefined} undefined
*/
function (window, undefined) {
// Import
var c_oAscInsertOptions = Asc.c_oAscInsertOptions;
var c_oAscDeleteOptions = Asc.c_oAscDeleteOptions;
/** @constructor */
function asc_CCommentCoords(obj) {
......@@ -602,7 +606,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
var i, comment;
if (bInsert) {
switch (operType) {
case Asc.c_oAscInsertOptions.InsertCellsAndShiftDown:
case c_oAscInsertOptions.InsertCellsAndShiftDown:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if ((comment.nRow >= updateRange.r1) && (comment.nCol >= updateRange.c1) && (comment.nCol <= updateRange.c2)) {
......@@ -612,7 +616,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
}
break;
case Asc.c_oAscInsertOptions.InsertCellsAndShiftRight:
case c_oAscInsertOptions.InsertCellsAndShiftRight:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if ((comment.nCol >= updateRange.c1) && (comment.nRow >= updateRange.r1) && (comment.nRow <= updateRange.r2)) {
......@@ -622,7 +626,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
}
break;
case Asc.c_oAscInsertOptions.InsertColumns:
case c_oAscInsertOptions.InsertColumns:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if (comment.nCol >= updateRange.c1) {
......@@ -632,7 +636,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
}
break;
case Asc.c_oAscInsertOptions.InsertRows:
case c_oAscInsertOptions.InsertRows:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if (comment.nRow >= updateRange.r1) {
......@@ -644,7 +648,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
}
} else {
switch (operType) {
case Asc.c_oAscDeleteOptions.DeleteCellsAndShiftTop:
case c_oAscDeleteOptions.DeleteCellsAndShiftTop:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if ((comment.nRow > updateRange.r1) && (comment.nCol >= updateRange.c1) && (comment.nCol <= updateRange.c2)) {
......@@ -656,7 +660,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
}
break;
case Asc.c_oAscDeleteOptions.DeleteCellsAndShiftLeft:
case c_oAscDeleteOptions.DeleteCellsAndShiftLeft:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if ((comment.nCol > updateRange.c2) && (comment.nRow >= updateRange.r1) && (comment.nRow <= updateRange.r2)) {
......@@ -668,7 +672,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
}
break;
case Asc.c_oAscDeleteOptions.DeleteColumns:
case c_oAscDeleteOptions.DeleteColumns:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if (comment.nCol > updateRange.c2) {
......@@ -680,7 +684,7 @@ CCellCommentator.prototype.updateCommentsDependencies = function(bInsert, operTy
}
break;
case Asc.c_oAscDeleteOptions.DeleteRows:
case c_oAscDeleteOptions.DeleteRows:
for (i = 0; i < this.aComments.length; i++) {
comment = new asc_CCommentData(this.aComments[i]);
if (comment.nRow > updateRange.r2) {
......
This diff is collapsed.
......@@ -6,6 +6,9 @@
* @param {undefined} undefined
*/
function (window, undefined) {
// Import
var c_oAscError = Asc.c_oAscError;
/** @enum */
var cElementType = {
number : 0,
......@@ -3839,7 +3842,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
} else if (this.operand_str == " ") {
continue;
} else {
this.error.push(Asc.c_oAscError.ID.FrmlWrongOperator);
this.error.push(c_oAscError.ID.FrmlWrongOperator);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -3864,7 +3867,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
found_operator = new cFormulaOperators[this.operand_str]();
this.operand_expected = true;
} else {
this.error.push(Asc.c_oAscError.ID.FrmlWrongOperator);
this.error.push(c_oAscError.ID.FrmlWrongOperator);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -3910,7 +3913,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
} else {
while (this.elemArr.length != 0 && !((top_elem = this.elemArr[this.elemArr.length - 1]).name == "(" )) {
if (top_elem.name in cFormulaOperators && this.operand_expected) {
this.error.push(Asc.c_oAscError.ID.FrmlOperandExpected);
this.error.push(c_oAscError.ID.FrmlOperandExpected);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -3922,7 +3925,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
if (this.elemArr.length == 0 || top_elem == null/* && !wasLeftParentheses */) {
this.outStack = [];
this.elemArr = [];
this.error.push(Asc.c_oAscError.ID.FrmlWrongCountParentheses);
this.error.push(c_oAscError.ID.FrmlWrongCountParentheses);
return false;
}
......@@ -3933,7 +3936,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
if (top_elem.getArguments() > func.getMaxArguments()) {
this.outStack = [];
this.elemArr = [];
this.error.push(Asc.c_oAscError.ID.FrmlWrongMaxArgument);
this.error.push(c_oAscError.ID.FrmlWrongMaxArgument);
return false;
} else {
if (top_elem.getArguments() >= func.getMinArguments()) {
......@@ -3941,7 +3944,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
} else {
this.outStack = [];
this.elemArr = [];
this.error.push(Asc.c_oAscError.ID.FrmlWrongCountArgument);
this.error.push(c_oAscError.ID.FrmlWrongCountArgument);
return false;
}
}
......@@ -3950,7 +3953,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
(!this.elemArr[this.elemArr.length - 1] || this.elemArr[this.elemArr.length - 1].name == "(" )) {
this.outStack = [];
this.elemArr = [];
this.error.push(Asc.c_oAscError.ID.FrmlAnotherParsingError);
this.error.push(c_oAscError.ID.FrmlAnotherParsingError);
return false;
}
// for (int i = 0; i < left_p.ParametersNum - 1; ++i)
......@@ -3987,14 +3990,14 @@ parserFormula.prototype.parse = function(local, digitDelim) {
}
if (this.operand_expected) {
this.error.push(Asc.c_oAscError.ID.FrmlWrongOperator);
this.error.push(c_oAscError.ID.FrmlWrongOperator);
this.outStack = [];
this.elemArr = [];
return false;
}
if (!wasLeftParentheses) {
this.error.push(Asc.c_oAscError.ID.FrmlWrongCountParentheses);
this.error.push(c_oAscError.ID.FrmlWrongCountParentheses);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -4025,7 +4028,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
} else {
this.outStack = [];
this.elemArr = [];
this.error.push(Asc.c_oAscError.ID.FrmlAnotherParsingError);
this.error.push(c_oAscError.ID.FrmlAnotherParsingError);
return false;
}
}
......@@ -4038,7 +4041,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
this.outStack = [];
this.elemArr = [];
/*в массиве используется недопустимый параметр*/
this.error.push(Asc.c_oAscError.ID.FrmlAnotherParsingError);
this.error.push(c_oAscError.ID.FrmlAnotherParsingError);
return false;
}
}
......@@ -4046,7 +4049,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
this.outStack = [];
this.elemArr = [];
/*размер массива не согласован*/
this.error.push(Asc.c_oAscError.ID.FrmlAnotherParsingError);
this.error.push(c_oAscError.ID.FrmlAnotherParsingError);
return false;
}
this.outStack.push(arr);
......@@ -4062,7 +4065,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
}
if (!this.operand_expected) {
this.error.push(Asc.c_oAscError.ID.FrmlWrongOperator);
this.error.push(c_oAscError.ID.FrmlWrongOperator);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -4091,7 +4094,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
};
if (!(wsF && wsT)) {
this.error.push(Asc.c_oAscError.ID.FrmlWrongReferences);
this.error.push(c_oAscError.ID.FrmlWrongReferences);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -4164,7 +4167,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
// if(found_operand.type==cElementType.error) {
// /*используется неверный именованный диапазон или таблица*/
// this.error.push( Asc.c_oAscError.ID.FrmlAnotherParsingError );
// this.error.push( c_oAscError.ID.FrmlAnotherParsingError );
// this.outStack = [];
// this.elemArr = [];
// return false;
......@@ -4195,7 +4198,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
if (this.operand_str != ".") {
found_operand = new cNumber(parseFloat(this.operand_str));
} else {
this.error.push(Asc.c_oAscError.ID.FrmlAnotherParsingError);
this.error.push(c_oAscError.ID.FrmlAnotherParsingError);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -4222,7 +4225,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
this.elemArr.push(found_operator);
this.f.push(found_operator);
} else {
this.error.push(Asc.c_oAscError.ID.FrmlWrongFunctionName);
this.error.push(c_oAscError.ID.FrmlWrongFunctionName);
this.outStack = [];
this.elemArr = [];
return false;
......@@ -4240,7 +4243,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
} else {
if (this.operand_str == null || this.operand_str == "'") {
this.outStack.push(new cError(cErrorType.wrong_name));
this.error.push(Asc.c_oAscError.ID.FrmlAnotherParsingError);
this.error.push(c_oAscError.ID.FrmlAnotherParsingError);
return this.isParsed = false;
}
if (parserHelp.isName.call(this, this.Formula, this.pCurrPos, this.wb, this.ws)[0]) {
......@@ -4266,7 +4269,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
if (this.operand_expected) {
this.outStack = [];
this.elemArr = [];
this.error.push(Asc.c_oAscError.ID.FrmlOperandExpected);
this.error.push(c_oAscError.ID.FrmlOperandExpected);
return false;
}
var operand, parenthesesNotEnough = false;
......@@ -4278,7 +4281,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
} else if (operand.name == "(" || operand.name == ")") {
this.outStack = [];
this.elemArr = [];
this.error.push(Asc.c_oAscError.ID.FrmlWrongCountParentheses);
this.error.push(c_oAscError.ID.FrmlWrongCountParentheses);
return false;
} else {
this.outStack.push(operand);
......@@ -4286,7 +4289,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
}
this.parenthesesNotEnough = parenthesesNotEnough;
if (this.parenthesesNotEnough) {
this.error.push(Asc.c_oAscError.ID.FrmlParenthesesCorrectCount);
this.error.push(c_oAscError.ID.FrmlParenthesesCorrectCount);
return this.isParsed = false;
}
......
"use strict";
// Import
var c_oAscLockTypeElem = AscCommonExcel.c_oAscLockTypeElem;
var c_oAscInsertOptions = Asc.c_oAscInsertOptions;
var c_oAscDeleteOptions = Asc.c_oAscDeleteOptions;
var c_oUndoRedoSerializeType =
{
Null:0,
......@@ -2976,7 +2981,7 @@ UndoRedoCell.prototype = {
nCol = collaborativeEditing.getLockOtherColumn2(nSheetId, nCol);
var oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(nCol, nRow, nCol, nRow);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3094,7 +3099,7 @@ UndoRedoWoorksheet.prototype = {
nCol = collaborativeEditing.getLockOtherColumn2(nSheetId, nCol);
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(nCol, nRow, nCol, nRow);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3137,7 +3142,7 @@ UndoRedoWoorksheet.prototype = {
}
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = range;
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3155,7 +3160,7 @@ UndoRedoWoorksheet.prototype = {
index = collaborativeEditing.getLockOtherRow2(nSheetId, index);
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(0, index, gc_nMaxCol0, index);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3182,7 +3187,7 @@ UndoRedoWoorksheet.prototype = {
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(0, from, gc_nMaxCol0, to);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3210,7 +3215,7 @@ UndoRedoWoorksheet.prototype = {
{
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(0, from, gc_nMaxCol0, to);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3219,11 +3224,11 @@ UndoRedoWoorksheet.prototype = {
if((true == bUndo && historyitem_Worksheet_AddRows == Type) || (false == bUndo && historyitem_Worksheet_RemoveRows == Type)) {
ws.removeRows(from, to);
bInsert = false;
operType = Asc.c_oAscDeleteOptions.DeleteRows;
operType = c_oAscDeleteOptions.DeleteRows;
} else {
ws.insertRowsBefore(from, to - from + 1);
bInsert = true;
operType = Asc.c_oAscInsertOptions.InsertRows;
operType = c_oAscInsertOptions.InsertRows;
}
// Нужно поменять пересчетные индексы для совместного редактирования (lock-элементы), но только если это не изменения от другого пользователя
......@@ -3246,7 +3251,7 @@ UndoRedoWoorksheet.prototype = {
{
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(from, 0, to, gc_nMaxRow0);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3256,11 +3261,11 @@ UndoRedoWoorksheet.prototype = {
if((true == bUndo && historyitem_Worksheet_AddCols == Type) || (false == bUndo && historyitem_Worksheet_RemoveCols == Type)) {
ws.removeCols(from, to);
bInsert = false;
operType = Asc.c_oAscDeleteOptions.DeleteColumns;
operType = c_oAscDeleteOptions.DeleteColumns;
} else {
ws.insertColsBefore(from, to - from + 1);
bInsert = true;
operType = Asc.c_oAscInsertOptions.InsertColumns;
operType = c_oAscInsertOptions.InsertColumns;
}
// Нужно поменять пересчетные индексы для совместного редактирования (lock-элементы), но только если это не изменения от другого пользователя
......@@ -3287,7 +3292,7 @@ UndoRedoWoorksheet.prototype = {
{
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(c1, r1, c2, r2);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3297,11 +3302,11 @@ UndoRedoWoorksheet.prototype = {
if((true == bUndo && historyitem_Worksheet_ShiftCellsLeft == Type) || (false == bUndo && historyitem_Worksheet_ShiftCellsRight == Type)) {
range.addCellsShiftRight();
bInsert = true;
operType = Asc.c_oAscInsertOptions.InsertCellsAndShiftRight;
operType = c_oAscInsertOptions.InsertCellsAndShiftRight;
} else {
range.deleteCellsShiftLeft();
bInsert = false;
operType = Asc.c_oAscDeleteOptions.DeleteCellsAndShiftLeft;
operType = c_oAscDeleteOptions.DeleteCellsAndShiftLeft;
}
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
......@@ -3324,7 +3329,7 @@ UndoRedoWoorksheet.prototype = {
{
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(c1, r1, c2, r2);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3334,11 +3339,11 @@ UndoRedoWoorksheet.prototype = {
if((true == bUndo && historyitem_Worksheet_ShiftCellsTop == Type) || (false == bUndo && historyitem_Worksheet_ShiftCellsBottom == Type)) {
range.addCellsShiftBottom();
bInsert = true;
operType = Asc.c_oAscInsertOptions.InsertCellsAndShiftDown;
operType = c_oAscInsertOptions.InsertCellsAndShiftDown;
} else {
range.deleteCellsShiftUp();
bInsert = false;
operType = Asc.c_oAscDeleteOptions.DeleteCellsAndShiftTop;
operType = c_oAscDeleteOptions.DeleteCellsAndShiftTop;
}
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
......@@ -3362,7 +3367,7 @@ UndoRedoWoorksheet.prototype = {
place.to = collaborativeEditing.getLockOtherRow2(nSheetId, place.to);
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(bbox.c1, place.from, bbox.c2, place.from);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......@@ -3625,7 +3630,7 @@ UndoRedoRowCol.prototype = {
var collaborativeEditing = this.wb.oApi.collaborativeEditing;
var oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = AscCommonExcel.c_oAscLockTypeElem.Range;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
if(this.bRow)
{
nIndex = collaborativeEditing.getLockOtherRow2(nSheetId, nIndex);
......
"use strict";
// Import
var cElementType = AscCommonExcel.cElementType;
var cArea3D = AscCommonExcel.cArea3D;
var cRef3D = AscCommonExcel.cRef3D;
var parserFormula = AscCommonExcel.parserFormula;
var c_oAscError = Asc.c_oAscError;
var c_oAscInsertOptions = Asc.c_oAscInsertOptions;
var c_oAscDeleteOptions = Asc.c_oAscDeleteOptions;
var c_oAscGetDefinedNamesList = Asc.c_oAscGetDefinedNamesList;
var c_oAscDefinedNameReason = Asc.c_oAscDefinedNameReason;
var g_nHSLMaxValue = 255;
var g_nVerticalTextAngle = 255;
var gc_dDefaultColWidthCharsAttribute;//определяется в WorksheetView.js
......@@ -2491,7 +2498,7 @@ Workbook.prototype.checkDefName = function ( checkName, scope ) {
var rxTest = rx_defName.test( checkName ), res = new Asc.asc_CCheckDefName();
if ( !rxTest ) {
res.status = false;
res.reason = Asc.c_oAscDefinedNameReason.WrongName;
res.reason = c_oAscDefinedNameReason.WrongName;
return res;
}
......@@ -2505,18 +2512,18 @@ Workbook.prototype.checkDefName = function ( checkName, scope ) {
defName = defName.getAscCDefName();
res.status = false;
if(defName.isLock){
res.reason = Asc.c_oAscDefinedNameReason.IsLocked;
res.reason = c_oAscDefinedNameReason.IsLocked;
}
else if( defName.Ref == null ){
res.reason = Asc.c_oAscDefinedNameReason.NameReserved;
res.reason = c_oAscDefinedNameReason.NameReserved;
}
else{
res.reason = Asc.c_oAscDefinedNameReason.Existed;
res.reason = c_oAscDefinedNameReason.Existed;
}
}
else{
res.status = true;
res.reason = Asc.c_oAscDefinedNameReason.OK;
res.reason = c_oAscDefinedNameReason.OK;
}
return res;
......@@ -2529,7 +2536,7 @@ Workbook.prototype.isDefinedNamesExists = function ( name, sheetId ) {
Workbook.prototype.getDefinedNamesWB = function (defNameListId) {
var names = [], name, thas = this, activeWS;
/*Asc.c_oAscGetDefinedNamesList.
/*c_oAscGetDefinedNamesList.
Worksheet : 0,
WorksheetWorkbook : 1,
All*/
......@@ -2553,17 +2560,17 @@ Workbook.prototype.getDefinedNamesWB = function (defNameListId) {
}
switch(defNameListId){
case Asc.c_oAscGetDefinedNamesList.Worksheet:
case Asc.c_oAscGetDefinedNamesList.WorksheetWorkbook:
case c_oAscGetDefinedNamesList.Worksheet:
case c_oAscGetDefinedNamesList.WorksheetWorkbook:
activeWS = this.getActiveWs();
getNames(activeWS.getId(),names);
if( Asc.c_oAscGetDefinedNamesList.WorksheetWorkbook ){
if( c_oAscGetDefinedNamesList.WorksheetWorkbook ){
getNames("WB",names);
}
break;
case Asc.c_oAscGetDefinedNamesList.All:
case c_oAscGetDefinedNamesList.All:
default:
for ( var id in this.dependencyFormulas.defNameList ) {
name = this.dependencyFormulas.defNameList[id].getAscCDefName()
......@@ -3667,7 +3674,7 @@ Woorksheet.prototype._removeRows=function(start, stop){
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RemoveRows, this.getId(), new Asc.Range(0, start, gc_nMaxCol0, gc_nMaxRow0), new UndoRedoData_FromToRowCol(true, start, stop));
this.autoFilters.insertRows( "delCell", new Asc.Range(0, start, gc_nMaxCol0, stop), Asc.c_oAscDeleteOptions.DeleteRows );
this.autoFilters.insertRows( "delCell", new Asc.Range(0, start, gc_nMaxCol0, stop), c_oAscDeleteOptions.DeleteRows );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -3726,7 +3733,7 @@ Woorksheet.prototype._insertRowsBefore=function(index, count){
History.LocalChange = false;
}
this.autoFilters.insertRows( "insCell", new Asc.Range(0, index, gc_nMaxCol0, index + count - 1), Asc.c_oAscInsertOptions.InsertColumns );
this.autoFilters.insertRows( "insCell", new Asc.Range(0, index, gc_nMaxCol0, index + count - 1), c_oAscInsertOptions.InsertColumns );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -3812,7 +3819,7 @@ Woorksheet.prototype._removeCols=function(start, stop){
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RemoveCols, this.getId(), new Asc.Range(start, 0, gc_nMaxCol0, gc_nMaxRow0), new UndoRedoData_FromToRowCol(false, start, stop));
this.autoFilters.insertColumn( "delCell", new Asc.Range(start, 0, stop, gc_nMaxRow0), Asc.c_oAscInsertOptions.InsertColumns );
this.autoFilters.insertColumn( "delCell", new Asc.Range(start, 0, stop, gc_nMaxRow0), c_oAscInsertOptions.InsertColumns );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -3853,7 +3860,7 @@ Woorksheet.prototype._insertColsBefore=function(index, count){
}
}
this.autoFilters.insertColumn( "insCells", new Asc.Range(index, 0, index + count - 1, gc_nMaxRow0), Asc.c_oAscInsertOptions.InsertColumns );
this.autoFilters.insertColumn( "insCells", new Asc.Range(index, 0, index + count - 1, gc_nMaxRow0), c_oAscInsertOptions.InsertColumns );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -4754,7 +4761,7 @@ Woorksheet.prototype._shiftCellsLeft=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsLeft, this.getId(), new Asc.Range(nLeft, oBBox.r1, gc_nMaxCol0, oBBox.r2), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertColumn( "delCell", oBBox, Asc.c_oAscDeleteOptions.DeleteCellsAndShiftLeft );
this.autoFilters.insertColumn( "delCell", oBBox, c_oAscDeleteOptions.DeleteCellsAndShiftLeft );
//todo проверить не уменьшились ли границы таблицы
};
Woorksheet.prototype._shiftCellsUp=function(oBBox){
......@@ -4797,7 +4804,7 @@ Woorksheet.prototype._shiftCellsUp=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsTop, this.getId(), new Asc.Range(oBBox.c1, oBBox.r1, oBBox.c2, gc_nMaxRow0), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertRows( "delCell", oBBox, Asc.c_oAscDeleteOptions.DeleteCellsAndShiftTop );
this.autoFilters.insertRows( "delCell", oBBox, c_oAscDeleteOptions.DeleteCellsAndShiftTop );
//todo проверить не уменьшились ли границы таблицы
};
Woorksheet.prototype._shiftCellsRight=function(oBBox){
......@@ -4835,7 +4842,7 @@ Woorksheet.prototype._shiftCellsRight=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsRight, this.getId(), new Asc.Range(oBBox.c1, oBBox.r1, gc_nMaxCol0, oBBox.r2), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertColumn( "insCells", oBBox, Asc.c_oAscInsertOptions.InsertCellsAndShiftRight );
this.autoFilters.insertColumn( "insCells", oBBox, c_oAscInsertOptions.InsertCellsAndShiftRight );
};
Woorksheet.prototype._shiftCellsBottom=function(oBBox){
//до перемещения ячеек, перед функцией, в которой используются nodesSheetArea/nodesSheetCell move/shift нужно обязательно вызвать force buildRecalc
......@@ -4870,7 +4877,7 @@ Woorksheet.prototype._shiftCellsBottom=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsBottom, this.getId(), new Asc.Range(oBBox.c1, oBBox.r1, oBBox.c2, gc_nMaxRow0), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertRows( "insCell", oBBox, Asc.c_oAscInsertOptions.InsertCellsAndShiftDown );
this.autoFilters.insertRows( "insCell", oBBox, c_oAscInsertOptions.InsertCellsAndShiftDown );
};
Woorksheet.prototype._setIndex=function(ind){
this.index = ind;
......@@ -5405,13 +5412,13 @@ Cell.prototype.setValue=function(val,callback, isCopyPaste){
this.formulaParsed = new parserFormula(val.substring(1),cellId,this.ws);
if( !this.formulaParsed.parse( gFormulaLocaleParse, gFormulaLocaleDigetSep ) ){
switch( this.formulaParsed.error[this.formulaParsed.error.length-1] ){
case Asc.c_oAscError.ID.FrmlWrongFunctionName:
case c_oAscError.ID.FrmlWrongFunctionName:
break;
case Asc.c_oAscError.ID.FrmlParenthesesCorrectCount:
case c_oAscError.ID.FrmlParenthesesCorrectCount:
this.setValue("="+this.formulaParsed.Formula, callback, isCopyPaste);
return;
default :{
wb.handlers.trigger("asc_onError",this.formulaParsed.error[this.formulaParsed.error.length-1], Asc.c_oAscError.Level.NoCritical);
wb.handlers.trigger("asc_onError",this.formulaParsed.error[this.formulaParsed.error.length-1], c_oAscError.Level.NoCritical);
if( callback )
callback(false);
if( oldFP !== undefined ){
......
"use strict";
// Import
var c_oAscCustomAutoFilter = Asc.c_oAscCustomAutoFilter;
var c_oAscCustomAutoFilter = Asc.c_oAscAutoFilterTypes;
var g_oColorManager = null;
var g_nNumsMaxId = 160;
var g_oDefaultXfId = null;
......@@ -4954,24 +4958,24 @@ FilterColumn.prototype.createFilter = function(obj) {
switch (obj.filter.type)
{
case Asc.c_oAscAutoFilterTypes.ColorFilter:
case c_oAscAutoFilterTypes.ColorFilter:
{
break;
}
case Asc.c_oAscAutoFilterTypes.CustomFilters:
case c_oAscAutoFilterTypes.CustomFilters:
{
this.CustomFiltersObj = obj.filter.filter.clone();
break;
}
case Asc.c_oAscAutoFilterTypes.DynamicFilter:
case c_oAscAutoFilterTypes.DynamicFilter:
{
break;
}
case Asc.c_oAscAutoFilterTypes.Top10:
case c_oAscAutoFilterTypes.Top10:
{
break;
}
case Asc.c_oAscAutoFilterTypes.Filters:
case c_oAscAutoFilterTypes.Filters:
{
newFilter = new Filters();
this.Filters = newFilter;
......@@ -5315,58 +5319,58 @@ CustomFilter.prototype.isHideValue = function(val) {
result = checkComplexSymbols;
else
{
if(this.Operator == Asc.c_oAscCustomAutoFilter.equals || this.Operator == Asc.c_oAscCustomAutoFilter.doesNotEqual)//общие для числа и текста
if(this.Operator == c_oAscCustomAutoFilter.equals || this.Operator == c_oAscCustomAutoFilter.doesNotEqual)//общие для числа и текста
{
filterVal = isNaN(this.Val) ? this.Val.toLowerCase() : this.Val;
if (this.Operator == Asc.c_oAscCustomAutoFilter.equals)//equals
if (this.Operator == c_oAscCustomAutoFilter.equals)//equals
{
if(val == filterVal)
result = true;
}
else if (this.Operator == Asc.c_oAscCustomAutoFilter.doesNotEqual)//doesNotEqual
else if (this.Operator == c_oAscCustomAutoFilter.doesNotEqual)//doesNotEqual
{
if(val != filterVal)
result = true;
}
}
else if((this.Operator == Asc.c_oAscCustomAutoFilter.isGreaterThan ||this.Operator == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo || this.Operator == Asc.c_oAscCustomAutoFilter.isLessThan || this.Operator == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo) && !isNaN(this.Val))//только для чисел
else if((this.Operator == c_oAscCustomAutoFilter.isGreaterThan ||this.Operator == c_oAscCustomAutoFilter.isGreaterThanOrEqualTo || this.Operator == c_oAscCustomAutoFilter.isLessThan || this.Operator == c_oAscCustomAutoFilter.isLessThanOrEqualTo) && !isNaN(this.Val))//только для чисел
{
filterVal = parseFloat(this.Val);
val = parseFloat(val);
switch (this.Operator)
{
case Asc.c_oAscCustomAutoFilter.isGreaterThan:
case c_oAscCustomAutoFilter.isGreaterThan:
if(val > filterVal)//isGreaterThan
result = true;
break;
case Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo:
case c_oAscCustomAutoFilter.isGreaterThanOrEqualTo:
if(val >= filterVal)//isGreaterThanOrEqualTo
result = true;
break;
case Asc.c_oAscCustomAutoFilter.isLessThan:
case c_oAscCustomAutoFilter.isLessThan:
if(val < filterVal)//isLessThan
result = true;
break;
case Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo:
case c_oAscCustomAutoFilter.isLessThanOrEqualTo:
if(val <= filterVal)//isLessThanOrEqualTo
result = true;
break;
}
}
else if(this.Operator == Asc.c_oAscCustomAutoFilter.beginsWith || this.Operator == Asc.c_oAscCustomAutoFilter.doesNotBeginWith || this.Operator == Asc.c_oAscCustomAutoFilter.endsWith || this.Operator == Asc.c_oAscCustomAutoFilter.doesNotEndWith || this.Operator == Asc.c_oAscCustomAutoFilter.contains || this.Operator == Asc.c_oAscCustomAutoFilter.doesNotContain)//только для текста
else if(this.Operator == c_oAscCustomAutoFilter.beginsWith || this.Operator == c_oAscCustomAutoFilter.doesNotBeginWith || this.Operator == c_oAscCustomAutoFilter.endsWith || this.Operator == c_oAscCustomAutoFilter.doesNotEndWith || this.Operator == c_oAscCustomAutoFilter.contains || this.Operator == c_oAscCustomAutoFilter.doesNotContain)//только для текста
{
filterVal = isNaN(this.Val) ? this.Val.toLowerCase() : this.Val;
switch (this.Operator)
{
case Asc.c_oAscCustomAutoFilter.beginsWith:
case c_oAscCustomAutoFilter.beginsWith:
if(!isDigitValue)
{
if(val.startsWith(filterVal))//beginsWith
result = true;
}
break;
case Asc.c_oAscCustomAutoFilter.doesNotBeginWith:
case c_oAscCustomAutoFilter.doesNotBeginWith:
if(!isDigitValue)
{
if(!val.startsWith(filterVal))//doesNotBeginWith
......@@ -5375,14 +5379,14 @@ CustomFilter.prototype.isHideValue = function(val) {
else
result = true;
break;
case Asc.c_oAscCustomAutoFilter.endsWith:
case c_oAscCustomAutoFilter.endsWith:
if(!isDigitValue)
{
if(val.endsWith(filterVal))//endsWith
result = true;
}
break;
case Asc.c_oAscCustomAutoFilter.doesNotEndWith:
case c_oAscCustomAutoFilter.doesNotEndWith:
if(!isDigitValue)
{
if(!val.endsWith(filterVal))//doesNotEndWith
......@@ -5391,14 +5395,14 @@ CustomFilter.prototype.isHideValue = function(val) {
else
result = true;
break;
case Asc.c_oAscCustomAutoFilter.contains:
case c_oAscCustomAutoFilter.contains:
if(!isDigitValue)
{
if(val.indexOf(filterVal) != -1)//contains
result = true;
}
break;
case Asc.c_oAscCustomAutoFilter.doesNotContain:
case c_oAscCustomAutoFilter.doesNotContain:
if(!isDigitValue)
{
if(val.indexOf(filterVal) == -1)//doesNotContain
......
This diff is collapsed.
......@@ -12,9 +12,12 @@
*/
function (window, undefined) {
// Import
var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {});
var prot;
var c_oAscSelectionType = asc.c_oAscSelectionType;
/** @const */
var kLeftLim1 = .999999999999999;
......@@ -436,11 +439,11 @@
getAllRange: function () {
var result;
if (Asc.c_oAscSelectionType.RangeMax === this.type)
if (c_oAscSelectionType.RangeMax === this.type)
result = new Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
else if (Asc.c_oAscSelectionType.RangeCol === this.type)
else if (c_oAscSelectionType.RangeCol === this.type)
result = new Range(this.c1, 0, this.c2, gc_nMaxRow0);
else if (Asc.c_oAscSelectionType.RangeRow === this.type)
else if (c_oAscSelectionType.RangeRow === this.type)
result = new Range(0, this.r1, gc_nMaxCol0, this.r2);
else
result = this.clone();
......@@ -469,7 +472,7 @@
ActiveRange.superclass.constructor.apply(this, arguments);
else
ActiveRange.superclass.constructor.call(this, 0, 0, 0, 0);
this.type = Asc.c_oAscSelectionType.RangeCells;
this.type = c_oAscSelectionType.RangeCells;
this.startCol = 0; // Активная ячейка в выделении
this.startRow = 0; // Активная ячейка в выделении
this._updateAdditionalData();
......@@ -567,17 +570,17 @@
this.startRow = this.r1;
}
//не меняем тип выделения, если это не выделение ячееек
// if(this.type == Asc.c_oAscSelectionType.RangeCells || this.type == Asc.c_oAscSelectionType.RangeCol ||
// this.type == Asc.c_oAscSelectionType.RangeRow || this.type == Asc.c_oAscSelectionType.RangeMax)
// if(this.type == c_oAscSelectionType.RangeCells || this.type == c_oAscSelectionType.RangeCol ||
// this.type == c_oAscSelectionType.RangeRow || this.type == c_oAscSelectionType.RangeMax)
// {
// if(0 == this.r1 && 0 == this.c1 && gc_nMaxRow0 == this.r2 && gc_nMaxCol0 == this.c2)
// this.type = Asc.c_oAscSelectionType.RangeMax;
// this.type = c_oAscSelectionType.RangeMax;
// else if(0 == this.r1 && gc_nMaxRow0 == this.r2)
// this.type = Asc.c_oAscSelectionType.RangeCol;
// this.type = c_oAscSelectionType.RangeCol;
// else if(0 == this.c1 && gc_nMaxCol0 == this.c2)
// this.type = Asc.c_oAscSelectionType.RangeRow;
// this.type = c_oAscSelectionType.RangeRow;
// else
// this.type = Asc.c_oAscSelectionType.RangeCells;
// this.type = c_oAscSelectionType.RangeCells;
// }
};
......@@ -764,13 +767,13 @@
var bCol = 0 == r1 && gc_nMaxRow0 == r2;
var bRow = 0 == c1 && gc_nMaxCol0 == c2;
if (bCol && bRow)
oActiveRange.type = Asc.c_oAscSelectionType.RangeMax;
oActiveRange.type = c_oAscSelectionType.RangeMax;
else if (bCol)
oActiveRange.type = Asc.c_oAscSelectionType.RangeCol;
oActiveRange.type = c_oAscSelectionType.RangeCol;
else if (bRow)
oActiveRange.type = Asc.c_oAscSelectionType.RangeRow;
oActiveRange.type = c_oAscSelectionType.RangeRow;
else
oActiveRange.type = Asc.c_oAscSelectionType.RangeCells;
oActiveRange.type = c_oAscSelectionType.RangeCells;
oActiveRange.startCol = oActiveRange.c1;
oActiveRange.startRow = oActiveRange.r1;
oCacheVal.activeRange = oActiveRange;
......
......@@ -17,9 +17,11 @@
* Import
* -----------------------------------------------------------------------------
*/
var cElementType = AscCommonExcel.cElementType;
var asc = window["Asc"];
var cElementType = AscCommonExcel.cElementType;
var c_oAscCellEditorSelectState = AscCommonExcel.c_oAscCellEditorSelectState;
var c_oAscCellEditorState = asc.c_oAscCellEditorState;
var asc_calcnpt = asc.calcNearestPt;
var asc_getcvt = asc.getCvtRatio;
......@@ -110,7 +112,7 @@
this.noUpdateMode = false;
this.selectionBegin = -1;
this.selectionEnd = -1;
this.isSelectMode = AscCommonExcel.c_oAscCellEditorSelectState.no;
this.isSelectMode = c_oAscCellEditorSelectState.no;
this.hasCursor = false;
this.hasFocus = false;
this.newTextFormat = undefined;
......@@ -121,7 +123,7 @@
this.isOpened = false;
this.callTopLineMouseup = false;
this.lastKeyCode = undefined;
this.m_nEditorState = Asc.c_oAscCellEditorState.editEnd; // Состояние редактора
this.m_nEditorState = c_oAscCellEditorState.editEnd; // Состояние редактора
this.isUpdateValue = true; // Обновлять ли состояние строки при вводе в TextArea
// Функции, которые будем отключать
......@@ -364,7 +366,7 @@
this.objAutoComplete = {};
// Сброс состояния редактора
this.m_nEditorState = Asc.c_oAscCellEditorState.editEnd;
this.m_nEditorState = c_oAscCellEditorState.editEnd;
this.handlers.trigger( "closed" );
return true;
};
......@@ -776,7 +778,7 @@
this.topLineIndex = 0;
this.selectionBegin = -1;
this.selectionEnd = -1;
this.isSelectMode = AscCommonExcel.c_oAscCellEditorSelectState.no;
this.isSelectMode = c_oAscCellEditorSelectState.no;
this.hasCursor = false;
this.undoList = [];
......@@ -1068,7 +1070,7 @@
if ( undefined === isFormula ) {
isFormula = this.isFormula();
}
var editorState = isFormula ? Asc.c_oAscCellEditorState.editFormula : "" === this._getFragmentsText( this.options.fragments ) ? Asc.c_oAscCellEditorState.editEmptyCell : Asc.c_oAscCellEditorState.editText;
var editorState = isFormula ? c_oAscCellEditorState.editFormula : "" === this._getFragmentsText( this.options.fragments ) ? c_oAscCellEditorState.editEmptyCell : c_oAscCellEditorState.editText;
if ( this.m_nEditorState !== editorState ) {
this.m_nEditorState = editorState;
......@@ -1833,7 +1835,7 @@
function doChangeSelection( coordTmp ) {
// ToDo реализовать для слова.
if ( AscCommonExcel.c_oAscCellEditorSelectState.word === t.isSelectMode ) {
if ( c_oAscCellEditorSelectState.word === t.isSelectMode ) {
return;
}
var pos = t._findCursorPosition( coordTmp );
......@@ -2589,7 +2591,7 @@
/** @param event {MouseEvent} */
CellEditor.prototype._onWindowMouseUp = function ( event ) {
this.isSelectMode = AscCommonExcel.c_oAscCellEditorSelectState.no;
this.isSelectMode = c_oAscCellEditorSelectState.no;
if ( this.callTopLineMouseup ) {
this._topLineMouseUp();
}
......@@ -2598,7 +2600,7 @@
/** @param event {MouseEvent} */
CellEditor.prototype._onWindowMouseMove = function ( event ) {
if ( AscCommonExcel.c_oAscCellEditorSelectState.no !== this.isSelectMode && !this.hasCursor ) {
if ( c_oAscCellEditorSelectState.no !== this.isSelectMode && !this.hasCursor ) {
this._changeSelection( this._getCoordinates( event ) );
}
return true;
......@@ -2619,7 +2621,7 @@
if ( 0 === event.button ) {
if ( 1 === this.clickCounter.getClickCount() % 2 ) {
this.isSelectMode = AscCommonExcel.c_oAscCellEditorSelectState.char;
this.isSelectMode = c_oAscCellEditorSelectState.char;
if ( !event.shiftKey ) {
this._showCursor();
pos = this._findCursorPosition( coord );
......@@ -2633,7 +2635,7 @@
}
else {
// Dbl click
this.isSelectMode = AscCommonExcel.c_oAscCellEditorSelectState.word;
this.isSelectMode = c_oAscCellEditorSelectState.word;
// Окончание слова
var endWord = this.textRender.getNextWord( this.cursorPos );
// Начало слова (ищем по окончанию, т.к. могли попасть в пробел)
......@@ -2652,7 +2654,7 @@
this.handlers.trigger( 'onContextMenu', event );
return true;
}
this.isSelectMode = AscCommonExcel.c_oAscCellEditorSelectState.no;
this.isSelectMode = c_oAscCellEditorSelectState.no;
return true;
};
......@@ -2661,7 +2663,7 @@
var coord = this._getCoordinates( event );
this.clickCounter.mouseMoveEvent( coord.x, coord.y );
this.hasCursor = true;
if ( AscCommonExcel.c_oAscCellEditorSelectState.no !== this.isSelectMode ) {
if ( c_oAscCellEditorSelectState.no !== this.isSelectMode ) {
this._changeSelection( coord );
}
return true;
......
......@@ -14,6 +14,7 @@
var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {});
var asc_applyFunction = asc.applyFunction;
var c_oTargetType = AscCommonExcel.c_oTargetType;
/**
* Desktop event controller for WorkbookView
......@@ -301,9 +302,9 @@
// Для формулы не нужно выходить из редактирования ячейки
if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectionDialogMode) {return true;}
if(this.targetInfo && (this.targetInfo.target == AscCommonExcel.c_oTargetType.MoveResizeRange ||
this.targetInfo.target == AscCommonExcel.c_oTargetType.MoveRange ||
this.targetInfo.target == AscCommonExcel.c_oTargetType.FillHandle))
if(this.targetInfo && (this.targetInfo.target == c_oTargetType.MoveResizeRange ||
this.targetInfo.target == c_oTargetType.MoveRange ||
this.targetInfo.target == c_oTargetType.FillHandle))
return true;
if (t.handlers.trigger("getCellEditMode")) {if (!t.handlers.trigger("stopCellEditing")) {return true;}}
......@@ -1234,31 +1235,31 @@
return;
}
if (t.targetInfo){
if (t.targetInfo.target === AscCommonExcel.c_oTargetType.ColumnResize || t.targetInfo.target === AscCommonExcel.c_oTargetType.RowResize) {
if (t.targetInfo.target === c_oTargetType.ColumnResize || t.targetInfo.target === c_oTargetType.RowResize) {
t.isResizeMode = true;
t._resizeElement(event);
return;
} else if (t.targetInfo && t.targetInfo.target === AscCommonExcel.c_oTargetType.FillHandle && false === this.settings.isViewerMode) {
} else if (t.targetInfo && t.targetInfo.target === c_oTargetType.FillHandle && false === this.settings.isViewerMode) {
// В режиме автозаполнения
this.isFillHandleMode = true;
t._changeFillHandle(event);
return;
} else if (t.targetInfo && t.targetInfo.target === AscCommonExcel.c_oTargetType.MoveRange && false === this.settings.isViewerMode) {
} else if (t.targetInfo && t.targetInfo.target === c_oTargetType.MoveRange && false === this.settings.isViewerMode) {
// В режиме перемещения диапазона
this.isMoveRangeMode = true;
t._moveRangeHandle(event);
return;
} else if (t.targetInfo && t.targetInfo.target === AscCommonExcel.c_oTargetType.FilterObject) {
} else if (t.targetInfo && t.targetInfo.target === c_oTargetType.FilterObject) {
t._autoFiltersClick(t.targetInfo.idFilter);
return;
} else if (t.targetInfo && undefined !== t.targetInfo.commentIndexes && false === this.settings.isViewerMode) {
t._commentCellClick(event);
} else if ( t.targetInfo && t.targetInfo.target === AscCommonExcel.c_oTargetType.MoveResizeRange && false === this.settings.isViewerMode ){
} else if ( t.targetInfo && t.targetInfo.target === c_oTargetType.MoveResizeRange && false === this.settings.isViewerMode ){
this.isMoveResizeRange = true;
t._moveResizeRangeHandle(event, t.targetInfo);
return;
} else if (t.targetInfo && (t.targetInfo.target === AscCommonExcel.c_oTargetType.FrozenAnchorV ||
t.targetInfo.target === AscCommonExcel.c_oTargetType.FrozenAnchorH) && false === this.settings.isViewerMode) {
} else if (t.targetInfo && (t.targetInfo.target === c_oTargetType.FrozenAnchorV ||
t.targetInfo.target === c_oTargetType.FrozenAnchorH) && false === this.settings.isViewerMode) {
// Режим установки закреплённых областей
this.frozenAnchorMode = t.targetInfo.target;
t._moveFrozenAnchorHandle(event, this.frozenAnchorMode);
......@@ -1276,7 +1277,7 @@
} else {
if (t.isFormulaEditMode) {
// !!! в зависимости от цели делаем разные действия - либо селектим область либо мувим существующий диапазон
if ( t.targetInfo && t.targetInfo.target === AscCommonExcel.c_oTargetType.MoveResizeRange && false === this.settings.isViewerMode ){
if ( t.targetInfo && t.targetInfo.target === c_oTargetType.MoveResizeRange && false === this.settings.isViewerMode ){
this.isMoveResizeRange = true;
t._moveResizeRangeHandle(event, t.targetInfo);
return;
......@@ -1306,7 +1307,7 @@
if (2 === event.button) {
t.handlers.trigger("changeSelectionRightClick", coord.x, coord.y);
} else {
if (t.targetInfo && t.targetInfo.target === AscCommonExcel.c_oTargetType.FillHandle && false === this.settings.isViewerMode){
if (t.targetInfo && t.targetInfo.target === c_oTargetType.FillHandle && false === this.settings.isViewerMode){
// В режиме автозаполнения
t.isFillHandleMode = true;
t._changeFillHandle(event);
......
This diff is collapsed.
This diff is collapsed.
"use strict";
/* DrawingObjects.js
*
* Author: Dmitry Vikulov
* Date: 13/08/2012
*/
if ( !window["Asc"] ) { // Для вставки диаграмм в Word
window["Asc"] = {};
}
// Import
var c_oAscError = Asc.c_oAscError;
var c_oAscInsertOptions = Asc.c_oAscInsertOptions;
var c_oAscDeleteOptions = Asc.c_oAscDeleteOptions;
var c_oAscSelectionType = Asc.c_oAscSelectionType;
function isObject(what) {
return ( (what != null) && (typeof(what) == "object") );
}
......@@ -2012,7 +2012,7 @@ function DrawingObjects() {
var addImageObject = function (_image) {
if (!_image.Image) {
worksheet.model.workbook.handlers.trigger("asc_onError", Asc.c_oAscError.ID.UplImageUrl, Asc.c_oAscError.Level.NoCritical);
worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical);
} else {
var drawingObject = _this.createDrawingObject();
......@@ -2093,7 +2093,7 @@ function DrawingObjects() {
var addImageObject = function (_image) {
if ( !_image.Image ) {
worksheet.model.workbook.handlers.trigger("asc_onError", Asc.c_oAscError.ID.UplImageUrl, Asc.c_oAscError.Level.NoCritical);
worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical);
}
else {
if ( api.isImageChangeUrl ) {
......@@ -2670,7 +2670,7 @@ function DrawingObjects() {
{ // Insert
switch (operType)
{
case Asc.c_oAscInsertOptions.InsertColumns:
case c_oAscInsertOptions.InsertColumns:
{
count = updateRange.c2 - updateRange.c1 + 1;
// Position
......@@ -2686,11 +2686,11 @@ function DrawingObjects() {
}
break;
case Asc.c_oAscInsertOptions.InsertCellsAndShiftRight:
case c_oAscInsertOptions.InsertCellsAndShiftRight:
break;
case Asc.c_oAscInsertOptions.InsertRows:
case c_oAscInsertOptions.InsertRows:
{
// Position
count = updateRange.r2 - updateRange.r1 + 1;
......@@ -2706,7 +2706,7 @@ function DrawingObjects() {
metrics = null;
}
break;
case Asc.c_oAscInsertOptions.InsertCellsAndShiftDown:
case c_oAscInsertOptions.InsertCellsAndShiftDown:
break;
}
......@@ -2714,7 +2714,7 @@ function DrawingObjects() {
else { // Delete
switch (operType)
{
case Asc.c_oAscDeleteOptions.DeleteColumns:
case c_oAscDeleteOptions.DeleteColumns:
{
// Position
......@@ -2759,12 +2759,12 @@ function DrawingObjects() {
}
break;
case Asc.c_oAscDeleteOptions.DeleteCellsAndShiftLeft:
case c_oAscDeleteOptions.DeleteCellsAndShiftLeft:
// Range
break;
case Asc.c_oAscDeleteOptions.DeleteRows:
case c_oAscDeleteOptions.DeleteRows:
{
// Position
......@@ -2808,7 +2808,7 @@ function DrawingObjects() {
}
break;
case Asc.c_oAscDeleteOptions.DeleteCellsAndShiftTop:
case c_oAscDeleteOptions.DeleteCellsAndShiftTop:
// Range
break;
......@@ -3239,7 +3239,7 @@ function DrawingObjects() {
function imageLoaded(_image) {
if ( !_image.Image ) {
worksheet.model.workbook.handlers.trigger("asc_onError", Asc.c_oAscError.ID.UplImageUrl, Asc.c_oAscError.Level.NoCritical);
worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical);
}
else
_this.showDrawingObjects(true);
......@@ -3582,21 +3582,21 @@ function DrawingObjects() {
}
if(selection.chartSelection && selection.chartSelection.selection.textSelection)
{
return Asc.c_oAscSelectionType.RangeChartText;
return c_oAscSelectionType.RangeChartText;
}
if(selection.textSelection)
{
return Asc.c_oAscSelectionType.RangeShapeText;
return c_oAscSelectionType.RangeShapeText;
}
if(selected_objects[0] )
{
if(selected_objects[0].getObjectType() === historyitem_type_ChartSpace && selected_objects.length === 1)
return Asc.c_oAscSelectionType.RangeChart;
return c_oAscSelectionType.RangeChart;
if(selected_objects[0].getObjectType() === historyitem_type_ImageShape)
return Asc.c_oAscSelectionType.RangeImage;
return c_oAscSelectionType.RangeImage;
return Asc.c_oAscSelectionType.RangeShape;
return c_oAscSelectionType.RangeShape;
}
return undefined;
......
......@@ -2,6 +2,9 @@
var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {});
// Import
var c_oAscError = Asc.c_oAscError;
var contentchanges_Add = 1;
var contentchanges_Remove = 2;
......@@ -263,7 +266,7 @@ function CheckStockChart(oDrawingObjects, oApi)
{
if(chartSpace.chart.plotArea.charts[0].series.length !== 4)
{
oApi.asc_fireCallback("asc_onError", Asc.c_oAscError.ID.StockChartError, Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError", c_oAscError.ID.StockChartError, c_oAscError.Level.NoCritical);
oApi.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
return false;
}
......@@ -7163,10 +7166,10 @@ DrawingObjectsController.prototype =
{
var editor = window["Asc"]["editor"];
var check = parserHelp.checkDataRange(editor.wbModel, editor.wb, Asc.c_oAscSelectionDialogType.Chart, props.ChartProperties.range, true, !props.ChartProperties.inColumns, props.ChartProperties.type);
if(check === Asc.c_oAscError.ID.StockChartError || check === Asc.c_oAscError.ID.DataRangeError
|| check === Asc.c_oAscError.ID.MaxDataSeriesError)
if(check === c_oAscError.ID.StockChartError || check === c_oAscError.ID.DataRangeError
|| check === c_oAscError.ID.MaxDataSeriesError)
{
editor.wbModel.handlers.trigger("asc_onError", check, Asc.c_oAscError.Level.NoCritical);
editor.wbModel.handlers.trigger("asc_onError", check, c_oAscError.Level.NoCritical);
this.drawingObjects.sendGraphicObjectProps();
return;
}
......@@ -8502,7 +8505,7 @@ function CreateImageDrawingObject(imageUrl, options, drawingObjects) {
var addImageObject = function (_image) {
if ( !_image.Image ) {
worksheet.model.workbook.handlers.trigger("asc_onError", Asc.c_oAscError.ID.UplImageUrl, Asc.c_oAscError.Level.NoCritical);
worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical);
}
else {
......
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
/** @constructor */
......@@ -109,8 +112,8 @@ baseEditorsApi.prototype._baseInit = function() {
// init OnMessage
InitOnMessage(function(error, url) {
if (Asc.c_oAscError.ID.No !== error) {
t.sendEvent("asc_onError", error, Asc.c_oAscError.Level.NoCritical);
if (c_oAscError.ID.No !== error) {
t.sendEvent("asc_onError", error, c_oAscError.Level.NoCritical);
} else {
t._addImageUrl(url);
}
......@@ -407,7 +410,7 @@ baseEditorsApi.prototype._coAuthoringInit = function() {
t._onEndPermissions();
};
this.CoAuthoringApi.onWarning = function(e) {
t.sendEvent('asc_onError', Asc.c_oAscError.ID.Warning, Asc.c_oAscError.Level.NoCritical);
t.sendEvent('asc_onError', c_oAscError.ID.Warning, c_oAscError.Level.NoCritical);
};
/**
* Event об отсоединении от сервера
......@@ -424,7 +427,7 @@ baseEditorsApi.prototype._coAuthoringInit = function() {
t.sendEvent('asc_onCoAuthoringDisconnect');
// И переходим в режим просмотра т.к. мы не можем сохранить файл
t.asc_setViewMode(true);
t.sendEvent('asc_onError', isCloseCoAuthoring ? Asc.c_oAscError.ID.UserDrop : Asc.c_oAscError.ID.CoAuthoringDisconnect, Asc.c_oAscError.Level.NoCritical);
t.sendEvent('asc_onError', isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
}
};
this.CoAuthoringApi.onDocumentOpen = function(inputWrap) {
......@@ -450,14 +453,14 @@ baseEditorsApi.prototype._coAuthoringInit = function() {
})
}
} else {
t.sendEvent("asc_onError", Asc.c_oAscError.ID.ConvertationError, Asc.c_oAscError.Level.Critical);
t.sendEvent("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.Critical);
}
break;
case "needparams":
t._onNeedParams(input["data"]);
break;
case "err":
t.sendEvent("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), Asc.c_oAscError.Level.Critical);
t.sendEvent("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.Critical);
break;
}
break;
......@@ -466,7 +469,7 @@ baseEditorsApi.prototype._coAuthoringInit = function() {
t.fCurCallback(input);
t.fCurCallback = null;
} else {
t.sendEvent("asc_onError", Asc.c_oAscError.ID.Unknown, Asc.c_oAscError.Level.NoCritical);
t.sendEvent("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.NoCritical);
}
break;
}
......@@ -522,21 +525,21 @@ baseEditorsApi.prototype.asc_addImage = function() {
ShowImageFileDialog(this.documentId, this.documentUserId, function(error, files) {
t._uploadCallback(error, files);
}, function(error) {
if (Asc.c_oAscError.ID.No !== error) {
t.sendEvent("asc_onError", error, Asc.c_oAscError.Level.NoCritical);
if (c_oAscError.ID.No !== error) {
t.sendEvent("asc_onError", error, c_oAscError.Level.NoCritical);
}
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
};
baseEditorsApi.prototype._uploadCallback = function(error, files) {
var t = this;
if (Asc.c_oAscError.ID.No !== error) {
this.sendEvent("asc_onError", error, Asc.c_oAscError.Level.NoCritical);
if (c_oAscError.ID.No !== error) {
this.sendEvent("asc_onError", error, c_oAscError.Level.NoCritical);
} else {
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
UploadImageFiles(files, this.documentId, this.documentUserId, function(error, url) {
if (Asc.c_oAscError.ID.No !== error) {
t.sendEvent("asc_onError", error, Asc.c_oAscError.Level.NoCritical);
if (c_oAscError.ID.No !== error) {
t.sendEvent("asc_onError", error, c_oAscError.Level.NoCritical);
} else {
t._addImageUrl(url);
}
......
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
function CDocumentReaderMode()
{
this.DefaultFontSize = 12;
......@@ -2495,7 +2498,7 @@ function sendImgUrls(api, images, callback, bExcel) {
api.fCurCallback = function (input) {
api.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
var nError = Asc.c_oAscError.ID.No;
var nError = c_oAscError.ID.No;
var data;
if (null != input && "imgurls" == input["type"]) {
if ("ok" == input["status"]) {
......@@ -2512,13 +2515,13 @@ function sendImgUrls(api, images, callback, bExcel) {
nError = g_fMapAscServerErrorToAscError(parseInt(input["data"]));
}
} else {
nError = Asc.c_oAscError.ID.Unknown;
nError = c_oAscError.ID.Unknown;
}
if ( Asc.c_oAscError.ID.No !== nError ) {
if ( c_oAscError.ID.No !== nError ) {
if(!bExcel)
api.asc_fireCallback("asc_onError", nError, Asc.c_oAscError.Level.NoCritical);
api.asc_fireCallback("asc_onError", nError, c_oAscError.Level.NoCritical);
else
api.handlers.trigger("asc_onError", nError, Asc.c_oAscError.Level.NoCritical);
api.handlers.trigger("asc_onError", nError, c_oAscError.Level.NoCritical);
}
if (!data) {
//todo сделать функцию очистки, чтобы можно было оборвать paste и показать error
......
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
/////////////////////////////////////////////////////////
////////////// OPEN ////////////////////////
/////////////////////////////////////////////////////////
......@@ -17,7 +20,7 @@ asc_docs_api.prototype._OfflineAppDocumentEndLoad = function(_url, _data)
g_oIdCounter.m_sUserId = window["AscDesktopEditor"]["CheckUserId"]();
if (_data == "")
{
this.sendEvent("asc_onError", Asc.c_oAscError.ID.ConvertationError, Asc.c_oAscError.Level.Critical);
this.sendEvent("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.Critical);
return;
}
......@@ -160,7 +163,7 @@ window["DesktopOfflineAppDocumentEndSave"] = function(error)
editor.LastUserSavedIndex = undefined;
if (2 == error)
editor.sendEvent("asc_onError", Asc.c_oAscError.ID.ConvertationError, Asc.c_oAscError.Level.Critical);
editor.sendEvent("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.Critical);
};
asc_docs_api.prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
......
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
var c_oSerFormat = {
Version : 1,
Signature : "PPTY"
......@@ -1804,13 +1807,13 @@ asc_docs_api.prototype.ShapeApply = function(prop)
image_url = firstUrl;
fApplyCallback();
} else {
oApi.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
} else {
oApi.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
}
} else {
oApi.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
oApi.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
};
......@@ -2722,13 +2725,13 @@ asc_docs_api.prototype.AddImageUrl = function(url){
if(firstUrl) {
t.AddImageUrlAction(firstUrl);
} else {
t.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
} else {
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
}
} else {
t.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
};
......@@ -2899,13 +2902,13 @@ asc_docs_api.prototype.ImgApply = function(obj){
ImagePr.ImageUrl = firstUrl;
fApplyCallback();
} else {
oApi.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
} else {
oApi.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
}
} else {
oApi.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
oApi.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
};
......@@ -4690,7 +4693,7 @@ asc_docs_api.prototype._onOpenCommand = function(data) {
var t = this;
g_fOpenFileCommand(data, this.documentUrlChanges, c_oSerFormat.Signature, function (error, result) {
if (error || !result.bSerFormat) {
t.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.Critical);
t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
return;
}
......@@ -4730,20 +4733,20 @@ function _downloadAs(editor, filetype, actionType, options)
else
dataContainer.data = editor.WordControl.SaveDocument();
var fCallback = function(input) {
var error = Asc.c_oAscError.ID.Unknown;
var error = c_oAscError.ID.Unknown;
if(null != input && command == input["type"]) {
if('ok' == input["status"]){
var url = input["data"];
if(url) {
error = Asc.c_oAscError.ID.No;
error = c_oAscError.ID.No;
editor.processSavedFile(url, options.downloadType);
}
} else {
error = g_fMapAscServerErrorToAscError(parseInt(input["data"]));
}
}
if (Asc.c_oAscError.ID.No != error) {
editor.asc_fireCallback("asc_onError", error, Asc.c_oAscError.Level.NoCritical);
if (c_oAscError.ID.No != error) {
editor.asc_fireCallback("asc_onError", error, c_oAscError.Level.NoCritical);
}
if (actionType) {
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, actionType);
......
......@@ -20,6 +20,9 @@
// TODO: Поскольку, расстояния до/после параграфа для первого и последнего параграфов
// в ячейке зависит от следующей и предыдущей ячеек, надо включать их в пересчет
// Import
var c_oAscError = Asc.c_oAscError;
var table_Selection_Cell = 0x00; // Селектим целыми ячейками
......@@ -9916,7 +9919,7 @@ CTable.prototype =
// Сообщение об ошибке : "Value Rows must be between 1 and " + VMerge_count
var ErrData = new CErrorData();
ErrData.put_Value( VMerge_count );
editor.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.SplitCellMaxRows,Asc.c_oAscError.Level.NoCritical, ErrData );
editor.asc_fireCallback("asc_onError",c_oAscError.ID.SplitCellMaxRows,c_oAscError.Level.NoCritical, ErrData );
return false;
}
else if ( 0 != VMerge_count % Rows )
......@@ -9924,7 +9927,7 @@ CTable.prototype =
// Сообщение об ошибке : "Value must be a divisor of the number " + VMerge_count
var ErrData = new CErrorData();
ErrData.put_Value( VMerge_count );
editor.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.SplitCellRowsDivider,Asc.c_oAscError.Level.NoCritical, ErrData );
editor.asc_fireCallback("asc_onError",c_oAscError.ID.SplitCellRowsDivider,c_oAscError.Level.NoCritical, ErrData );
return false;
}
}
......@@ -9950,7 +9953,7 @@ CTable.prototype =
// Сообщение об ошибке : "Value Cols must be a between 1 and " + MaxCols
var ErrData = new CErrorData();
ErrData.put_Value( MaxCols );
editor.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.SplitCellMaxCols,Asc.c_oAscError.Level.NoCritical, ErrData );
editor.asc_fireCallback("asc_onError",c_oAscError.ID.SplitCellMaxCols,c_oAscError.Level.NoCritical, ErrData );
return false;
}
}
......
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
/////////////////////////////////////////////////////////
////////////// OPEN ////////////////////////
/////////////////////////////////////////////////////////
......@@ -17,7 +20,7 @@ asc_docs_api.prototype._OfflineAppDocumentEndLoad = function(_url, _data)
g_oIdCounter.m_sUserId = window["AscDesktopEditor"]["CheckUserId"]();
if (_data == "")
{
this.sendEvent("asc_onError", Asc.c_oAscError.ID.ConvertationError, Asc.c_oAscError.Level.Critical);
this.sendEvent("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.Critical);
return;
}
if (c_oSerFormat.Signature !== _data.substring(0, c_oSerFormat.Signature.length))
......@@ -184,7 +187,7 @@ window["DesktopOfflineAppDocumentEndSave"] = function(error)
editor.LastUserSavedIndex = undefined;
if (2 == error)
editor.sendEvent("asc_onError", Asc.c_oAscError.ID.ConvertationError, Asc.c_oAscError.Level.NoCritical);
editor.sendEvent("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.NoCritical);
};
asc_docs_api.prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
......
......@@ -5,6 +5,9 @@
* Time: 12:01
*/
// Import
var c_oAscError = Asc.c_oAscError;
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с MailMerge
//----------------------------------------------------------------------------------------------------------------------
......@@ -128,12 +131,12 @@ asc_docs_api.prototype.asc_sendMailMergeData = function(oData)
}
else
{
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
}
}
else
{
t.asc_fireCallback("asc_onError", Asc.c_oAscError.ID.Unknown, Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.NoCritical);
}
t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, actionType);
});
......@@ -148,7 +151,7 @@ asc_docs_api.prototype.asc_DownloadAsMailMerge = function(typeFile, StartIndex,
if (null != oDocumentMailMerge)
{
var actionType = null;
var options = {oDocumentMailMerge: oDocumentMailMerge, downloadType: DownloadType.MailMerge, errorDirect: Asc.c_oAscError.ID.MailMergeSaveFile};
var options = {oDocumentMailMerge: oDocumentMailMerge, downloadType: DownloadType.MailMerge, errorDirect: c_oAscError.ID.MailMergeSaveFile};
if (bIsDownload) {
actionType = c_oAscAsyncAction.DownloadMerge;
options.downloadType = DownloadType.None;
......
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
function CAscSection()
{
this.PageWidth = 0;
......@@ -724,7 +727,7 @@ asc_docs_api.prototype.OpenDocument2 = function(url, gObject)
this.FontLoader.LoadDocumentFonts(this.WordControl.m_oLogicDocument.Fonts, false);
}
else
editor.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.MobileUnexpectedCharCount,Asc.c_oAscError.Level.Critical);
editor.asc_fireCallback("asc_onError",c_oAscError.ID.MobileUnexpectedCharCount,c_oAscError.Level.Critical);
//callback
editor.DocumentOrientation = (null == editor.WordControl.m_oLogicDocument) ? true : !editor.WordControl.m_oLogicDocument.Orientation;
......@@ -2056,13 +2059,13 @@ asc_docs_api.prototype.processSavedFile = function(url, downloadType) {
this.mailMergeFileData = null;
g_fLoadFileContent(url, function(result) {
if (null === result) {
t.asc_fireCallback("asc_onError", Asc.c_oAscError.ID.MailMergeLoadFile, Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError", c_oAscError.ID.MailMergeLoadFile, c_oAscError.Level.NoCritical);
return;
}
try {
t.asc_StartMailMergeByList(JSON.parse(result));
} catch (e) {
t.asc_fireCallback("asc_onError", Asc.c_oAscError.ID.MailMergeLoadFile, Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError", c_oAscError.ID.MailMergeLoadFile, c_oAscError.Level.NoCritical);
}
});
} else {
......@@ -4556,13 +4559,13 @@ asc_docs_api.prototype.AddImageUrl = function(url, imgProp)
if(firstUrl) {
t.AddImageUrlAction(firstUrl, imgProp);
} else {
t.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
} else {
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
}
} else {
t.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
};
......@@ -4875,13 +4878,13 @@ asc_docs_api.prototype.ImgApply = function(obj)
fReplaceCallback(firstUrl);
fApplyCallback();
} else {
oApi.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
} else {
oApi.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
}
} else {
oApi.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.NoCritical);
oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
}
oApi.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
};
......@@ -6685,7 +6688,7 @@ asc_docs_api.prototype._onOpenCommand = function(data) {
var t = this;
g_fOpenFileCommand(data, this.documentUrlChanges, c_oSerFormat.Signature, function (error, result) {
if (error) {
t.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.Unknown,Asc.c_oAscError.Level.Critical);
t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
return;
}
......@@ -6791,16 +6794,16 @@ function _downloadAs(editor, command, filetype, actionType, options, fCallbackRe
var fCallback = null;
if (!options.isNoCallback) {
fCallback = function (input) {
var error = Asc.c_oAscError.ID.Unknown;
var error = c_oAscError.ID.Unknown;
//input = {'type': command, 'status': 'err', 'data': -80};
if (null != input && command == input['type']) {
if ('ok' == input['status']){
if (options.isNoUrl) {
error = Asc.c_oAscError.ID.No;
error = c_oAscError.ID.No;
} else {
var url = input['data'];
if (url) {
error = Asc.c_oAscError.ID.No;
error = c_oAscError.ID.No;
editor.processSavedFile(url, options.downloadType);
}
}
......@@ -6808,8 +6811,8 @@ function _downloadAs(editor, command, filetype, actionType, options, fCallbackRe
error = g_fMapAscServerErrorToAscError(parseInt(input["data"]));
}
}
if (Asc.c_oAscError.ID.No != error) {
editor.asc_fireCallback('asc_onError', options.errorDirect || error, Asc.c_oAscError.Level.NoCritical);
if (c_oAscError.ID.No != error) {
editor.asc_fireCallback('asc_onError', options.errorDirect || error, c_oAscError.Level.NoCritical);
}
// Меняем тип состояния (на никакое)
editor.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
......@@ -7134,7 +7137,7 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve
this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
}
else
this.asc_fireCallback("asc_onError", Asc.c_oAscError.ID.MobileUnexpectedCharCount, Asc.c_oAscError.Level.Critical);
this.asc_fireCallback("asc_onError", c_oAscError.ID.MobileUnexpectedCharCount, c_oAscError.Level.Critical);
}
else
{
......@@ -7147,7 +7150,7 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve
this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
}
else
this.asc_fireCallback("asc_onError",Asc.c_oAscError.ID.MobileUnexpectedCharCount,Asc.c_oAscError.Level.Critical);
this.asc_fireCallback("asc_onError",c_oAscError.ID.MobileUnexpectedCharCount,c_oAscError.Level.Critical);
}
if (window["NATIVE_EDITOR_ENJINE"] === true && undefined != window["native"])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment