Commit 38aca1f3 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 24667 - Некорректное отображение диаграммы в группе, после открытия фрейма

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56635 954022d7-b5bf-4e40-9824-e11837661b57
parent 464b5ff9
...@@ -216,6 +216,7 @@ function CChartSpace() ...@@ -216,6 +216,7 @@ function CChartSpace()
plotArea: null plotArea: null
}; };
this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0, x: 0, y: 0};
this.parsedFromulas = []; this.parsedFromulas = [];
this.setRecalculateInfo(); this.setRecalculateInfo();
......
...@@ -8128,26 +8128,6 @@ function CSpPr() ...@@ -8128,26 +8128,6 @@ function CSpPr()
} */ } */
}; };
this.createDuplicate = function()
{
var duplicate = new CSpPr();
duplicate.bwMode = this.bwMode;
if(this.xfrm)
duplicate.xfrm = this.xfrm.createDuplicate();
if(this.geometry!=null)
duplicate.geometry = this.geometry.createDuplicate();
if(this.geometry!=null)
duplicate.geometry = this.geometry.createDuplicate();
if(this.Fill!=null)
{
duplicate.Fill = this.Fill.createDuplicate();
}
if(this.ln!=null)
{
duplicate.ln = this.ln.createDuplicate();
}
return duplicate;
};
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id); g_oTableId.Add(this, this.Id);
...@@ -8198,6 +8178,31 @@ CSpPr.prototype = ...@@ -8198,6 +8178,31 @@ CSpPr.prototype =
{ {
}, },
createDuplicate: function()
{
var duplicate = new CSpPr();
duplicate.setBwMode(this.bwMode);
if(this.xfrm)
{
duplicate.setXfrm(this.xfrm.createDuplicate());
duplicate.xfrm.setParent(duplicate);
}
if(this.geometry!=null)
{
duplicate.setGeometry(this.geometry.createDuplicate());
duplicate.setParent(duplicate);
}
if(this.Fill!=null)
{
duplicate.setFill(this.Fill.createDuplicate());
}
if(this.ln!=null)
{
duplicate.setLn(this.ln.createDuplicate());
}
return duplicate;
},
checkUniFillRasterImageId: function(unifill) checkUniFillRasterImageId: function(unifill)
{ {
if(unifill && unifill.fill && typeof unifill.fill.RasterImageId === "string" && unifill.fill.RasterImageId.length > 0) if(unifill && unifill.fill && typeof unifill.fill.RasterImageId === "string" && unifill.fill.RasterImageId.length > 0)
......
...@@ -973,7 +973,7 @@ CGroupShape.prototype = ...@@ -973,7 +973,7 @@ CGroupShape.prototype =
setSelectionState: function(selection_state) setSelectionState: function(selection_state)
{ {
this.resetSelection(); this.resetSelection(this);
if(selection_state.textObject) if(selection_state.textObject)
{ {
this.selectObject(selection_state.textObject, selection_state.selectStartPage); this.selectObject(selection_state.textObject, selection_state.selectStartPage);
...@@ -1761,7 +1761,11 @@ CGroupShape.prototype = ...@@ -1761,7 +1761,11 @@ CGroupShape.prototype =
this.selection.chartSelection = null; this.selection.chartSelection = null;
for(var i = this.selectedObjects.length - 1; i > -1; --i) for(var i = this.selectedObjects.length - 1; i > -1; --i)
{ {
this.selectedObjects[i].deselect(graphicObjects); var old_gr = this.selectedObjects[i].group;
var obj = this.selectedObjects[i];
obj.group = this;
obj.deselect(graphicObjects);
obj.group = old_gr;
} }
}, },
......
...@@ -2565,6 +2565,10 @@ CShape.prototype = ...@@ -2565,6 +2565,10 @@ CShape.prototype =
checkHitToBounds: function(x, y) checkHitToBounds: function(x, y)
{ {
if(this.getObjectType() === historyitem_type_ImageShape && this.parent && this.parent.isShapeChild())
{
return true;
}
var _x, _y; var _x, _y;
if(isRealNumber(this.posX) && isRealNumber(this.posY)) if(isRealNumber(this.posX) && isRealNumber(this.posY))
{ {
...@@ -3475,6 +3479,53 @@ CShape.prototype = ...@@ -3475,6 +3479,53 @@ CShape.prototype =
}, },
changePresetGeom: function (sPreset) { changePresetGeom: function (sPreset) {
if(sPreset === "textRect")
{
this.spPr.setGeometry(CreateGeometry("rect"));
this.spPr.geometry.setParent(this.spPr);
this.setStyle(CreateDefaultTextRectStyle());
var fill = new CUniFill();
fill.setFill(new CSolidFill());
fill.fill.setColor(new CUniColor());
fill.fill.color.setColor(new CSchemeColor());
fill.fill.color.color.setId(12);
this.spPr.setFill(fill);
var ln = new CLn();
ln.setW(6350);
ln.setFill(new CUniFill());
ln.Fill.setFill(new CSolidFill());
ln.Fill.fill.setColor(new CUniColor());
ln.Fill.fill.color.setColor(new CPrstColor());
ln.Fill.fill.color.color.setId("black");
this.spPr.setLn(ln);
if(this.bWordShape)
{
if(!this.textBoxContent)
{
this.setTextBoxContent(new CDocumentContent(this, this.getDrawingDocument(), 0, 0, 0, 0, false, false, false));
var body_pr = new CBodyPr();
body_pr.setDefault();
this.setBodyPr(body_pr);
}
}
else
{
if(!this.txBody)
{
this.setTxBody(new CTextBody());
var content = new CDocumentContent(this.txBody, this.getDrawingDocument(), 0, 0, 0, 0, false, false, true);
this.txBody.setParent(this);
this.txBody.setContent(content);
var body_pr = new CBodyPr();
body_pr.setDefault();
this.txBody.setBodyPr(body_pr);
}
}
return;
}
var _final_preset; var _final_preset;
var _old_line; var _old_line;
var _new_line; var _new_line;
......
...@@ -4856,13 +4856,19 @@ function BinaryPPTYLoader() ...@@ -4856,13 +4856,19 @@ function BinaryPPTYLoader()
var oBinaryChartReader = new BinaryChartReader(_stream); var oBinaryChartReader = new BinaryChartReader(_stream);
oBinaryChartReader.ExternalReadCT_ChartSpace(_length, _chart); oBinaryChartReader.ExternalReadCT_ChartSpace(_length, _chart);
_chart.setBDeleted(false); _chart.setBDeleted(false);
if(!_chart.spPr)
_chart.setSpPr(new CSpPr());
if (_xfrm) if(_xfrm)
{
if(!_chart.spPr)
{
_chart.setSpPr(new CSpPr());
_chart.spPr.setParent(_chart);
}
_chart.spPr.setXfrm(_xfrm); _chart.spPr.setXfrm(_xfrm);
_xfrm.setParent(_chart.spPr);
}
s.Seek2(_pos + _length); s.Seek2(_pos + _length);
break; break;
} }
......
...@@ -86,7 +86,7 @@ CChartSpace.prototype.setRecalculateInfo = function() ...@@ -86,7 +86,7 @@ CChartSpace.prototype.setRecalculateInfo = function()
recalculatePenBrush: true recalculatePenBrush: true
}; };
this.baseColors = []; this.baseColors = [];
this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0};
this.chartObj = null; this.chartObj = null;
this.localTransform = new CMatrix(); this.localTransform = new CMatrix();
this.snapArrayX = []; this.snapArrayX = [];
...@@ -526,6 +526,9 @@ CChartSpace.prototype.checkShapeChildTransform = function() ...@@ -526,6 +526,9 @@ CChartSpace.prototype.checkShapeChildTransform = function()
CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform; CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform;
CChartSpace.prototype.updateTransformMatrix = function() CChartSpace.prototype.updateTransformMatrix = function()
{ {
var posX = this.localTransform.tx + this.posX;
var posY = this.localTransform.ty + this.posY;
this.transform = this.localTransform.CreateDublicate(); this.transform = this.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transform, this.posX, this.posY); global_MatrixTransformer.TranslateAppend(this.transform, this.posX, this.posY);
this.invertTransform = global_MatrixTransformer.Invert(this.transform); this.invertTransform = global_MatrixTransformer.Invert(this.transform);
...@@ -533,7 +536,7 @@ CChartSpace.prototype.updateTransformMatrix = function() ...@@ -533,7 +536,7 @@ CChartSpace.prototype.updateTransformMatrix = function()
if(this.localTransformText) if(this.localTransformText)
{ {
this.transformText = this.localTransformText.CreateDublicate(); this.transformText = this.localTransformText.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transformText, this.posX, this.posY); global_MatrixTransformer.TranslateAppend(this.transformText, posX, posY);
this.invertTransformText = global_MatrixTransformer.Invert(this.transformText); this.invertTransformText = global_MatrixTransformer.Invert(this.transformText);
} }
...@@ -552,7 +555,7 @@ CChartSpace.prototype.updateTransformMatrix = function() ...@@ -552,7 +555,7 @@ CChartSpace.prototype.updateTransformMatrix = function()
{ {
if(pts[j].compiledDlb) if(pts[j].compiledDlb)
{ {
pts[j].compiledDlb.updatePosition(this.posX, this.posY); pts[j].compiledDlb.updatePosition(posX, posY);
} }
} }
} }
...@@ -560,22 +563,22 @@ CChartSpace.prototype.updateTransformMatrix = function() ...@@ -560,22 +563,22 @@ CChartSpace.prototype.updateTransformMatrix = function()
if(this.chart.plotArea.catAx) if(this.chart.plotArea.catAx)
{ {
if(this.chart.plotArea.catAx.title) if(this.chart.plotArea.catAx.title)
this.chart.plotArea.catAx.title.updatePosition(this.posX, this.posY); this.chart.plotArea.catAx.title.updatePosition(posX, posY);
if(this.chart.plotArea.catAx.labels) if(this.chart.plotArea.catAx.labels)
this.chart.plotArea.catAx.labels.updatePosition(this.posX, this.posY); this.chart.plotArea.catAx.labels.updatePosition(posX, posY);
} }
if(this.chart.plotArea.valAx) if(this.chart.plotArea.valAx)
{ {
if(this.chart.plotArea.valAx.title) if(this.chart.plotArea.valAx.title)
this.chart.plotArea.valAx.title.updatePosition(this.posX, this.posY); this.chart.plotArea.valAx.title.updatePosition(posX, posY);
if(this.chart.plotArea.valAx.labels) if(this.chart.plotArea.valAx.labels)
this.chart.plotArea.valAx.labels.updatePosition(this.posX, this.posY); this.chart.plotArea.valAx.labels.updatePosition(posX, posY);
} }
} }
if(this.chart.title) if(this.chart.title)
{ {
this.chart.title.updatePosition(this.posX, this.posY); this.chart.title.updatePosition(posX, posY);
} }
if(this.chart.legend) if(this.chart.legend)
{ {
......
...@@ -576,8 +576,8 @@ CGraphicObjects.prototype = ...@@ -576,8 +576,8 @@ CGraphicObjects.prototype =
if(parent_group.spTree[i] === this.selection.groupSelection.selectedObjects[0]) if(parent_group.spTree[i] === this.selection.groupSelection.selectedObjects[0])
{ {
parent_group.removeFromSpTreeByPos(i); parent_group.removeFromSpTreeByPos(i);
chart_space.spPr.xfrm.setOffX(this.selection.groupSelection.selectedObjects[0].offX); chart_space.spPr.xfrm.setOffX(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(this.selection.groupSelection.selectedObjects[0].offY); chart_space.spPr.xfrm.setOffY(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offY);
parent_group.addToSpTree(i, chart_space); parent_group.addToSpTree(i, chart_space);
parent_group.updateCoordinatesAfterInternalResize(); parent_group.updateCoordinatesAfterInternalResize();
major_group.recalculate(); major_group.recalculate();
......
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