Commit 2306602a authored by Alexander.Trofimov's avatar Alexander.Trofimov

cell/model/FormulaObjects/lookupandreferenceFunctions to function-closure

parent 7056efbb
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
*/ */
"use strict"; "use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
function _getRowTitle( row ) { function _getRowTitle( row ) {
return "" + (row + 1); return "" + (row + 1);
} }
...@@ -317,8 +323,6 @@ function cGETPIVOTDATA() { ...@@ -317,8 +323,6 @@ function cGETPIVOTDATA() {
cGETPIVOTDATA.prototype = Object.create( cBaseFunction.prototype ); cGETPIVOTDATA.prototype = Object.create( cBaseFunction.prototype );
var g_oHLOOKUPCache = new VHLOOKUPCache( true );
function cHLOOKUP() { function cHLOOKUP() {
// cBaseFunction.call( this, "HLOOKUP" ); // cBaseFunction.call( this, "HLOOKUP" );
// this.setArgumentsMin( 3 ); // this.setArgumentsMin( 3 );
...@@ -1395,7 +1399,6 @@ VHLOOKUPCache.prototype.clean = function () { ...@@ -1395,7 +1399,6 @@ VHLOOKUPCache.prototype.clean = function () {
this.cacheId = {}; this.cacheId = {};
this.cacheRanges = {}; this.cacheRanges = {};
}; };
var g_oVLOOKUPCache = new VHLOOKUPCache( false );
function cVLOOKUP() { function cVLOOKUP() {
// cBaseFunction.call( this, "VLOOKUP" ); // cBaseFunction.call( this, "VLOOKUP" );
...@@ -1635,3 +1638,12 @@ cVLOOKUP.prototype.getInfo = function () { ...@@ -1635,3 +1638,12 @@ cVLOOKUP.prototype.getInfo = function () {
args:"( lookup-value , table-array , col-index-num [ , [ range-lookup-flag ] ] )" args:"( lookup-value , table-array , col-index-num [ , [ range-lookup-flag ] ] )"
}; };
}; };
var g_oVLOOKUPCache = new VHLOOKUPCache( false );
var g_oHLOOKUPCache = new VHLOOKUPCache( true );
//----------------------------------------------------------export----------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
window['AscCommonExcel'].g_oVLOOKUPCache = g_oVLOOKUPCache;
window['AscCommonExcel'].g_oHLOOKUPCache = g_oHLOOKUPCache;
})(window);
...@@ -1852,8 +1852,8 @@ function sortDependency( wb, setCellFormat ) { ...@@ -1852,8 +1852,8 @@ function sortDependency( wb, setCellFormat ) {
for (i in oCleanCellCacheArea) for (i in oCleanCellCacheArea)
wb.handlers.trigger("cleanCellCache", i, oCleanCellCacheArea[i], AscCommonExcel.c_oAscCanChangeColWidth.numbers); wb.handlers.trigger("cleanCellCache", i, oCleanCellCacheArea[i], AscCommonExcel.c_oAscCanChangeColWidth.numbers);
g_oVLOOKUPCache.clean(); AscCommonExcel.g_oVLOOKUPCache.clean();
g_oHLOOKUPCache.clean(); AscCommonExcel.g_oHLOOKUPCache.clean();
} }
wb.needRecalc = {nodes: {}, length:0}; wb.needRecalc = {nodes: {}, length:0};
} }
...@@ -5184,8 +5184,8 @@ Woorksheet.prototype._RecalculatedFunctions=function(cell,bad,setCellFormat){ ...@@ -5184,8 +5184,8 @@ Woorksheet.prototype._RecalculatedFunctions=function(cell,bad,setCellFormat){
__cell.oValue.type = CellValueType.String; __cell.oValue.type = CellValueType.String;
__cell.oValue.text = res.getValue().toString(); __cell.oValue.text = res.getValue().toString();
} }
g_oVLOOKUPCache.remove(__cell); AscCommonExcel.g_oVLOOKUPCache.remove(__cell);
g_oHLOOKUPCache.remove(__cell); AscCommonExcel.g_oHLOOKUPCache.remove(__cell);
__cell.setFormulaCA(res.ca); __cell.setFormulaCA(res.ca);
if(setCellFormat){ if(setCellFormat){
if( res.numFormat !== undefined && res.numFormat >= 0){ if( res.numFormat !== undefined && res.numFormat >= 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