Commit 811087b0 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51252 954022d7-b5bf-4e40-9824-e11837661b57
parent adafb270
...@@ -343,9 +343,9 @@ CColorModifiers.prototype = ...@@ -343,9 +343,9 @@ CColorModifiers.prototype =
var count = Reader.GetLong(); var count = Reader.GetLong();
for(var i = 0; i < count; ++i) for(var i = 0; i < count; ++i)
{ {
var cur_mod = {}; var cur_mod = new CColorMod();
cur_mod.name = Reader.GetString2(); cur_mod.setName(Reader.GetString2());
cur_mod.val = Reader.GetLong(); cur_mod.setVal(Reader.GetLong());
this.Mods.push(cur_mod); this.Mods.push(cur_mod);
} }
return this; return this;
...@@ -713,7 +713,7 @@ CSysColor.prototype = ...@@ -713,7 +713,7 @@ CSysColor.prototype =
Read_FromBinary2 : function(Reader) Read_FromBinary2 : function(Reader)
{ {
this.id = Reader.GetString2(); this.setColorId(Reader.GetString2());
this.RGBA = ReadObjectLong(Reader); this.RGBA = ReadObjectLong(Reader);
}, },
...@@ -819,7 +819,7 @@ CPrstColor.prototype = ...@@ -819,7 +819,7 @@ CPrstColor.prototype =
Read_FromBinary2 : function(Reader) Read_FromBinary2 : function(Reader)
{ {
this.id = Reader.GetString2(); this.setColorId(Reader.GetString2());
this.RGBA = ReadObjectLong(Reader); this.RGBA = ReadObjectLong(Reader);
}, },
...@@ -930,7 +930,9 @@ CRGBColor.prototype = ...@@ -930,7 +930,9 @@ CRGBColor.prototype =
Write_ToBinary2 : function(Writer) Write_ToBinary2 : function(Writer)
{ {
Writer.WriteLong(this.type); Writer.WriteLong(this.type);
WriteObjectLong(Writer, this.RGBA); var RGBA = {R:0, G:0, B:0, A:255};
WriteObjectLong(Writer, RGBA);
this.setColor(((RGBA.R << 16) & 0xFF0000) + ((RGBA.G << 8) & 0xFF00) + RGBA.B);
}, },
Read_FromBinary2 : function(Reader) Read_FromBinary2 : function(Reader)
...@@ -1029,7 +1031,7 @@ CSchemeColor.prototype = ...@@ -1029,7 +1031,7 @@ CSchemeColor.prototype =
Read_FromBinary2 : function(Reader) Read_FromBinary2 : function(Reader)
{ {
this.id = Reader.GetLong(); this.setColorId(Reader.GetLong());
this.RGBA = ReadObjectLong(Reader); this.RGBA = ReadObjectLong(Reader);
}, },
...@@ -1200,31 +1202,38 @@ CUniColor.prototype = ...@@ -1200,31 +1202,38 @@ CUniColor.prototype =
{ {
case COLOR_TYPE_SCHEME: case COLOR_TYPE_SCHEME:
{ {
this.color = new CSchemeColor(); this.setColor(new CSchemeColor());
this.color.Read_FromBinary2(Reader); this.color.Read_FromBinary2(Reader);
break; break;
} }
case COLOR_TYPE_SRGB: case COLOR_TYPE_SRGB:
{ {
this.color = new CRGBColor(); this.setColor(new CRGBColor());
this.color.Read_FromBinary2(Reader); this.color.Read_FromBinary2(Reader);
break; break;
} }
case COLOR_TYPE_PRST: case COLOR_TYPE_PRST:
{ {
this.color = new CPrstColor(); this.setColor(new CPrstColor());
this.color.Read_FromBinary2(Reader); this.color.Read_FromBinary2(Reader);
break; break;
} }
case COLOR_TYPE_SYS: case COLOR_TYPE_SYS:
{ {
this.color = new CSysColor(); this.setColor(new CSysColor());
this.color.Read_FromBinary2(Reader); this.color.Read_FromBinary2(Reader);
break; break;
} }
} }
} }
this.Mods.Read_FromBinary2(Reader);
var mods = new CColorModifiers();
mods.Read_FromBinary2(Reader);
for(var i = 0; i < mods.Mods.length; ++i)
{
this.addMod(mods.Mods[i]);
}
//this.Mods.Read_FromBinary2(Reader);
this.RGBA = ReadObjectLong(Reader); this.RGBA = ReadObjectLong(Reader);
}, },
...@@ -1550,9 +1559,13 @@ CBlipFill.prototype = ...@@ -1550,9 +1559,13 @@ CBlipFill.prototype =
this.RasterImageId = rasterImageId; this.RasterImageId = rasterImageId;
}, },
setSrcRect: function() setSrcRect: function(srcRect)
{ {
var oldValue = isRealObject(this.srcRect) ? this.srcRect.createBinary() : null;
var newValue = isRealObject(srcRect) ? srcRect.createBinary() : null;
this.srcRect = srcRect;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_AddYAxis, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
}, },
setTile: function(tile) setTile: function(tile)
...@@ -1586,6 +1599,19 @@ CBlipFill.prototype = ...@@ -1586,6 +1599,19 @@ CBlipFill.prototype =
this.tile = data.oldValue; this.tile = data.oldValue;
break; break;
} }
case historyitem_AutoShapes_AddYAxis:
{
if(typeof data.oldValue === "string")
{
this.srcRect = new CSrcRect();
this.srcRect.setFromBinary(data.oldValue);
}
else
{
this.srcRect = null;
}
break;
}
} }
}, },
...@@ -1603,6 +1629,19 @@ CBlipFill.prototype = ...@@ -1603,6 +1629,19 @@ CBlipFill.prototype =
this.tile = data.newValue; this.tile = data.newValue;
break; break;
} }
case historyitem_AutoShapes_AddYAxis:
{
if(typeof data.oldValue === "string")
{
this.srcRect = new CSrcRect();
this.srcRect.setFromBinary(data.newValue);
}
else
{
this.srcRect = null;
}
break;
}
} }
}, },
...@@ -1665,9 +1704,9 @@ CBlipFill.prototype = ...@@ -1665,9 +1704,9 @@ CBlipFill.prototype =
{ {
var imageId = Reader.GetString2(); var imageId = Reader.GetString2();
if(typeof imageId === "string" && isRealObject(Reader.oImages) && typeof Reader.oImages[imageId] === "string" && Reader.oImages[imageId] !== "error") if(typeof imageId === "string" && isRealObject(Reader.oImages) && typeof Reader.oImages[imageId] === "string" && Reader.oImages[imageId] !== "error")
this.RasterImageId = Reader.oImages[imageId]; this.setRasterImageId(Reader.oImages[imageId]);
else else
this.RasterImageId = imageId; this.setRasterImageId(imageId);
/*if(typeof this.RasterImageId === "string" && isRealObject(Reader.oImages)) /*if(typeof this.RasterImageId === "string" && isRealObject(Reader.oImages))
{ {
...@@ -1684,17 +1723,26 @@ CBlipFill.prototype = ...@@ -1684,17 +1723,26 @@ CBlipFill.prototype =
flag = Reader.GetBool(); flag = Reader.GetBool();
if(flag) if(flag)
{ {
this.tile = Reader.GetBool(); this.setTile(Reader.GetBool());
}
else
{
this.setTile(null);
} }
this.rotWithShape = Reader.GetBool(); this.rotWithShape = Reader.GetBool();
if(Reader.GetBool()) if(Reader.GetBool())
{ {
this.srcRect = new CSrcRect(); var srcRect = new CSrcRect();
this.srcRect.l = Reader.GetDouble(); srcRect.l = Reader.GetDouble();
this.srcRect.t = Reader.GetDouble(); srcRect.t = Reader.GetDouble();
this.srcRect.r = Reader.GetDouble(); srcRect.r = Reader.GetDouble();
this.srcRect.b = Reader.GetDouble(); srcRect.b = Reader.GetDouble();
this.setSrcRect(srcRect);
}
else
{
this.setSrcRect(null);
} }
}, },
...@@ -1855,7 +1903,7 @@ CSolidFill.prototype = ...@@ -1855,7 +1903,7 @@ CSolidFill.prototype =
{ {
if(Reader.GetBool()) if(Reader.GetBool())
{ {
this.color = new CUniColor(); this.setColor(new CUniColor());
this.color.Read_FromBinary2(Reader); this.color.Read_FromBinary2(Reader);
} }
}, },
...@@ -2723,35 +2771,35 @@ CUniFill.prototype = ...@@ -2723,35 +2771,35 @@ CUniFill.prototype =
{ {
case FILL_TYPE_SOLID: case FILL_TYPE_SOLID:
{ {
this.fill = new CSolidFill(); this.setFill(new CSolidFill());
this.fill.Read_FromBinary2(reader); this.fill.Read_FromBinary2(reader);
break; break;
} }
case FILL_TYPE_GRAD: case FILL_TYPE_GRAD:
{ {
this.fill = new CGradFill(); this.setFill(new CGradFill());
this.fill.Read_FromBinary2(reader); this.fill.Read_FromBinary2(reader);
break; break;
} }
case FILL_TYPE_BLIP: case FILL_TYPE_BLIP:
{ {
this.fill = new CBlipFill(); this.setFill(new CBlipFill());
this.fill.Read_FromBinary2(reader); this.fill.Read_FromBinary2(reader);
break; break;
} }
case FILL_TYPE_NOFILL: case FILL_TYPE_NOFILL:
{ {
this.fill = new CNoFill(); this.setFill(new CNoFill());
this.fill.Read_FromBinary2(reader); this.fill.Read_FromBinary2(reader);
break; break;
} }
case FILL_TYPE_PATT: case FILL_TYPE_PATT:
{ {
this.fill = new CPattFill(); this.setFill(new CPattFill());
this.fill.Read_FromBinary2(reader); this.fill.Read_FromBinary2(reader);
break; break;
} }
...@@ -2761,7 +2809,7 @@ CUniFill.prototype = ...@@ -2761,7 +2809,7 @@ CUniFill.prototype =
flag = reader.GetBool(); flag = reader.GetBool();
if(flag) if(flag)
{ {
this.transparent = reader.GetDouble(); this.setTransparent(reader.GetDouble());
} }
}, },
......
...@@ -242,6 +242,15 @@ CImageShape.prototype = ...@@ -242,6 +242,15 @@ CImageShape.prototype =
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null))); new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}, },
setGeometry: function(geometry)
{
var oldId = this.spPr.geometry ? this.spPr.geometry.Get_Id() : null;
this.spPr.geometry = geometry;
var newId = this.spPr.geometry.Get_Id();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetPresetGeometry, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldId, newId)));
},
updateDrawingBaseCoordinates: function() updateDrawingBaseCoordinates: function()
{ {
...@@ -1275,8 +1284,8 @@ CImageShape.prototype = ...@@ -1275,8 +1284,8 @@ CImageShape.prototype =
readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y) readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
{ {
this.group = group; this.setGroup(group);
this.drawingObjects = drawingObjects; this.setDrawingObjects(drawingObjects);
this.setBlipFill(new CUniFill()); this.setBlipFill(new CUniFill());
this.blipFill.Read_FromBinary2(r); this.blipFill.Read_FromBinary2(r);
var dx = 0, dy = 0; var dx = 0, dy = 0;
...@@ -1285,7 +1294,94 @@ CImageShape.prototype = ...@@ -1285,7 +1294,94 @@ CImageShape.prototype =
dx = r.GetDouble(); dx = r.GetDouble();
dy = r.GetDouble(); dy = r.GetDouble();
} }
this.spPr.Read_FromBinary2(r); //this.spPr.Read_FromBinary2(r);
//*********************
this.spPr.bwMode = r.GetBool();
r.GetBool();
this.setXfrmObject(new CXfrm());
var Reader = r;
var offX, offY, extX, extY, flipH, flipV, rot;
var flag = Reader.GetBool();
if(flag)
offX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
offY = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extY = Reader.GetDouble();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipH = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipV = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
rot = Reader.GetDouble();
if(isRealNumber(offX) && isRealNumber(offY))
this.setPosition(offX, offY);
if(isRealNumber(extX) && isRealNumber(extY))
this.setExtents(extX, extY);
this.setFlips(flipH, flipV);
if(isRealNumber(rot))
this.setRotate(rot);
var flag = Reader.GetBool();
if(flag)
{
var geometry = new CGeometry();
geometry.Read_FromBinary2(Reader);
geometry.Init(5, 5);
this.setGeometry(geometry);
}
flag = Reader.GetBool();
if(flag)
{
var Fill = new CUniFill();
Fill.Read_FromBinary2(Reader);
// this.setUniFill(Fill);
}
flag = Reader.GetBool();
if(flag)
{
var ln = new CLn();
ln.Read_FromBinary2(Reader);
//this.setUniLine(ln);
}
//***********************************
if(isRealNumber(x) && isRealNumber(y)) if(isRealNumber(x) && isRealNumber(y))
{ {
this.setPosition(x + dx, y + dy); this.setPosition(x + dx, y + dy);
...@@ -1297,6 +1393,8 @@ CImageShape.prototype = ...@@ -1297,6 +1393,8 @@ CImageShape.prototype =
this.recalculateTransform(); this.recalculateTransform();
this.calculateContent(); this.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
......
...@@ -2459,7 +2459,7 @@ CShape.prototype = ...@@ -2459,7 +2459,7 @@ CShape.prototype =
getParagraphParaPr: function() getParagraphParaPr: function()
{ {
if(this.txBody) if(this.txBody && this.txBody.content)
{ {
return this.txBody.content.Get_Paragraph_ParaPr(); return this.txBody.content.Get_Paragraph_ParaPr();
} }
...@@ -2468,7 +2468,7 @@ CShape.prototype = ...@@ -2468,7 +2468,7 @@ CShape.prototype =
getParagraphTextPr: function() getParagraphTextPr: function()
{ {
if(this.txBody) if(this.txBody && this.txBody.content)
{ {
return this.txBody.content.Get_Paragraph_TextPr(); return this.txBody.content.Get_Paragraph_TextPr();
} }
......
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