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

setFill history

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