Commit 973c5f94 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50188 954022d7-b5bf-4e40-9824-e11837661b57
parent 1e1a70dc
...@@ -1076,12 +1076,16 @@ CImageShape.prototype = ...@@ -1076,12 +1076,16 @@ CImageShape.prototype =
{ {
History.Add(this, {Type:historyitem_SetBlipFill, oldPr: this.blipFill, newPr:blipFill}); History.Add(this, {Type:historyitem_SetBlipFill, oldPr: this.blipFill, newPr:blipFill});
this.blipFill = blipFill; this.blipFill = blipFill;
this.recalcInfo.recalculateBrush = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
}, },
setGroup: function(group) setGroup: function(group)
{ {
History.Add(this, {Type: historyitem_SetSpGroup, oldPr: this.group, newPr: group}); History.Add(this, {Type: historyitem_SetSpGroup, oldPr: this.group, newPr: group});
this.group = group; this.group = group;
this.recalcInfo.recalculateTransform = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
}, },
setParent: function(parent) setParent: function(parent)
...@@ -1139,21 +1143,25 @@ CImageShape.prototype = ...@@ -1139,21 +1143,25 @@ CImageShape.prototype =
case historyitem_SetSetSpPr: case historyitem_SetSetSpPr:
{ {
this.spPr = data.oldPr; this.spPr = data.oldPr;
this.recalcAll();
break; break;
} }
case historyitem_SetSetStyle: case historyitem_SetSetStyle:
{ {
this.style = data.oldPr; this.style = data.oldPr;
this.recalcAll();
break; break;
} }
case historyitem_SetBlipFill: case historyitem_SetBlipFill:
{ {
this.blipFill = data.oldPr; this.blipFill = data.oldPr;
this.recalcInfo.recalculateBrush = true;
break; break;
} }
case historyitem_SetSpGroup: case historyitem_SetSpGroup:
{ {
this.group = data.oldPr; this.group = data.oldPr;
this.recalcAll();
break; break;
} }
case historyitem_SetShapeParent: case historyitem_SetShapeParent:
...@@ -1215,22 +1223,26 @@ CImageShape.prototype = ...@@ -1215,22 +1223,26 @@ CImageShape.prototype =
case historyitem_SetSetSpPr: case historyitem_SetSetSpPr:
{ {
this.spPr = data.newPr; this.spPr = data.newPr;
this.recalcAll();
break; break;
} }
case historyitem_SetSetStyle: case historyitem_SetSetStyle:
{ {
this.style = data.newPr; this.style = data.newPr;
this.recalcAll();
break; break;
} }
case historyitem_SetBlipFill: case historyitem_SetBlipFill:
{ {
this.blipFill = data.newPr; this.blipFill = data.newPr;
this.recalcInfo.recalculateBrush = true;
break; break;
} }
case historyitem_SetSpGroup: case historyitem_SetSpGroup:
{ {
this.group = data.newPr; this.group = data.newPr;
this.recalcAll();
break; break;
} }
case historyitem_SetShapeParent: case historyitem_SetShapeParent:
...@@ -1395,6 +1407,7 @@ CImageShape.prototype = ...@@ -1395,6 +1407,7 @@ CImageShape.prototype =
{ {
this.spPr.Read_FromBinary2(r); this.spPr.Read_FromBinary2(r);
} }
this.recalcAll();
break; break;
} }
case historyitem_SetSetStyle: case historyitem_SetSetStyle:
...@@ -1408,6 +1421,7 @@ CImageShape.prototype = ...@@ -1408,6 +1421,7 @@ CImageShape.prototype =
{ {
this.style = null; this.style = null;
} }
this.recalcAll();
break; break;
} }
...@@ -1422,6 +1436,7 @@ CImageShape.prototype = ...@@ -1422,6 +1436,7 @@ CImageShape.prototype =
{ {
this.blipFill = null; this.blipFill = null;
} }
this.recalcAll();
break; break;
} }
case historyitem_SetSpGroup: case historyitem_SetSpGroup:
...@@ -1434,6 +1449,7 @@ CImageShape.prototype = ...@@ -1434,6 +1449,7 @@ CImageShape.prototype =
{ {
this.group = null; this.group = null;
} }
this.recalcAll();
break; break;
} }
......
...@@ -1575,7 +1575,7 @@ CPresentation.prototype = ...@@ -1575,7 +1575,7 @@ CPresentation.prototype =
Set_ImageProps : function(Props) Set_ImageProps : function(Props)
{ {
this.Slides[this.CurPage].graphicObjects.setImageProps(Props); this.Slides[this.CurPage].graphicObjects.imageApply(Props);
this.Recalculate(); this.Recalculate();
this.Document_UpdateInterfaceState(); this.Document_UpdateInterfaceState();
}, },
......
...@@ -1600,6 +1600,77 @@ CGraphicObjects.prototype = { ...@@ -1600,6 +1600,77 @@ CGraphicObjects.prototype = {
shapeApply: function(properties) shapeApply: function(properties)
{ {
switch(this.State.id)
{
case STATES_ID_NULL:
case STATES_ID_GROUP:
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects;
for(var i = 0; i < selectedObjects.length; ++i)
{
if(properties.type != undefined && properties.type != -1 && typeof selectedObjects[i].changePresetGeom === "function")
{
selectedObjects[i].changePresetGeom(properties.type);
}
if(properties.fill && typeof selectedObjects[i].changeFill === "function")
{
selectedObjects[i].changeFill(properties.fill);
}
if(properties.stroke && typeof selectedObjects[i].changeLine === "function")
{
selectedObjects[i].changeLine(properties.stroke);
}
if(properties.paddings && typeof selectedObjects[i].setPaddings === "function")
{
selectedObjects[i].setPaddings(properties.paddings);
}
}
if(typeof properties.verticalTextAlign === "number")
{
if(this.State.id === STATES_ID_TEXT_ADD)
{
if(typeof this.State.textObject.setVerticalAlign === "function")
this.State.textObject.setVerticalAlign(properties.verticalTextAlign);
}
if(this.State.id === STATES_ID_TEXT_ADD_IN_GROUP)
{
if(typeof this.State.setVerticalAlign === "function")
this.State.textObject.setVerticalAlign(properties.verticalTextAlign);
}
}
if(isRealNumber(properties.w) && isRealNumber(properties.h))
{
for(var i = 0; i < selectedObjects.length; ++i)
{
if(this.State.group)
{
this.State.group.normalize();
}
if(selectedObjects[i].setXfrm)
{
selectedObjects[i].setXfrm(null, null, properties.w, properties.h, null, null, null);
}
if(this.State.group)
{
this.State.group.updateCoordinatesAfterInternalResize();
}
}
}
break;
}
}
editor.WordControl.m_oLogicDocument.Recalculate();
},
setImageProps: function(properties)
{
switch(this.State.id) switch(this.State.id)
{ {
case STATES_ID_NULL: case STATES_ID_NULL:
...@@ -1661,9 +1732,74 @@ CGraphicObjects.prototype = { ...@@ -1661,9 +1732,74 @@ CGraphicObjects.prototype = {
editor.WordControl.m_oLogicDocument.Recalculate(); editor.WordControl.m_oLogicDocument.Recalculate();
}, },
imageApply: function(props) imageApply: function(properties)
{
switch(this.State.id)
{
case STATES_ID_NULL:
case STATES_ID_GROUP:
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects;
if(isRealNumber(properties.Width) && isRealNumber(properties.Height))
{
if(this.State.group)
{
this.State.group.normalize();
}
for(var i = 0; i < selectedObjects.length; ++i)
{
if(selectedObjects[i].isImage && selectedObjects[i].isImage() && selectedObjects[i].setXfrm)
{
selectedObjects[i].setXfrm(null, null, properties.Width, properties.Height, null, null, null);
}
}
if(this.State.group)
{
this.State.group.updateCoordinatesAfterInternalResize();
}
}
var pos = properties.Position;
if( pos && isRealNumber(pos.X) && isRealNumber(pos.X))
{
if(this.State.group)
{
this.State.group.normalize();
}
for(var i = 0; i < selectedObjects.length; ++i)
{
if(selectedObjects[i].isImage && selectedObjects[i].isImage() && selectedObjects[i].setXfrm)
{
selectedObjects[i].setXfrm( pos.X, pos.Y, null, null, null, null, null);
}
}
if(this.State.group)
{
this.State.group.updateCoordinatesAfterInternalResize();
}
}
if(typeof properties.ImageUrl === "string")
{
for(var i = 0; i < selectedObjects.length; ++i)
{ {
if(selectedObjects[i].isImage && selectedObjects[i].isImage() && selectedObjects[i].setBlipFill)
{
var b_f = selectedObjects[i].blipFill.createDuplicate();
b_f.fill.RasterImageId = properties.ImageUrl
selectedObjects[i].setBlipFill(b_f);
}
}
}
break;
}
}
}, },
chartApply: function(properties) chartApply: function(properties)
...@@ -1677,6 +1813,10 @@ CGraphicObjects.prototype = { ...@@ -1677,6 +1813,10 @@ CGraphicObjects.prototype = {
{ {
var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects; var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects;
if(this.State.group)
{
this.State.group.normalize();
}
for(var i = 0; i < selectedObjects.length; ++i) for(var i = 0; i < selectedObjects.length; ++i)
{ {
if(selectedObjects[i].isChart && selectedObjects[i].isChart()) if(selectedObjects[i].isChart && selectedObjects[i].isChart())
......
...@@ -3029,7 +3029,7 @@ asc_docs_api.prototype.ImgApply = function(obj){ ...@@ -3029,7 +3029,7 @@ asc_docs_api.prototype.ImgApply = function(obj){
} }
if( undefined != obj.Position && null != obj.Paddings ) if( undefined != obj.Position )
{ {
ImagePr.Position = ImagePr.Position =
{ {
......
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