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

Bug 27255 - MS Excel считает поврежденной книгу, в которой форматированная...

Bug 27255 - MS Excel считает поврежденной книгу, в которой форматированная таблица построена по числовым заголовкам.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59289 954022d7-b5bf-4e40-9824-e11837661b57
parent 85c68291
...@@ -4280,7 +4280,13 @@ Cell.prototype.setValueCleanFormula = function (array) { ...@@ -4280,7 +4280,13 @@ Cell.prototype.setValueCleanFormula = function (array) {
wb.needRecalc.length++; wb.needRecalc.length++;
}; };
Cell.prototype.setType=function(type){ Cell.prototype.setType=function(type){
return this.oValue.type = type; if(type != this.oValue.type){
var DataOld = this.getValueData();
this.oValue.setValueType(type);
var DataNew = this.getValueData();
History.Add(g_oUndoRedoCell, historyitem_Cell_ChangeValue, this.ws.getId(), new Asc.Range(this.oId.getCol0(), this.oId.getRow0(), this.oId.getCol0(), this.oId.getRow0()), new UndoRedoData_CellSimpleData(this.oId.getRow0(), this.oId.getCol0(), DataOld, DataNew));
}
return this.oValue.type;
}; };
Cell.prototype.getType=function(){ Cell.prototype.getType=function(){
return this.oValue.type; return this.oValue.type;
...@@ -5658,6 +5664,18 @@ Range.prototype.setVerticalText=function(val){ ...@@ -5658,6 +5664,18 @@ Range.prototype.setVerticalText=function(val){
cell.setVerticalText(val); cell.setVerticalText(val);
}); });
}; };
Range.prototype.setType=function(type){
History.Create_NewPoint();
this.createCellOnRowColCross();
var fSetProperty = this._setProperty;
var nRangeType = this._getRangeType();
if(c_oRangeType.All == nRangeType)
fSetProperty = this._setPropertyNoEmpty;
fSetProperty.call(this, null, null,
function(cell){
cell.setType(type);
});
};
Range.prototype.getType=function(){ Range.prototype.getType=function(){
var cell = this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1); var cell = this.worksheet._getCellNoEmpty(this.bbox.r1,this.bbox.c1);
if(null != cell) if(null != cell)
......
...@@ -3450,6 +3450,15 @@ CCellValue.prototype = ...@@ -3450,6 +3450,15 @@ CCellValue.prototype =
{ {
return this._setFontProp(function(format){return val != format.va;}, function(format){format.va = val;}); return this._setFontProp(function(format){return val != format.va;}, function(format){format.va = val;});
}, },
setValueType : function(type)
{
if(CellValueType.String == type && null != this.number)
{
this.text = this.number.toString();
this.number = null;
}
this.type = type;
},
getType : function() getType : function()
{ {
return UndoRedoDataTypes.CellValue; return UndoRedoDataTypes.CellValue;
......
...@@ -4020,7 +4020,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -4020,7 +4020,7 @@ var gUndoInsDelCellsFlag = true;
if(null != tableColumn && null != tableColumn.Name && !startRedo && isSetVal) if(null != tableColumn && null != tableColumn.Name && !startRedo && isSetVal)
{ {
range.setValue(tableColumn.Name); range.setValue(tableColumn.Name);
range.setNumFormat("@"); range.setType(CellValueType.String);
} }
} }
} }
...@@ -6452,14 +6452,14 @@ var gUndoInsDelCellsFlag = true; ...@@ -6452,14 +6452,14 @@ var gUndoInsDelCellsFlag = true;
if(val != "" && intersection.c1 <= j && intersection.c2 >= j ) if(val != "" && intersection.c1 <= j && intersection.c2 >= j )
{ {
filter.TableColumns[j - tableRange.c1].Name = val; filter.TableColumns[j - tableRange.c1].Name = val;
cell.setNumFormat("@"); cell.setType(CellValueType.String);
} }
else if(val == "")//если пустая изменяем генерируем имя и добавляем его в TableColumns else if(val == "")//если пустая изменяем генерируем имя и добавляем его в TableColumns
{ {
filter.TableColumns[j - tableRange.c1].Name = ""; filter.TableColumns[j - tableRange.c1].Name = "";
generateName = this._generateColumnName(filter.TableColumns); generateName = this._generateColumnName(filter.TableColumns);
cell.setValue(generateName); cell.setValue(generateName);
cell.setNumFormat("@"); cell.setType(CellValueType.String);
filter.TableColumns[j - tableRange.c1].Name = generateName; filter.TableColumns[j - tableRange.c1].Name = generateName;
} }
} }
......
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