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

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into develop

parents 8853411e 1602d4b9
This diff is collapsed.
......@@ -6034,14 +6034,14 @@
oTo.BestFit = oFrom.BestFit;
oTo.setHidden(oFrom.hd);
if(null != oFrom.xfs)
oTo.xfs = oFrom.xfs.clone();
oTo.setStyle(oFrom.xfs);
else if(null != oFrom.xfsid)
{
var xfs = oThis.aCellXfs[oFrom.xfsid];
if(null != xfs)
{
oFrom.xfs = xfs;
oTo.xfs = xfs.clone();
oTo.setStyle(xfs);
}
}
if(null != oFrom.width)
......
......@@ -6192,7 +6192,7 @@
}
};
Cell.prototype.setStyleInternal = function(xfs) {
this.xfs = xfs;
this.xfs = g_StyleCache.addXf(xfs);
this._hasChanged = true;
};
Cell.prototype.getFormula=function(){
......
......@@ -2805,7 +2805,7 @@ StyleManager.prototype =
return this.xfs.list.length;
};
StyleCache.prototype._add = function(container, newVal) {
if (undefined === newVal.getIndexNumber()) {
if (newVal && undefined === newVal.getIndexNumber()) {
var hash = newVal.getHash();
var res = container.vals[hash];
if (!res) {
......@@ -3211,25 +3211,14 @@ Col.prototype =
setStyle : function(xfs)
{
var oldVal = this.xfs;
var newVal = null;
this.xfs = null;
if(null != xfs)
{
this.xfs = xfs.clone();
newVal = xfs;
}
if(History.Is_On() && false == ((null == oldVal && null == newVal) || (null != oldVal && null != newVal && true == oldVal.isEqual(newVal))))
{
if(null != oldVal)
oldVal = oldVal.clone();
if(null != newVal)
newVal = newVal.clone();
History.Add(AscCommonExcel.g_oUndoRedoCol, AscCH.historyitem_RowCol_SetStyle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, newVal));
this.setStyleInternal(xfs);
if (History.Is_On() && oldVal !== this.xfs) {
History.Add(AscCommonExcel.g_oUndoRedoCol, AscCH.historyitem_RowCol_SetStyle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, this.xfs));
}
},
setStyleInternal : function(xfs)
{
this.xfs = xfs;
this.xfs = g_StyleCache.addXf(xfs);
},
setCellStyle : function(val)
{
......@@ -3524,15 +3513,14 @@ Row.prototype =
setStyle : function(xfs)
{
var oldVal = this.xfs;
this.xfs = xfs;
this._hasChanged = true;
if (History.Is_On() && oldVal != this.xfs) {
this.setStyleInternal(xfs);
if (History.Is_On() && oldVal !== this.xfs) {
History.Add(AscCommonExcel.g_oUndoRedoRow, AscCH.historyitem_RowCol_SetStyle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oldVal, this.xfs));
}
},
setStyleInternal : function(xfs)
{
this.xfs = xfs;
this.xfs = g_StyleCache.addXf(xfs);
this._hasChanged = true;
},
setCellStyle : function(val)
......
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