Commit 0497050b authored by Sergey Konovalov's avatar Sergey Konovalov

setFill history

parent 9b17e62d
...@@ -2525,7 +2525,14 @@ StyleManager.prototype = ...@@ -2525,7 +2525,14 @@ StyleManager.prototype =
fill.bg = val; fill.bg = val;
val = fill; val = fill;
} }
return this._setProperty(oItemWithXfs, val, "fill", g_StyleCache.addFill); var oRes = this._setProperty(oItemWithXfs, val, "fill", g_StyleCache.addFill);
if (oRes.oldVal) {
oRes.oldVal = oRes.oldVal.bg;
}
if (oRes.newVal) {
oRes.newVal = oRes.newVal.bg;
}
return oRes;
}, },
setBorder : function(oItemWithXfs, val) setBorder : function(oItemWithXfs, val)
{ {
...@@ -2749,14 +2756,18 @@ StyleManager.prototype = ...@@ -2749,14 +2756,18 @@ StyleManager.prototype =
return this._add(this.xfs, newXf); return this._add(this.xfs, newXf);
}; };
StyleCache.prototype._add = function(container, newVal) { StyleCache.prototype._add = function(container, newVal) {
var hash = newVal.getHash(); if (undefined === newVal.getIndexNumber()) {
var res = container.vals[hash]; var hash = newVal.getHash();
if (!res) { var res = container.vals[hash];
newVal.setIndexNumber(container.count++); if (!res) {
container.vals[hash] = newVal; newVal.setIndexNumber(container.count++);
res = newVal; container.vals[hash] = newVal;
res = newVal;
}
return res;
} else {
return newVal;
} }
return res;
}; };
var g_StyleCache = new StyleCache(); var g_StyleCache = new StyleCache();
......
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