Commit 1da6c8f9 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

правка бага 21339 - [Copy&Paste] Изображения не копируются через ctrl

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50753 954022d7-b5bf-4e40-9824-e11837661b57
parent 2f6ef69e
......@@ -49,6 +49,26 @@ CGraphicFrame.prototype =
return this.graphicObject.CurCell ? this.graphicObject.CurCell.Content : null;
},
setSpPr: function(spPr)
{
History.Add(this, {Type:historyitem_SetSetSpPr, oldPr: this.spPr, newPr: spPr});
this.spPr = spPr;
},
copy: function(sp)
{
if(!sp)
sp = new CGraphicFrame();
sp.setSpPr(this.spPr.createDuplicate());
if(this.nvGraphicFramePr)
{
sp.setNvSpPr(this.nvGraphicFramePr.createDuplicate());
}
var table = this.graphicObject.Copy(sp);
sp.setGraphicObject(table);
return sp;
},
isSimpleObject: function()
{
return true;
......@@ -1651,6 +1671,8 @@ CGraphicFrame.prototype =
var Styles = new CStyles();
if(!this.parent)
return Styles;
var theme = null, layout = null, master = null, presentation;
switch(this.parent.kind)
......@@ -2221,7 +2243,11 @@ CGraphicFrame.prototype =
switch(data.Type)
{
case historyitem_SetSetSpPr:
{
this.spPr = data.oldPr;
break;
}
case historyitem_SetSetNvSpPr:
{
this.nvGraphicFramePr = data.oldPr;
......@@ -2335,7 +2361,7 @@ CGraphicFrame.prototype =
}
if(isRealObject(this.parent))
if(isRealObject(this.parent) && isRealObject(this.graphicObject))
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
else
delete editor.WordControl.m_oLogicDocument.recalcMap[this.Id];
......@@ -2345,7 +2371,11 @@ CGraphicFrame.prototype =
{
switch(data.Type)
{
case historyitem_SetSetSpPr:
{
this.spPr = data.newPr;
break;
}
case historyitem_SetSetNvSpPr:
{
this.nvGraphicFramePr = data.newPr;
......@@ -2452,7 +2482,7 @@ CGraphicFrame.prototype =
}
}
if(isRealObject(this.parent))
if(isRealObject(this.parent) && isRealObject(this.graphicObject))
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
else
delete editor.WordControl.m_oLogicDocument.recalcMap[this.Id];
......@@ -2465,6 +2495,15 @@ CGraphicFrame.prototype =
var bool;
switch(data.Type)
{
case historyitem_SetSetSpPr:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
case historyitem_SetSetNvSpPr:
{
w.WriteBool(isRealObject(data.newPr));
......@@ -2568,6 +2607,16 @@ CGraphicFrame.prototype =
{
switch(r.GetLong())
{
case historyitem_SetSetSpPr:
{
this.spPr = new CSpPr();
if(r.GetBool())
{
this.spPr.Read_FromBinary2(r);
}
break;
}
case historyitem_SetSetNvSpPr:
{
if(r.GetBool())
......@@ -2701,6 +2750,10 @@ CGraphicFrame.prototype =
}
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
if(isRealObject(this.parent) && isRealObject(this.graphicObject))
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
else
delete editor.WordControl.m_oLogicDocument.recalcMap[this.Id];
}
},
......
......@@ -61,6 +61,26 @@ function CGroupShape(parent)
CGroupShape.prototype =
{
copy: function(sp)
{
if(!sp)
sp = new CGroupShape();
sp.setSpPr(this.spPr.createDuplicate());
if(this.nvGrpSpPr)
{
sp.setNvSpPr(this.nvGrpSpPr.createDuplicate());
}
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].copy)
{
sp.addToSpTree(sp.spTree.length, this.spTree[i].copy())
sp.spTree[sp.spTree.length - 1].setGroup(sp);
}
}
return sp;
},
getAllImages: function(images)
{
for(var i = 0; i < this.spTree.length; ++i)
......@@ -166,6 +186,13 @@ CGroupShape.prototype =
{
History.Add(this, {Type:historyitem_SetShapeParent, Old: this.parent, New: parent});
this.parent = parent;
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].setParent)
{
this.spTree[i].setParent(parent);
}
}
},
isSimpleObject: function()
......
......@@ -64,6 +64,19 @@ function CImageShape(parent)
CImageShape.prototype =
{
copy: function(sp)
{
if(!sp)
sp = new CImageShape();
if(this.blipFill)
sp.setBlipFill(this.blipFill.createDuplicate());
sp.setSpPr(this.spPr.createDuplicate());
if(this.nvPicPr)
{
sp.setNvSpPr(this.nvPicPr.createDuplicate());
}
return sp;
},
getImageUrl: function()
{
......
......@@ -1637,7 +1637,10 @@ CShape.prototype =
sp = new CShape();
sp.setSpPr(this.spPr.createDuplicate());
sp.setStyle(this.style);
sp.setNvSpPr(this.nvSpPr);
if(this.nvSpPr)
{
sp.setNvSpPr(this.nvSpPr.createDuplicate());
}
if(isRealObject(this.txBody))
{
var txBody = new CTextBody(sp);
......
......@@ -3039,7 +3039,7 @@ CTable.prototype =
// Копируем настройки
Table.Set_Pr( this.Pr.Copy() );
Table.Set_TableStyle( this.TableStyle );
Table.Set_TableStyle( this.styleIndex );
Table.Set_TableLook( this.TableLook.Copy() );
Table.Rows = this.Rows;
......@@ -10219,7 +10219,12 @@ CTable.prototype =
// Считываем свойства для текущего стиля
var Pr = Styles.Get_Pr( StyleId, styles_Table, null );
if(!this.Parent || !this.Parent.Parent)
{
if(this.Pr !== null && typeof this.Pr === "object")
Pr.TablePr.Merge(this.Pr);
return Pr;
}
var _theme = null, _master = null, _layout = null, _slide = null;
switch (this.Parent.parent.kind)
{
......
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