Commit 3b1d5c40 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@49724 954022d7-b5bf-4e40-9824-e11837661b57
parent af7482af
......@@ -2057,6 +2057,33 @@ CChartAsGroup.prototype =
this.init();
},
isPlaceholder: function()
{
return isRealObject(this.nvSpPr) && isRealObject(this.nvSpPr.nvPr) && isRealObject(this.nvSpPr.nvPr.ph);
},
getPlaceholderType: function()
{
return this.isPlaceholder() ? this.nvSpPr.nvPr.ph.type : null;
},
getPlaceholderIndex: function()
{
return this.isPlaceholder() ? this.nvSpPr.nvPr.ph.idx : null;
},
getPhType: function()
{
return this.isPlaceholder() ? this.nvSpPr.nvPr.ph.type : null;
},
getPhIndex: function()
{
return this.isPlaceholder() ? this.nvSpPr.nvPr.ph.idx : null;
},
setChartBinary: function(binary)
{
// Приводим бинарник к внутренней структуре
......
......@@ -952,6 +952,11 @@ CChartTitle.prototype =
recalcAllColors: function()
{},
onParagraphChanged: function()
{
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this.chartGroup;
},
writeToBinary: function(w)
{
w.WriteBool(isRealObject(this.layout));
......
......@@ -476,16 +476,13 @@ function SlideLayout(slideMaster)
this.recalculate = function()
{
if(!this.calculated)
return;
var _shapes = this.cSld.spTree;
var _shape_index;
var _shape_count = _shapes.length;
for(_shape_index = 0; _shape_index < _shape_count; ++_shape_index)
{
if(!_shapes[_shape_index].isPlaceholder())
_shapes[_shape_index].Recalculate();
_shapes[_shape_index].recalculate();
}
};
}
......@@ -1058,16 +1058,10 @@ CPresentation.prototype =
}
},
Edit_Chart : function(Chart)
Edit_Chart : function(binary)
{
if ( docpostype_HdrFtr === this.CurPos.Type )
{
return this.HdrFtr.Edit_Chart(Chart);
}
else if ( docpostype_DrawingObjects === this.CurPos.Type )
{
return this.DrawingObjects.editChart( Chart );
}
this.Slides[this.CurPage].graphicObjects.editChart(binary);
this.Recalculate();
},
Get_ChartObject: function()
......
......@@ -49,66 +49,6 @@ function Slide(presentation, slideLayout, slideNum)
this.changeLayout = function(layout)
{
/* if(!(layout instanceof SlideLayout))
{
return;
}
var historyData;
for(var i=0; i<this.cSld.spTree.length; ++i)
{
if(this.cSld.spTree[i].isPlaceholder())
{
historyData = {};
historyData.shape = this.cSld.spTree[i];
historyData.old_SpPrXfrm = clone(this.cSld.spTree[i].spPr.xfrm);
historyData.old_pH = this.cSld.spTree[i].pH;
historyData.old_pV = this.cSld.spTree[i].pV;
historyData.old_ext = clone(this.cSld.spTree[i].ext);
historyData.old_rot = this.cSld.spTree[i].rot;
historyData.undo_function = function(data)
{
data.shape.spPr.xfrm.extX = data.old_SpPrXfrm.extX;
data.shape.spPr.xfrm.extY = data.old_SpPrXfrm.extY;
data.shape.spPr.xfrm.offX = data.old_SpPrXfrm.offX;
data.shape.spPr.xfrm.offY = data.old_SpPrXfrm.offY;
data.shape.spPr.xfrm.chExtX = data.old_SpPrXfrm.chExtX;
data.shape.spPr.xfrm.chExtY = data.old_SpPrXfrm.chExtY;
data.shape.spPr.xfrm.chOffX = data.old_SpPrXfrm.chOffX;
data.shape.spPr.xfrm.chOffY = data.old_SpPrXfrm.chOffY;
data.shape.pH = data.old_pH;
data.shape.pV = data.old_pV;
data.shape.ext = clone(data.old_ext);
data.shape.rot = data.old_rot;
data.shape.Recalculate();
};
historyData.redo_function = function(data)
{
};
History.Add(this, historyData);
}
}
historyData = { old_layout : this.Layout, new_layout : layout};
historyData.undo_function = function(data)
{
this.Layout = data.old_layout;
this.calculate2();
};
historyData.redo_function = function(data)
{
this.Layout = data.new_layout;
};
History.Add(this, historyData);
this.prepareToChangeTheme(layout);
this.Layout = layout;
this.calculateAfterChangeLayout(); */
var _slide_shapes = this.cSld.spTree;
var _slide_shape;
......
......@@ -332,15 +332,13 @@ function MasterSlide(presentation, theme)
this.recalculate = function()
{
if(!this.calculated)
return;
var _shapes = this.cSld.spTree;
var _shape_index;
var _shape_count = _shapes.length;
for(_shape_index = 0; _shape_index < _shape_count; ++_shape_index)
{
if(!_shapes[_shape_index].isPlaceholder())
_shapes[_shape_index].Recalculate();
_shapes[_shape_index].recalculate();
}
};
......
......@@ -1252,6 +1252,25 @@ CGraphicObjects.prototype = {
},
editChart: function(binary)
{
switch(this.State.id)
{
case STATES_ID_GROUP:
{
break;
}
case STATES_ID_NULL:
{
if(this.selectedObjects.length === 1 && this.selectedObjects[0].chart)
{
this.selectedObjects[0].initFromBinary(binary);
editor.WordControl.m_oLogicDocument.recalcMap[this.selectedObjects[0].Id] = this.selectedObjects[0];
}
break;
}
}
},
addNewParagraph: function(bRecalc)
{
......
......@@ -4281,7 +4281,7 @@ asc_docs_api.prototype.asc_editChartDrawingObject = function(chartBinary)
if ( isObject(chartBinary) )
{
var binary = chartBinary["binary"];
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) )
{
History.Create_NewPoint();
this.WordControl.m_oLogicDocument.Edit_Chart(binary);
......
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