Commit 4eb825e3 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

Cell.setValue добавлен параметр isCopyPaste

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58859 954022d7-b5bf-4e40-9824-e11837661b57
parent 65d7fc0b
...@@ -4133,20 +4133,24 @@ Cell.prototype.setFormula=function(val, bAddToHistory){ ...@@ -4133,20 +4133,24 @@ Cell.prototype.setFormula=function(val, bAddToHistory){
this.sFormula = val; this.sFormula = val;
this.oValue.cleanCache(); this.oValue.cleanCache();
}; };
Cell.prototype.setValue=function(val,callback){ Cell.prototype.setValue=function(val,callback, isCopyPaste){
var ret = true; var ret = true;
var DataOld = null; var DataOld = null;
if(History.Is_On()) if(History.Is_On())
DataOld = this.getValueData(); DataOld = this.getValueData();
var sNumFormat; var bIsTextFormat = false;
if(null != this.xfs && null != this.xfs.num) if(!isCopyPaste){
sNumFormat = this.xfs.num.f; var sNumFormat;
else if(null != this.xfs && null != this.xfs.num)
sNumFormat = g_oDefaultNum.f; sNumFormat = this.xfs.num.f;
var numFormat = oNumFormatCache.get(sNumFormat); else
sNumFormat = g_oDefaultNum.f;
var numFormat = oNumFormatCache.get(sNumFormat);
bIsTextFormat = numFormat.isTextFormat();
}
var wb = this.ws.workbook; var wb = this.ws.workbook;
var ws = this.ws; var ws = this.ws;
if(false == numFormat.isTextFormat()) if(false == bIsTextFormat)
{ {
/* /*
Устанавливаем значение в Range ячеек. При этом происходит проверка значения на формулу. Устанавливаем значение в Range ячеек. При этом происходит проверка значения на формулу.
...@@ -4192,7 +4196,7 @@ Cell.prototype.setValue=function(val,callback){ ...@@ -4192,7 +4196,7 @@ Cell.prototype.setValue=function(val,callback){
var sheetId = this.ws.getId(); var sheetId = this.ws.getId();
if (this.sFormula) if (this.sFormula)
wb.dependencyFormulas.deleteMasterNodes2( ws.Id, this.oId.getID() ); wb.dependencyFormulas.deleteMasterNodes2( ws.Id, this.oId.getID() );
if( !(null != val && val[0] != "=" || true == numFormat.isTextFormat())) if( !(null != val && val[0] != "=" || true == bIsTextFormat))
addToArrRecalc(this.ws.getId(), this); addToArrRecalc(this.ws.getId(), this);
wb.needRecalc.nodes[getVertexId(sheetId,this.oId.getID())] = [sheetId, this.oId.getID()]; wb.needRecalc.nodes[getVertexId(sheetId,this.oId.getID())] = [sheetId, this.oId.getID()];
wb.needRecalc.length++; wb.needRecalc.length++;
...@@ -4200,7 +4204,7 @@ Cell.prototype.setValue=function(val,callback){ ...@@ -4200,7 +4204,7 @@ Cell.prototype.setValue=function(val,callback){
this.sFormula = null; this.sFormula = null;
this.setFormulaCA(false); this.setFormulaCA(false);
if(val){ if(val){
if(false == numFormat.isTextFormat() && val[0] == "=" && val.length > 1){ if(false == bIsTextFormat && val[0] == "=" && val.length > 1){
this.setFormula( val.substring(1) ); this.setFormula( val.substring(1) );
} }
else { else {
...@@ -5002,11 +5006,11 @@ Range.prototype.getCells=function(){ ...@@ -5002,11 +5006,11 @@ Range.prototype.getCells=function(){
} }
return aResult; return aResult;
}; };
Range.prototype.setValue=function(val,callback){ Range.prototype.setValue=function(val,callback, isCopyPaste){
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
this._foreach(function(cell){ this._foreach(function(cell){
cell.setValue(val,callback); cell.setValue(val,callback, isCopyPaste);
// if(cell.isEmpty()) // if(cell.isEmpty())
// cell.Remove(); // cell.Remove();
}); });
......
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