Commit 6bc9c2eb authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 33891

parent a02b7b1c
...@@ -309,6 +309,54 @@ ...@@ -309,6 +309,54 @@
window['AscDFH'].CChangesDrawingsContentLong = CChangesDrawingsContentLong; window['AscDFH'].CChangesDrawingsContentLong = CChangesDrawingsContentLong;
function CChangesDrawingsContentLongMap(Class, Type, Pos, Items, isAdd){
CChangesDrawingsContentLongMap.superclass.constructor.call(this, Class, Type, Pos, Items, isAdd);
}
AscCommon.extendClass(CChangesDrawingsContentLongMap, AscDFH.CChangesDrawingsContentLong);
CChangesDrawingsContentLongMap.prototype.private_InsertInArrayLoad = function () {
if (this.PosArray.length <= 0 || this.Items.length <= 0)
return;
var aChangedArray = this.private_GetChangedArray();
if (null !== aChangedArray) {
for (var i = 0; i < this.Items.length; ++i) {
aChangedArray[this.PosArray[i]] = this.Items[i];
}
}
};
CChangesDrawingsContentLongMap.prototype.private_RemoveInArrayLoad = function () {
var aChangedArray = this.private_GetChangedArray();
if (null !== aChangedArray) {
for (var i = 0; i < this.PosArray.length; ++i) {
aChangedArray[this.PosArray[i]] = null;
}
}
};
CChangesDrawingsContentLongMap.prototype.private_InsertInArrayUndoRedo = function () {
var aChangedArray = this.private_GetChangedArray();
if (null !== aChangedArray) {
for (var i = 0; i < this.Items.length; ++i) {
aChangedArray[this.Pos + i] = this.Items[i];
}
}
};
CChangesDrawingsContentLongMap.prototype.private_RemoveInArrayUndoRedo = function () {
var aChangedArray = this.private_GetChangedArray();
if (null !== aChangedArray) {
for (var i = 0; i < this.Items.length; ++i) {
aChangedArray[this.Pos + i] = null;
}
}
};
window['AscDFH'].CChangesDrawingsContentLongMap = CChangesDrawingsContentLongMap;
function CChangesDrawingChangeTheme(Class, Type, aIndexes){ function CChangesDrawingChangeTheme(Class, Type, aIndexes){
this.Type = Type; this.Type = Type;
this.aIndexes = aIndexes; this.aIndexes = aIndexes;
......
...@@ -65,6 +65,7 @@ var asc_CShapeProperty = Asc.asc_CShapeProperty; ...@@ -65,6 +65,7 @@ var asc_CShapeProperty = Asc.asc_CShapeProperty;
var CChangesDrawingsObject = AscDFH.CChangesDrawingsObject; var CChangesDrawingsObject = AscDFH.CChangesDrawingsObject;
var CChangesDrawingsContentNoId = AscDFH.CChangesDrawingsContentNoId; var CChangesDrawingsContentNoId = AscDFH.CChangesDrawingsContentNoId;
var CChangesDrawingsContentLong = AscDFH.CChangesDrawingsContentLong; var CChangesDrawingsContentLong = AscDFH.CChangesDrawingsContentLong;
var CChangesDrawingsContentLongMap = AscDFH.CChangesDrawingsContentLongMap;
var drawingsChangesMap = window['AscDFH'].drawingsChangesMap; var drawingsChangesMap = window['AscDFH'].drawingsChangesMap;
...@@ -196,7 +197,7 @@ var asc_CShapeProperty = Asc.asc_CShapeProperty; ...@@ -196,7 +197,7 @@ var asc_CShapeProperty = Asc.asc_CShapeProperty;
AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetGeometry] = CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetGeometry] = CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetFill] = CChangesDrawingsObjectNoId; AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetFill] = CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetLn] = CChangesDrawingsObjectNoId; AscDFH.changesFactory[AscDFH.historyitem_SpPr_SetLn] = CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_ClrMap_SetClr] = CChangesDrawingsContentLong; AscDFH.changesFactory[AscDFH.historyitem_ClrMap_SetClr] = CChangesDrawingsContentLongMap;
AscDFH.changesFactory[AscDFH.historyitem_ExtraClrScheme_SetClrScheme] = CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_ExtraClrScheme_SetClrScheme] = CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ExtraClrScheme_SetClrMap] = CChangesDrawingsObject; AscDFH.changesFactory[AscDFH.historyitem_ExtraClrScheme_SetClrMap] = CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ThemeSetColorScheme] = CChangesDrawingsObjectNoId; AscDFH.changesFactory[AscDFH.historyitem_ThemeSetColorScheme] = CChangesDrawingsObjectNoId;
...@@ -5878,6 +5879,7 @@ ClrScheme.prototype = ...@@ -5878,6 +5879,7 @@ ClrScheme.prototype =
Write_ToBinary: function (w) Write_ToBinary: function (w)
{ {
w.WriteLong(this.colors.length); w.WriteLong(this.colors.length);
w.WriteString2(this.name);
for(var i = 0; i < this.colors.length; ++i) for(var i = 0; i < this.colors.length; ++i)
{ {
w.WriteBool(isRealObject(this.colors[i])); w.WriteBool(isRealObject(this.colors[i]));
...@@ -5886,11 +5888,13 @@ ClrScheme.prototype = ...@@ -5886,11 +5888,13 @@ ClrScheme.prototype =
this.colors[i].Write_ToBinary(w); this.colors[i].Write_ToBinary(w);
} }
} }
}, },
Read_FromBinary: function (r) Read_FromBinary: function (r)
{ {
var len = r.GetLong(); var len = r.GetLong();
this.name = r.GetString2();
for(var i = 0; i < len; ++i) for(var i = 0; i < len; ++i)
{ {
if(r.GetBool()) if(r.GetBool())
...@@ -5903,6 +5907,7 @@ ClrScheme.prototype = ...@@ -5903,6 +5907,7 @@ ClrScheme.prototype =
this.colors[i] = null; this.colors[i] = null;
} }
} }
}, },
setName: function(name) setName: function(name)
...@@ -5985,7 +5990,6 @@ ClrMap.prototype = ...@@ -5985,7 +5990,6 @@ ClrMap.prototype =
setClr: function(index, clr) setClr: function(index, clr)
{ {
History.Add(new CChangesDrawingsContentLong(this, AscDFH.historyitem_ClrMap_SetClr, index, [clr], true)); History.Add(new CChangesDrawingsContentLong(this, AscDFH.historyitem_ClrMap_SetClr, index, [clr], true));
this.color_map[index] = clr; this.color_map[index] = clr;
} }
......
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