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