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

delete wb from cName, cRef3D, cRef

ws in this classes now is ref to worksheet
delete renameSheet, change renameSheetCopy, removeSheet and moveSheet methods
parent 234e44e9
......@@ -982,19 +982,6 @@ $( function () {
} );
test( "Test: rename sheet #1", function () {
oParser = new parserFormula( "Лист2!A2", "A1", ws );
ok( oParser.parse() );
// strictEqual( oParser.parse(), true)
strictEqual( oParser.renameSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2" );
oParser = new parserFormula( "Лист2:Лист3!A2", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.renameSheet( "Лист2", "Лист1" ).assemble(), "Лист1:Лист3!A2" );
oParser = new parserFormula( "Лист2!A2:A5", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.renameSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2:A5" );
ws = wb.getWorksheet( 0 );
ws.getRange2( "S95" ).setValue( "2" );
ws = wb.getWorksheet( 1 );
......
......@@ -3276,7 +3276,7 @@ cMIRR.prototype.Calculate = function ( arg ) {
} )
}
else if ( arg0 instanceof cArea3D ) {
if ( arg0.wsFrom == arg0.wsTo ) {
if ( arg0.isSingleSheet() ) {
valueArray = arg0.getMatrix()[0];
}
else
......@@ -5872,7 +5872,7 @@ cXIRR.prototype.Calculate = function ( arg ) {
} )
}
else if ( arg0 instanceof cArea3D ) {
if ( arg0.wsFrom == arg0.wsTo ) {
if ( arg0.isSingleSheet() ) {
_values = arg0.getMatrix()[0];
}
else {
......@@ -5915,7 +5915,7 @@ cXIRR.prototype.Calculate = function ( arg ) {
} )
}
else if ( arg1 instanceof cArea3D ) {
if ( arg1.wsFrom == arg1.wsTo ) {
if ( arg1.isSingleSheet() ) {
_dates = arg1.getMatrix()[0];
}
else {
......@@ -6052,7 +6052,7 @@ cXNPV.prototype.Calculate = function ( arg ) {
} )
}
else if ( arg1 instanceof cArea3D ) {
if ( arg1.wsFrom == arg1.wsTo ) {
if ( arg1.isSingleSheet() ) {
valueArray = arg1.getMatrix()[0];
}
else {
......@@ -6092,7 +6092,7 @@ cXNPV.prototype.Calculate = function ( arg ) {
// dateArray = arg2.getMatrix();
}
else if ( arg2 instanceof cArea3D ) {
if ( arg2.wsFrom == arg2.wsTo ) {
if ( arg2.isSingleSheet() ) {
dateArray = arg2.getMatrix()[0];
}
else {
......
......@@ -576,16 +576,16 @@
function parseReference() {
if ((ref = parserHelp.is3DRef.call(o, o.Formula, o.pCurrPos))[0]) {
var _wsFrom = ref[1], _wsTo = ( (ref[2] !== null) && (ref[2] !== undefined) ) ? ref[2] : _wsFrom;
var wsFrom = wb.getWorksheetByName(_wsFrom);
if (!(wsFrom && wb.getWorksheetByName(_wsTo))) {
var wsFrom = wb.getWorksheetByName(ref[1]);
var wsTo = (null !== ref[2]) ? wb.getWorksheetByName(ref[2]) : wsFrom;
if (!(wsFrom && wsTo)) {
return t.value = new cError(cErrorType.bad_reference);
}
if (parserHelp.isArea.call(o, o.Formula, o.pCurrPos)) {
found_operand = new cArea3D(o.operand_str.toUpperCase(), _wsFrom, _wsTo, wb);
found_operand = new cArea3D(o.operand_str.toUpperCase(), wsFrom, wsTo);
} else if (parserHelp.isRef.call(o, o.Formula, o.pCurrPos)) {
if (_wsTo != _wsFrom) {
found_operand = new cArea3D(o.operand_str.toUpperCase(), _wsFrom, _wsTo, wb);
if (wsTo !== wsFrom) {
found_operand = new cArea3D(o.operand_str.toUpperCase(), wsFrom, wsTo);
} else {
found_operand = new cRef3D(o.operand_str.toUpperCase(), wsFrom);
}
......@@ -595,7 +595,7 @@
} else if (parserHelp.isRef.call(o, o.Formula, o.pCurrPos, true)) {
found_operand = new cRef(o.operand_str.toUpperCase(), r1.worksheet);
} else if (parserHelp.isName.call(o, o.Formula, o.pCurrPos, wb)[0]) {
found_operand = new AscCommonExcel.cName(o.operand_str, wb, r1.worksheet);
found_operand = new AscCommonExcel.cName(o.operand_str, r1.worksheet);
}
}
......@@ -957,7 +957,6 @@
return this.value = new cError(cErrorType.bad_reference);
}
var wsName = arg0.ws.getName();
if (box.r1 == box.r2 && box.c1 == box.c2) {
ref = g_oCellAddressUtils.colnumToColstrFromWsView(box.c1 + 1) + _getRowTitle(box.r1);
this.value = (cElementType.cell === arg0.type) ? new cRef(ref, arg0.ws) : new cRef3D(ref, arg0.ws);
......@@ -965,7 +964,7 @@
ref = g_oCellAddressUtils.colnumToColstrFromWsView(box.c1 + 1) + _getRowTitle(box.r1) + ":" +
g_oCellAddressUtils.colnumToColstrFromWsView(box.c2 + 1) + _getRowTitle(box.r2);
this.value =
(cElementType.cell === arg0.type) ? new cArea(ref, arg0.ws) : new cArea3D(ref, wsName, wsName, arg0.wb);
(cElementType.cell === arg0.type) ? new cArea(ref, arg0.ws) : new cArea3D(ref, arg0.ws, arg0.ws);
}
} else if (cElementType.cellsRange === arg0.type) {
......
This diff is collapsed.
......@@ -1574,9 +1574,8 @@
var wsActive = this.getActiveWs();
var oWsFrom = this.aWorksheets[indexFrom];
var tempW = {
wFN: oWsFrom.getName(),
wF: oWsFrom,
wFI: indexFrom,
wFId: oWsFrom.getId(),
wTI: indexTo
};
//wTI index insert before
......@@ -1584,7 +1583,7 @@
tempW.wTI++;
this.dependencyFormulas.lockRecal();
var collectDependencies = [];
this.dependencyFormulas.changeSheet(tempW.wFId, {replace: tempW}, null, collectDependencies);
this.dependencyFormulas.changeSheet(oWsFrom.getId(), {replace: tempW}, null, collectDependencies);
//move sheets
var movedSheet = this.aWorksheets.splice(indexFrom, 1);
this.aWorksheets.splice(indexTo, 0, movedSheet[0]);
......
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