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

поправлены баги с расчетом контура обтекания,

с инлайновыми объектами в автофигурах;
загрузка объекта пересчета для дроуингов в колонтитулах

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55728 954022d7-b5bf-4e40-9824-e11837661b57
parent 616c25c3
......@@ -116,6 +116,18 @@ function handleShapeImage(drawing, drawingObjectsController, e, x, y, group, pag
}
else if(hit_in_text_rect)
{
if(bWord)
{
var all_drawings = drawing.getDocContent().Get_AllDrawingObjects();
var drawings2 = [];
for(var i = 0; i < all_drawings.length; ++i)
{
drawings2.push(all_drawings[i].GraphicObj);
}
var ret = handleInlineObjects(drawingObjectsController, drawings2, e, x, y, pageIndex, bWord);
if(ret)
return ret;
}
return drawingObjectsController.handleTextHit(drawing, e, x, y, group, pageIndex, bWord);
}
return false;
......@@ -236,10 +248,12 @@ function handleInlineObjects(drawingObjectsController, drawingArr, e, x, y, page
{
case historyitem_type_Shape:
case historyitem_type_ImageShape:
case historyitem_type_ChartSpace:
case historyitem_type_GroupShape:
{
var _hit = drawing.hit(x, y);
var _hit_to_path = drawing.hitToPath(x, y);
var b_hit_to_text = drawing.hitToTextRect(x, y);
var _hit = drawing.hit && drawing.hit(x, y);
var _hit_to_path = drawing.hitToPath && drawing.hitToPath(x, y);
var b_hit_to_text = drawing.hitToTextRect && drawing.hitToTextRect(x, y);
if((_hit && !b_hit_to_text) || _hit_to_path)
{
return handleInlineHitNoText(drawing, drawingObjectsController, e, x, y, pageIndex);
......@@ -250,15 +264,15 @@ function handleInlineObjects(drawingObjectsController, drawingArr, e, x, y, page
}
return false;
}
case historyitem_type_ChartSpace:
{
break;
}
case historyitem_type_GroupShape:
{
break;
}
// case historyitem_type_ChartSpace:
// {
//
// break;
// }
// case historyitem_type_GroupShape:
// {
// break;
// }
}
}
}
......
......@@ -113,6 +113,13 @@ CDLbl.prototype =
return historyitem_type_DLbl;
},
checkShapeChildTransform: function(transform)
{
this.updatePosition(this.posX, this.posY);
global_MatrixTransformer.MultiplyAppend(this.transform, transform);
global_MatrixTransformer.MultiplyAppend(this.transformText, transform);
},
getCompiledFill: function()
{
return this.spPr && this.spPr.Fill ? this.spPr.Fill : null;
......@@ -1045,6 +1052,8 @@ CDLbl.prototype =
updatePosition: function(x, y)
{
this.posX = x;
this.posY = y;
this.transform = this.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transform, x, y);
......@@ -4669,7 +4678,7 @@ CDateAx.prototype =
History.Add(this, {Type:historyitem_DateAxMinorTimeUnit, oldPr: this.minorTimeUnit, newPr: pr});
this.minorTimeUnit = pr;
},
///
///
setMinorUnit: function(pr)
{
History.Add(this, {Type:historyitem_DateAxMinorUnit, oldPr: this.minorUnit, newPr: pr});
......@@ -4707,7 +4716,7 @@ CDateAx.prototype =
},
//
Write_ToBinary2: function(w)
Write_ToBinary2: function(w)
{
w.WriteLong(this.getObjectType());
w.WriteString2(this.Get_Id());
......@@ -9515,6 +9524,8 @@ CLegend.prototype =
updatePosition: function(x, y)
{
this.posX = x;
this.posY = y;
this.transform = this.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transform, x, y);
var entry;
......@@ -9538,6 +9549,41 @@ CLegend.prototype =
}
},
checkShapeChildTransform: function(t)
{
this.transform = this.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transform, this.posX, this.posY);
global_MatrixTransformer.MultiplyAppend(this.transform, t);
var entry;
for(var i = 0; i < this.calcEntryes.length; ++i)
{
entry = this.calcEntryes[i];
entry.transformText = entry.localTransformText.CreateDublicate();
global_MatrixTransformer.TranslateAppend(entry.transformText, this.posX, this.posY);
global_MatrixTransformer.MultiplyAppend(entry.transformText, t);
if(entry.calcMarkerUnion.marker)
{
entry.calcMarkerUnion.marker.transform = entry.calcMarkerUnion.marker.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.marker.transform, this.posX, this.posY);
global_MatrixTransformer.MultiplyAppend(entry.calcMarkerUnion.marker.transform, t);
}
if(entry.calcMarkerUnion.lineMarker)
{
entry.calcMarkerUnion.lineMarker.transform = entry.calcMarkerUnion.lineMarker.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(entry.calcMarkerUnion.lineMarker.transform, this.posX, this.posY);
global_MatrixTransformer.MultiplyAppend(entry.calcMarkerUnion.lineMarker.transform, t);
}
}
},
getObjectType: function()
{
return historyitem_type_Legend;
......@@ -11911,7 +11957,7 @@ CNumLit.prototype =
case historyitem_NumLit_AddPt:
{
this.pts.push(data.newPr);
this.pts.push(data.pt);
break;
}
......@@ -16343,6 +16389,7 @@ CTitle.prototype =
recalculateBrush: CShape.prototype.recalculateBrush,
checkShapeChildTransform: CDLbl.prototype.checkShapeChildTransform,
updatePosition: function(x, y)
{
this.transform = this.localTransform.CreateDublicate();
......@@ -18183,6 +18230,8 @@ function CValAxisLabels(chart)
this.localTransform = new CMatrix();
this.arrLabels = [];
this.chart = chart;
this.posX = null;
this.posY = null;
}
CValAxisLabels.prototype =
......@@ -18252,6 +18301,8 @@ CValAxisLabels.prototype =
updatePosition: function(x, y)
{
this.posX = x;
this.posY = y;
this.transform = this.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transform, x, y);
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
......@@ -18260,6 +18311,18 @@ CValAxisLabels.prototype =
if(this.arrLabels[i])
this.arrLabels[i].updatePosition(x, y);
}
},
checkShapeChildTransform: function(t)
{
this.transform = this.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transform, this.posX, this.posY);
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
for(var i = 0; i < this.arrLabels.length; ++i)
{
if(this.arrLabels[i])
this.arrLabels[i].checkShapeChildTransform(t);
}
}
};
......
......@@ -1329,6 +1329,10 @@ CShape.prototype =
{
this.checkPosTransformText();
}
if(this.checkContentDrawings)
{
this.checkContentDrawings();
}
},
getFullFlip: function()
......
......@@ -92,13 +92,6 @@ function XYAdjustmentTrack(originalShape, adjIndex)
this.overlayObject.draw(overlay);
};
this.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
bounds_checker.init(Page_Width, Page_Height, Page_Width, Page_Height);
this.draw(bounds_checker);
return bounds_checker.Bounds;
};
this.track = function(posX, posY)
{
......@@ -173,6 +166,36 @@ function XYAdjustmentTrack(originalShape, adjIndex)
}
XYAdjustmentTrack.prototype.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
bounds_checker.init(Page_Width, Page_Height, Page_Width, Page_Height);
this.draw(bounds_checker);
var tr = this.originalShape.transform;
var arr_p_x = [];
var arr_p_y = [];
arr_p_x.push(tr.TransformPointX(0,0));
arr_p_y.push(tr.TransformPointY(0,0));
arr_p_x.push(tr.TransformPointX(this.originalShape.extX,0));
arr_p_y.push(tr.TransformPointY(this.originalShape.extX,0));
arr_p_x.push(tr.TransformPointX(this.originalShape.extX,this.originalShape.extY));
arr_p_y.push(tr.TransformPointY(this.originalShape.extX,this.originalShape.extY));
arr_p_x.push(tr.TransformPointX(0,this.originalShape.extY));
arr_p_y.push(tr.TransformPointY(0,this.originalShape.extY));
arr_p_x.push(bounds_checker.Bounds.min_x);
arr_p_x.push(bounds_checker.Bounds.max_x);
arr_p_y.push(bounds_checker.Bounds.min_y);
arr_p_y.push(bounds_checker.Bounds.max_y);
bounds_checker.Bounds.min_x = Math.min.apply(Math, arr_p_x);
bounds_checker.Bounds.max_x = Math.max.apply(Math, arr_p_x);
bounds_checker.Bounds.min_y = Math.min.apply(Math, arr_p_y);
bounds_checker.Bounds.max_y = Math.max.apply(Math, arr_p_y);
return bounds_checker.Bounds;
};
function PolarAdjustmentTrack(originalShape, adjIndex)
{
this.originalShape = originalShape;
......@@ -330,4 +353,5 @@ function PolarAdjustmentTrack(originalShape, adjIndex)
this.originalShape.spPr.geometry.setAdjValue(this.adjastment.gdRefAng, this.geometry.gdLst[this.adjastment.gdRefAng]+"");
}
};
}
\ No newline at end of file
}
PolarAdjustmentTrack.prototype.getBounds = XYAdjustmentTrack.prototype.getBounds;
\ No newline at end of file
......@@ -6,6 +6,7 @@ function MoveShapeImageTrack(originalObject)
this.x = null;
this.y = null;
this.pageIndex = null;
this.originalShape = originalObject;
if(!originalObject.isChart())
{
......@@ -69,13 +70,6 @@ function MoveShapeImageTrack(originalObject)
this.pageIndex = pageIndex;
};
this.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
this.overlayObject.draw(bounds_checker);
return bounds_checker.Bounds;
};
this.draw = function(overlay)
{
if(isRealNumber(this.pageIndex))
......@@ -125,6 +119,34 @@ function MoveShapeImageTrack(originalObject)
};
}
MoveShapeImageTrack.prototype.getBounds = function()
{
var boundsChecker = new CSlideBoundsChecker();
this.draw(boundsChecker);
var tr = this.transform;
var arr_p_x = [];
var arr_p_y = [];
arr_p_x.push(tr.TransformPointX(0,0));
arr_p_y.push(tr.TransformPointY(0,0));
arr_p_x.push(tr.TransformPointX(this.originalObject.extX,0));
arr_p_y.push(tr.TransformPointY(this.originalObject.extX,0));
arr_p_x.push(tr.TransformPointX(this.originalObject.extX,this.originalObject.extY));
arr_p_y.push(tr.TransformPointY(this.originalObject.extX,this.originalObject.extY));
arr_p_x.push(tr.TransformPointX(0,this.originalObject.extY));
arr_p_y.push(tr.TransformPointY(0,this.originalObject.extY));
arr_p_x.push(boundsChecker.Bounds.min_x);
arr_p_x.push(boundsChecker.Bounds.max_x);
arr_p_y.push(boundsChecker.Bounds.min_y);
arr_p_y.push(boundsChecker.Bounds.max_y);
boundsChecker.Bounds.min_x = Math.min.apply(Math, arr_p_x);
boundsChecker.Bounds.max_x = Math.max.apply(Math, arr_p_x);
boundsChecker.Bounds.min_y = Math.min.apply(Math, arr_p_y);
boundsChecker.Bounds.max_y = Math.max.apply(Math, arr_p_y);
return boundsChecker.Bounds;
};
function MoveShapeImageTrackInGroup(originalObject)
{
this.originalObject = originalObject;
......
......@@ -380,8 +380,29 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
this.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
this.overlayObject.draw(bounds_checker);
return bounds_checker.Bounds;
var boundsChecker = new CSlideBoundsChecker();
this.draw(boundsChecker);
var tr = this.transform;
var arr_p_x = [];
var arr_p_y = [];
arr_p_x.push(tr.TransformPointX(0,0));
arr_p_y.push(tr.TransformPointY(0,0));
arr_p_x.push(tr.TransformPointX(this.extX,0));
arr_p_y.push(tr.TransformPointY(this.extX,0));
arr_p_x.push(tr.TransformPointX(this.extX,this.extY));
arr_p_y.push(tr.TransformPointY(this.extX,this.extY));
arr_p_x.push(tr.TransformPointX(0,this.extY));
arr_p_y.push(tr.TransformPointY(0,this.extY));
arr_p_x.push(boundsChecker.Bounds.min_x);
arr_p_x.push(boundsChecker.Bounds.max_x);
arr_p_y.push(boundsChecker.Bounds.min_y);
arr_p_y.push(boundsChecker.Bounds.max_y);
boundsChecker.Bounds.min_x = Math.min.apply(Math, arr_p_x);
boundsChecker.Bounds.max_x = Math.max.apply(Math, arr_p_x);
boundsChecker.Bounds.min_y = Math.min.apply(Math, arr_p_y);
boundsChecker.Bounds.max_y = Math.max.apply(Math, arr_p_y);
return boundsChecker.Bounds;
}
}
\ No newline at end of file
......@@ -651,10 +651,30 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
this.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
bounds_checker.init(Page_Width, Page_Height, Page_Width, Page_Height);
this.draw(bounds_checker);
return bounds_checker.Bounds;
var boundsChecker = new CSlideBoundsChecker();
this.draw(boundsChecker);
var tr = this.transform;
var arr_p_x = [];
var arr_p_y = [];
arr_p_x.push(tr.TransformPointX(0,0));
arr_p_y.push(tr.TransformPointY(0,0));
arr_p_x.push(tr.TransformPointX(this.resizedExtX,0));
arr_p_y.push(tr.TransformPointY(this.resizedExtX,0));
arr_p_x.push(tr.TransformPointX(this.resizedExtX,this.resizedExtY));
arr_p_y.push(tr.TransformPointY(this.resizedExtX,this.resizedExtY));
arr_p_x.push(tr.TransformPointX(0,this.resizedExtY));
arr_p_y.push(tr.TransformPointY(0,this.resizedExtY));
arr_p_x.push(boundsChecker.Bounds.min_x);
arr_p_x.push(boundsChecker.Bounds.max_x);
arr_p_y.push(boundsChecker.Bounds.min_y);
arr_p_y.push(boundsChecker.Bounds.max_y);
boundsChecker.Bounds.min_x = Math.min.apply(Math, arr_p_x);
boundsChecker.Bounds.max_x = Math.max.apply(Math, arr_p_x);
boundsChecker.Bounds.min_y = Math.min.apply(Math, arr_p_y);
boundsChecker.Bounds.max_y = Math.max.apply(Math, arr_p_y);
return boundsChecker.Bounds;
};
this.getBoundsRect = function()
......@@ -1312,10 +1332,30 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
};
this.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
bounds_checker.init(Page_Width, Page_Height, Page_Width, Page_Height);
this.draw(bounds_checker);
return bounds_checker.Bounds;
var boundsChecker = new CSlideBoundsChecker();
this.draw(boundsChecker);
var tr = this.transform;
var arr_p_x = [];
var arr_p_y = [];
arr_p_x.push(tr.TransformPointX(0,0));
arr_p_y.push(tr.TransformPointY(0,0));
arr_p_x.push(tr.TransformPointX(this.resizedExtX,0));
arr_p_y.push(tr.TransformPointY(this.resizedExtX,0));
arr_p_x.push(tr.TransformPointX(this.resizedExtX,this.resizedExtY));
arr_p_y.push(tr.TransformPointY(this.resizedExtX,this.resizedExtY));
arr_p_x.push(tr.TransformPointX(0,this.resizedExtY));
arr_p_y.push(tr.TransformPointY(0,this.resizedExtY));
arr_p_x.push(boundsChecker.Bounds.min_x);
arr_p_x.push(boundsChecker.Bounds.max_x);
arr_p_y.push(boundsChecker.Bounds.min_y);
arr_p_y.push(boundsChecker.Bounds.max_y);
boundsChecker.Bounds.min_x = Math.min.apply(Math, arr_p_x);
boundsChecker.Bounds.max_x = Math.max.apply(Math, arr_p_x);
boundsChecker.Bounds.min_y = Math.min.apply(Math, arr_p_y);
boundsChecker.Bounds.max_y = Math.max.apply(Math, arr_p_y);
return boundsChecker.Bounds;
};
......
......@@ -163,9 +163,30 @@ function RotateTrackShapeImage(originalObject)
this.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
this.overlayObject.draw(bounds_checker);
return bounds_checker.Bounds;
var boundsChecker = new CSlideBoundsChecker();
this.draw(boundsChecker);
var tr = this.transform;
var arr_p_x = [];
var arr_p_y = [];
arr_p_x.push(tr.TransformPointX(0,0));
arr_p_y.push(tr.TransformPointY(0,0));
arr_p_x.push(tr.TransformPointX(this.originalObject.extX,0));
arr_p_y.push(tr.TransformPointY(this.originalObject.extX,0));
arr_p_x.push(tr.TransformPointX(this.originalObject.extX,this.originalObject.extY));
arr_p_y.push(tr.TransformPointY(this.originalObject.extX,this.originalObject.extY));
arr_p_x.push(tr.TransformPointX(0,this.originalObject.extY));
arr_p_y.push(tr.TransformPointY(0,this.originalObject.extY));
arr_p_x.push(boundsChecker.Bounds.min_x);
arr_p_x.push(boundsChecker.Bounds.max_x);
arr_p_y.push(boundsChecker.Bounds.min_y);
arr_p_y.push(boundsChecker.Bounds.max_y);
boundsChecker.Bounds.min_x = Math.min.apply(Math, arr_p_x);
boundsChecker.Bounds.max_x = Math.max.apply(Math, arr_p_x);
boundsChecker.Bounds.min_y = Math.min.apply(Math, arr_p_y);
boundsChecker.Bounds.max_y = Math.max.apply(Math, arr_p_y);
return boundsChecker.Bounds;
}
}
......@@ -207,13 +228,32 @@ function RotateTrackGroup(originalObject)
this.getBounds = function()
{
var bounds_checker = new CSlideBoundsChecker();
bounds_checker.init(Page_Width, Page_Height, Page_Width, Page_Height);
this.draw(bounds_checker);
return bounds_checker.Bounds;
var boundsChecker = new CSlideBoundsChecker();
this.draw(boundsChecker);
var tr = this.transform;
var arr_p_x = [];
var arr_p_y = [];
arr_p_x.push(tr.TransformPointX(0,0));
arr_p_y.push(tr.TransformPointY(0,0));
arr_p_x.push(tr.TransformPointX(this.originalObject.extX,0));
arr_p_y.push(tr.TransformPointY(this.originalObject.extX,0));
arr_p_x.push(tr.TransformPointX(this.originalObject.extX,this.originalObject.extY));
arr_p_y.push(tr.TransformPointY(this.originalObject.extX,this.originalObject.extY));
arr_p_x.push(tr.TransformPointX(0,this.originalObject.extY));
arr_p_y.push(tr.TransformPointY(0,this.originalObject.extY));
arr_p_x.push(boundsChecker.Bounds.min_x);
arr_p_x.push(boundsChecker.Bounds.max_x);
arr_p_y.push(boundsChecker.Bounds.min_y);
arr_p_y.push(boundsChecker.Bounds.max_y);
boundsChecker.Bounds.min_x = Math.min.apply(Math, arr_p_x);
boundsChecker.Bounds.max_x = Math.max.apply(Math, arr_p_x);
boundsChecker.Bounds.min_y = Math.min.apply(Math, arr_p_y);
boundsChecker.Bounds.max_y = Math.max.apply(Math, arr_p_y);
return boundsChecker.Bounds;
};
this.track = function(angle, e)
{
var new_rot = angle + this.originalObject.rot;
......
......@@ -253,7 +253,14 @@ NullState.prototype =
ret = handleFloatObjects(this.drawingObjects, drawing_page.beforeTextObjects, e, x, y, null, pageIndex, true);
if(ret)
return ret;
ret = handleInlineObjects(this.drawingObjects, drawing_page.inlineObjects, e, x, y, pageIndex, true);
var no_shape_child_array = [];
for(var i = 0; i < drawing_page.inlineObjects.length; ++i)
{
if(!drawing_page.inlineObjects[i].parent.isShapeChild())
no_shape_child_array.push(drawing_page.inlineObjects[i]);
}
ret = handleInlineObjects(this.drawingObjects, no_shape_child_array, e, x, y, pageIndex, true);
if(ret)
return ret;
......
......@@ -421,6 +421,79 @@ CChartSpace.prototype.checkContentDrawings = function()
CChartSpace.prototype.checkShapeChildTransform = function()
{
if(this.parent)
{
var parent_shape = this.parent.isShapeChild(true);
if(parent_shape)
{
var transform_text= parent_shape.transformText;
global_MatrixTransformer.MultiplyAppend(this.transform, transform_text);
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
if(this.chart)
{
if(this.chart.plotArea)
{
if(this.chart.plotArea.chart && this.chart.plotArea.chart.series)
{
var series = this.chart.plotArea.chart.series;
for(var i = 0; i < series.length; ++i)
{
var ser = series[i];
var pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
if(pts[j].compiledDlb)
{
pts[j].compiledDlb.checkShapeChildTransform(transform_text);
}
}
}
}
if(this.chart.plotArea.catAx)
{
if(this.chart.plotArea.catAx.title)
this.chart.plotArea.catAx.title.checkShapeChildTransform(transform_text);
if(this.chart.plotArea.catAx.labels)
this.chart.plotArea.catAx.labels.checkShapeChildTransform(transform_text);
}
if(this.chart.plotArea.valAx)
{
if(this.chart.plotArea.valAx.title)
this.chart.plotArea.valAx.title.checkShapeChildTransform(transform_text);
if(this.chart.plotArea.valAx.labels)
this.chart.plotArea.valAx.labels.checkShapeChildTransform(transform_text);
}
}
if(this.chart.title)
{
this.chart.title.checkShapeChildTransform(transform_text);
}
if(this.chart.legend)
{
this.chart.legend.checkShapeChildTransform(transform_text);
}
}
}
}
};
CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform;
CChartSpace.prototype.updateTransformMatrix = function()
{
this.transform = this.localTransform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transform, this.posX, this.posY);
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
if(this.localTransformText)
{
this.transformText = this.localTransformText.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transformText, this.posX, this.posY);
this.invertTransformText = global_MatrixTransformer.Invert(this.transformText);
}
if(this.chart)
{
if(this.chart.plotArea)
......@@ -435,7 +508,9 @@ CChartSpace.prototype.checkShapeChildTransform = function()
for(var j = 0; j < pts.length; ++j)
{
if(pts[j].compiledDlb)
{
pts[j].compiledDlb.updatePosition(this.posX, this.posY);
}
}
}
}
......@@ -464,11 +539,8 @@ CChartSpace.prototype.checkShapeChildTransform = function()
this.chart.legend.updatePosition(this.posX, this.posY);
}
}
this.checkShapeChildTransform();
};
CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform;
CChartSpace.prototype.updateTransformMatrix = CShape.prototype.updateTransformMatrix;
CChartSpace.prototype.getArrayWrapIntervals = CShape.prototype.getArrayWrapIntervals;
CChartSpace.prototype.select = CShape.prototype.select;
CChartSpace.prototype.Refresh_RecalcData = function(data)
......
......@@ -196,6 +196,7 @@ CImageShape.prototype.checkShapeChildTransform = function()
if(parent_shape)
{
global_MatrixTransformer.MultiplyAppend(this.transform, parent_shape.transformText);
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
}
}
};
\ No newline at end of file
......@@ -741,4 +741,9 @@ CShape.prototype.canChangeWrapPolygon = function(bReturnTopTable)
CShape.prototype.Get_ColorMap = function()
{
return editor.WordControl.m_oLogicDocument.Get_ColorMap();
};
CShape.prototype.Is_TopDocument = function()
{
return false;
};
\ No newline at end of file
......@@ -131,11 +131,9 @@ CGraphicObjects.prototype =
{
for(var i = 0; i < this.graphicPages.length; ++i)
{
this.graphicPages[i].sortDrawingArrays();
if(this.graphicPages[i])
this.graphicPages[i].sortDrawingArrays();
}
CGraphicPage.prototype.sortDrawingArrays.apply(this.headerFooter.commonEven, []);
CGraphicPage.prototype.sortDrawingArrays.apply(this.headerFooter.commonFirst, []);
CGraphicPage.prototype.sortDrawingArrays.apply(this.headerFooter.commonOdd, []);
},
getSelectedObjects: function()
......@@ -159,7 +157,12 @@ CGraphicObjects.prototype =
createImage: DrawingObjectsController.prototype.createImage,
getChartSpace: DrawingObjectsController.prototype.getChartSpace,
getChartSpace: function(chart, options)
{
var ret = DrawingObjectsController.prototype.getChartSpace.call(this, chart,options);
ret.setBDeleted(false);
return ret;
},
getProps: function()
{
......@@ -1681,7 +1684,9 @@ CGraphicObjects.prototype =
{
if(this.selectedObjects[0])
{
para_pr = this.selectedObjects[0].parent.Get_ParentParagraph().Get_CompiledPr2(true).ParaPr;
var parent_para = this.selectedObjects[0].parent.Get_ParentParagraph();
if(parent_para)
para_pr = parent_para.Get_CompiledPr2(true).ParaPr;
}
}
editor.UpdateParagraphProp(para_pr);
......@@ -2216,7 +2221,11 @@ CGraphicObjects.prototype =
if(this.selection.textSelection)
{
if(this.selection.textSelection.selectStartPage === pageIndex)
{
this.drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.selection.textSelection.getTransformMatrix(), 0, 0, this.selection.textSelection.extX, this.selection.textSelection.extY, false, this.selection.textSelection.canRotate());
if(this.selection.textSelection.drawAdjustments)
this.selection.textSelection.drawAdjustments(this.drawingDocument);
}
}
else if(this.selection.groupSelection)
{
......@@ -2248,7 +2257,6 @@ CGraphicObjects.prototype =
}
else if(this.selection.chartSelection)
{
}
else if(this.selection.wrapPolygonSelection)
{
......@@ -2262,7 +2270,7 @@ CGraphicObjects.prototype =
if(this.selectedObjects[i].selectStartPage === pageIndex)
{
this.drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selectedObjects[i].getTransformMatrix(), 0, 0, this.selectedObjects[i].extX, this.selectedObjects[i].extY, false, this.selectedObjects[i].canRotate());
// this.drawingDocument.AutoShapesTrack.DrawEditWrapPointsPolygon(this.selectedObjects[i].parent.wrappingPolygon.calculatedPoints, new CMatrix());
this.drawingDocument.AutoShapesTrack.DrawEditWrapPointsPolygon(this.selectedObjects[i].parent.wrappingPolygon.calculatedPoints, new CMatrix());
}
}
......@@ -3172,11 +3180,14 @@ CGraphicObjects.prototype =
if(isRealObject(object))
{
var hdr_ftr = object.DocumentContent.Is_HdrFtr(true);
var page = !hdr_ftr ? this.graphicPages[pageIndex] : this.graphicPages[pageIndex] && this.graphicPages[pageIndex].hdrFtrPage;
if(isRealObject(page))
//for(var i = 0; i < this.graphicPages.length; ++i)
{
var array_type = object.getDrawingArrayType();
page.delObjectById(id, array_type);
var page = !hdr_ftr ? this.graphicPages[pageIndex] : this.graphicPages[pageIndex] && this.graphicPages[pageIndex].hdrFtrPage;
if(isRealObject(page))
{
var array_type = object.getDrawingArrayType();
page.delObjectById(id, array_type);
}
}
}
},
......
......@@ -205,14 +205,16 @@ CGraphicPage.prototype =
{
function findInArrayAndRemove(drawingArray, docContent, document)
{
if(!docContent === document)
if(docContent === document)
{
drawingArray.length = 0;
return;
}
var b_is_top_doc = docContent.Is_TopDocument();
for(var i = drawingArray.length-1; i > -1; --i)
{
if(!drawingArray[i].parent || drawingArray[i].parent.DocumentContent === docContent)
if(!drawingArray[i].parent || drawingArray[i].parent.DocumentContent === docContent
|| (b_is_top_doc && drawingArray[i].parent.DocumentContent.Is_TopDocument(true) === docContent))
drawingArray.splice(i, 1);
}
}
......
......@@ -396,7 +396,7 @@ CWrapPolygon.prototype =
calculate: function(drawing)
{
var arrPolygons = drawing.getArrayWrapPolygons();
var transform = drawing.localTransform;
var transform = new CMatrix();
var arrEdges = [];
var arrPoints = [];
......
......@@ -1253,7 +1253,10 @@ CHeaderFooterController.prototype =
this.Pages[PageIndex] = new CHdrFtrPage();
this.Pages[PageIndex].Header = Header;
this.Pages[PageIndex].Footer = Footer;
if(this.LogicDocument.DrawingObjects.graphicPages[PageIndex])
{
this.LogicDocument.DrawingObjects.graphicPages[PageIndex].hdrFtrPage.resetDrawingArrays(this.LogicDocument);
}
var X, XLimit;
var Orient = SectPr.Get_Orientation();
......
......@@ -4192,12 +4192,16 @@ ParaDrawing.prototype =
H : this.H + this.Distance.B
}
}
DrawingObj.PageNum = this.PageNum;
DrawingObj.X = this.X;
DrawingObj.Y = this.Y;
return DrawingObj;
},
Load_RecalculateObject : function(RecalcObj)
{
this.updatePosition3(RecalcObj.PageNum, RecalcObj.X, RecalcObj.Y);
},
Prepare_RecalculateObject : function()
......@@ -4418,12 +4422,9 @@ ParaDrawing.prototype =
if( this.GraphicObj.bNeedUpdatePosition || !(isRealNumber(this.GraphicObj.posX) && isRealNumber(this.GraphicObj.posY)) ||
!(Math.abs(this.GraphicObj.posX-_x) < MOVE_DELTA && Math.abs(this.GraphicObj.posY-_y) < MOVE_DELTA))
this.GraphicObj.updatePosition(_x, _y);
// if(this.Use_TextWrap())
{
if( this.GraphicObj.bNeedUpdatePosition || !(isRealNumber(this.wrappingPolygon.posX) && isRealNumber(this.wrappingPolygon.posY)) ||
!(Math.abs(this.wrappingPolygon.posX -_x) < MOVE_DELTA && Math.abs(this.wrappingPolygon.posY-_y) < MOVE_DELTA))
this.wrappingPolygon.updatePosition(_x, _y);
}
if( this.GraphicObj.bNeedUpdatePosition || !(isRealNumber(this.wrappingPolygon.posX) && isRealNumber(this.wrappingPolygon.posY)) ||
!(Math.abs(this.wrappingPolygon.posX -_x) < MOVE_DELTA && Math.abs(this.wrappingPolygon.posY-_y) < MOVE_DELTA))
this.wrappingPolygon.updatePosition(_x, _y);
},
Set_XYForAdd2 : function(X, Y)
......@@ -6376,14 +6377,6 @@ ParaDrawing.prototype =
},
deselect: function()
{
this.selected = false;
if(isRealObject(this.GraphicObj) && typeof this.GraphicObj.deselect === "function")
this.GraphicObj.deselect();
},
paragraphClearFormatting: function()
{
if(isRealObject(this.GraphicObj) && typeof this.GraphicObj.paragraphAdd === "function")
......
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