Commit 2c65376c 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@50188 954022d7-b5bf-4e40-9824-e11837661b57
parent 324896d8
......@@ -1076,12 +1076,16 @@ CImageShape.prototype =
{
History.Add(this, {Type:historyitem_SetBlipFill, oldPr: this.blipFill, newPr:blipFill});
this.blipFill = blipFill;
this.recalcInfo.recalculateBrush = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setGroup: function(group)
{
History.Add(this, {Type: historyitem_SetSpGroup, oldPr: this.group, newPr: group});
this.group = group;
this.recalcInfo.recalculateTransform = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setParent: function(parent)
......@@ -1139,21 +1143,25 @@ CImageShape.prototype =
case historyitem_SetSetSpPr:
{
this.spPr = data.oldPr;
this.recalcAll();
break;
}
case historyitem_SetSetStyle:
{
this.style = data.oldPr;
this.recalcAll();
break;
}
case historyitem_SetBlipFill:
{
this.blipFill = data.oldPr;
this.recalcInfo.recalculateBrush = true;
break;
}
case historyitem_SetSpGroup:
{
this.group = data.oldPr;
this.recalcAll();
break;
}
case historyitem_SetShapeParent:
......@@ -1215,22 +1223,26 @@ CImageShape.prototype =
case historyitem_SetSetSpPr:
{
this.spPr = data.newPr;
this.recalcAll();
break;
}
case historyitem_SetSetStyle:
{
this.style = data.newPr;
this.recalcAll();
break;
}
case historyitem_SetBlipFill:
{
this.blipFill = data.newPr;
this.recalcInfo.recalculateBrush = true;
break;
}
case historyitem_SetSpGroup:
{
this.group = data.newPr;
this.recalcAll();
break;
}
case historyitem_SetShapeParent:
......@@ -1395,6 +1407,7 @@ CImageShape.prototype =
{
this.spPr.Read_FromBinary2(r);
}
this.recalcAll();
break;
}
case historyitem_SetSetStyle:
......@@ -1408,6 +1421,7 @@ CImageShape.prototype =
{
this.style = null;
}
this.recalcAll();
break;
}
......@@ -1422,6 +1436,7 @@ CImageShape.prototype =
{
this.blipFill = null;
}
this.recalcAll();
break;
}
case historyitem_SetSpGroup:
......@@ -1434,6 +1449,7 @@ CImageShape.prototype =
{
this.group = null;
}
this.recalcAll();
break;
}
......
......@@ -1575,7 +1575,7 @@ CPresentation.prototype =
Set_ImageProps : function(Props)
{
this.Slides[this.CurPage].graphicObjects.setImageProps(Props);
this.Slides[this.CurPage].graphicObjects.imageApply(Props);
this.Recalculate();
this.Document_UpdateInterfaceState();
},
......
......@@ -1600,6 +1600,77 @@ CGraphicObjects.prototype = {
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)
{
case STATES_ID_NULL:
......@@ -1661,9 +1732,74 @@ CGraphicObjects.prototype = {
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)
......@@ -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;
if(this.State.group)
{
this.State.group.normalize();
}
for(var i = 0; i < selectedObjects.length; ++i)
{
if(selectedObjects[i].isChart && selectedObjects[i].isChart())
......
......@@ -3029,7 +3029,7 @@ asc_docs_api.prototype.ImgApply = function(obj){
}
if( undefined != obj.Position && null != obj.Paddings )
if( undefined != obj.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