Commit d3a6cecf 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@51136 954022d7-b5bf-4e40-9824-e11837661b57
parent c8c48d59
......@@ -916,6 +916,37 @@ DrawingObjectsController.prototype =
}
default :
{
if(this.curState.group)
{
state.id = STATES_ID_GROUP;
state.groupId = this.curState.group.Get_Id();
state.selectedObjects = [];
for(var i = 0; i < this.curState.group.selectedObjects; ++i)
{
state.selectedObjects.push(this.curState.group.selectedObjects[i].Get_Id());
}
break;
}
else if(this.curState.chart)
{
state.id = STATES_ID_CHART;
state.chart = this.curState.chart;
state.selectedTitle = null;
var chart = this.curState.chart;
if(chart.chartTitle && chart.chartTitle.selected)
{
state.selectedTitle = chart.chartTitle;
}
else if(chart.hAxisTitle && chart.hAxisTitle.selected)
{
state.selectedTitle = chart.hAxisTitle;
}
else if(chart.vAxisTitle && chart.vAxisTitle.selected)
{
state.selectedTitle = chart.vAxisTitle;
}
break;
}
state.id = STATES_ID_NULL;
state.selectedObjects = [];
for(var i = 0; i < this.selectedObjects.length; ++i)
......@@ -985,6 +1016,8 @@ DrawingObjectsController.prototype =
break;
}
}
this.recalculateCurPos();
this.updateSelectionState();
return state;
},
......
......@@ -28,7 +28,7 @@ function CChartAsGroup(drawingBase, drawingObjects)
this.transform = new CMatrix();
this.invertTransform = new CMatrix();
this.group = null;
this.rot = 0;
this.recalculateInfo =
{
recalculateAll: true
......@@ -49,6 +49,10 @@ function CChartAsGroup(drawingBase, drawingObjects)
CChartAsGroup.prototype =
{
calculateContent: function()
{
this.recalculate();
},
getObjectType: function()
{
return CLASS_TYPE_CHART_AS_GROUP;
......@@ -731,6 +735,20 @@ CChartAsGroup.prototype =
this.drawingBase = drawingBase;
},
createRotateInGroupTrack: function()
{
return new RotateTrackShapeImageInGroup(this);
},
createResizeInGroupTrack: function(cardDirection)
{
return new ResizeTrackShapeImageInGroup(this, cardDirection);
},
createMoveInGroupTrack: function()
{
return new MoveShapeImageTrackInGroup(this);
},
setChartTitle: function(chartTitle)
{
......@@ -1593,6 +1611,11 @@ CChartAsGroup.prototype =
{
switch(type)
{
case historyitem_AutoShapes_SetGroup:
{
this.group = g_oTableId.Get_ById(data.oldValue);
break;
}
case historyitem_AutoShapes_RecalculateTransformUndo:
{
this.recalculate();
......@@ -1653,6 +1676,11 @@ CChartAsGroup.prototype =
{
switch(type)
{
case historyitem_AutoShapes_SetGroup:
{
this.group = g_oTableId.Get_ById(data.newValue);
break;
}
case historyitem_AutoShapes_SetXfrm:
{
this.spPr.xfrm = g_oTableId.Get_ById(data.newValue);
......
......@@ -681,6 +681,11 @@ CGroupShape.prototype =
canRotate: function()
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(!this.spTree[i].canRotate || !this.spTree[i].canRotate())
return false;
}
return true;
},
......
......@@ -6436,7 +6436,7 @@ ParaFlowObjectAnchor.prototype =
// Класс начало гиперссылки
function ParaHyperlinkStart()
{
this.Id = g_oIdCounter.Get_NewId();
// this.Id = g_oIdCounter.Get_NewId();
this.Type = para_HyperlinkStart;
......@@ -6446,7 +6446,7 @@ function ParaHyperlinkStart()
this.ToolTip = null;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id );
// g_oTableId.Add( this, this.Id );
}
ParaHyperlinkStart.prototype =
......@@ -6498,7 +6498,7 @@ ParaHyperlinkStart.prototype =
Set_ToolTip : function(ToolTip)
{
History.Add( this, { Type : historyitem_Hyperlink_ToolTip, New : ToolTip, Old : this.ToolTip } );
//History.Add( this, { Type : historyitem_Hyperlink_ToolTip, New : ToolTip, Old : this.ToolTip } );
this.ToolTip = ToolTip;
},
......@@ -6522,7 +6522,7 @@ ParaHyperlinkStart.prototype =
Set_Value : function(Value)
{
History.Add( this, { Type : historyitem_Hyperlink_Value, New : Value, Old : this.Value } );
//History.Add( this, { Type : historyitem_Hyperlink_Value, New : Value, Old : this.Value } );
this.Value = Value;
},
......
......@@ -1128,6 +1128,7 @@ Path.prototype = {
case historyitem_AutoShapes_Add_PathArcTo:
case historyitem_AutoShapes_Add_PathQuadBezTo:
case historyitem_AutoShapes_Add_PathCubicBezTo:
case historyitem_AutoShapes_Add_PathClose:
{
this.ArrPathCommandInfo.splice(this.ArrPathCommandInfo.length - 1, 1);
break;
......@@ -1151,6 +1152,17 @@ Path.prototype = {
break;
}
case historyitem_AutoShapes_Add_PathQuadBezTo:
{
this.ArrPathCommandInfo.push({id:bezier3, X0:data.x0, Y0:data.y0, X1:data.x1, Y1:data.y1});
break;
}
case historyitem_AutoShapes_Add_PathCubicBezTo:
{
this.ArrPathCommandInfo.push({id:bezier4, X0:data.x0, Y0:data.y0, X1:data.x1, Y1:data.y1, X2:data.x2, Y2: data.y2});
break;
}
case historyitem_AutoShapes_Add_PathArcTo:
{
......
This diff is collapsed.
......@@ -410,7 +410,7 @@ function NullState(drawingObjectsController, drawingObjects)
selected_objects[0].paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, selected_objects[0]));
this.drawingObjects.showDrawingObjects(true);
this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.updateSelectionState();
}
}
}
......@@ -5227,7 +5227,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
{
drawingObjectsController.drawingObjects.objectLocker.reset();
if(state.id === STATES_ID_CHART_TEXT_ADD)
if(state.id === STATES_ID_TEXT_ADD)
drawingObjectsController.drawingObjects.objectLocker.addObjectId(drawingObjectsController.curState.textObject.Get_Id());
else if(state.id === STATES_ID_CHART_TEXT_ADD)
{
......@@ -5301,7 +5301,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
if(!e.ctrlKey)
{
drawingObjectsController.drawingObjects.objectLocker.reset();
if(state.id === STATES_ID_CHART_TEXT_ADD)
if(state.id === STATES_ID_TEXT_ADD)
drawingObjectsController.drawingObjects.objectLocker.addObjectId(drawingObjectsController.curState.textObject.Get_Id());
else if(state.id === STATES_ID_CHART_TEXT_ADD)
{
......@@ -5810,7 +5810,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
case STATES_ID_CHART_TEXT_ADD:
{
drawingObjectsController.drawingObjects.objectLocker.reset();
if(state.id === STATES_ID_CHART_TEXT_ADD)
if(state.id === STATES_ID_TEXT_ADD)
drawingObjectsController.drawingObjects.objectLocker.addObjectId(drawingObjectsController.curState.textObject.Get_Id());
else if(state.id === STATES_ID_CHART_TEXT_ADD)
{
......
......@@ -61,7 +61,29 @@ function MoveShapeImageTrackInGroup(originalObject)
this.x = null;
this.y = null;
this.transform = new CMatrix();
this.overlayObject = new OverlayObject(this.originalObject.spPr.geometry, this.originalObject.extX, this.originalObject.extY, this.originalObject.brush, this.originalObject.pen, this.transform);
var pen, brush;
if(!(this.originalObject instanceof CChartAsGroup))
{
pen = this.originalObject.pen;
brush = this.originalObject.brush;
}
else
{
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.RGBA = {R:255, G:255, B:255, A:255};
brush.fill.color.color = new CRGBColor();
brush.fill.color.color.RGBA = {R:255, G:255, B:255, A:255};
pen = new CLn();
pen.Fill = new CUniFill();
pen.Fill.fill = new CSolidFill();
pen.Fill.fill.color = new CUniColor();
pen.Fill.fill.color.color = new CRGBColor();
}
this.overlayObject = new OverlayObject(this.originalObject.spPr.geometry, this.originalObject.extX, this.originalObject.extY, brush, pen, this.transform);
this.inv = global_MatrixTransformer.Invert(originalObject.group.transform);
this.inv.tx = 0;
this.inv.ty = 0;
......@@ -129,8 +151,29 @@ function MoveGroupTrack(originalObject)
var gr_obj_transform_copy = arr_graphic_objects[i].getTransform().CreateDublicate();
global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform);
this.arrTransforms2[i] = gr_obj_transform_copy;
var pen, brush;
if(!(arr_graphic_objects[i] instanceof CChartAsGroup))
{
pen = arr_graphic_objects[i].pen;
brush = arr_graphic_objects[i].brush;
}
else
{
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.RGBA = {R:255, G:255, B:255, A:255};
brush.fill.color.color = new CRGBColor();
brush.fill.color.color.RGBA = {R:255, G:255, B:255, A:255};
pen = new CLn();
pen.Fill = new CUniFill();
pen.Fill.fill = new CSolidFill();
pen.Fill.fill.color = new CUniColor();
pen.Fill.fill.color.color = new CRGBColor();
}
this.overlayObjects[i] = new OverlayObject(arr_graphic_objects[i].spPr.geometry, arr_graphic_objects[i].extX, arr_graphic_objects[i].extY,
arr_graphic_objects[i].brush, arr_graphic_objects[i].pen, new CMatrix());
brush, pen, new CMatrix());
}
......
......@@ -706,11 +706,34 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection)
this.transform = originalObject.transform.CreateDublicate();
this.geometry = originalObject.spPr.geometry.createDuplicate();
this.brush = originalObject.brush;
this.pen = originalObject.pen;
var pen, brush;
if(!(originalObject instanceof CChartAsGroup))
{
pen = originalObject.pen;
brush = originalObject.brush;
}
else
{
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.RGBA = {R:255, G:255, B:255, A:255};
brush.fill.color.color = new CRGBColor();
brush.fill.color.color.RGBA = {R:255, G:255, B:255, A:255};
pen = new CLn();
pen.Fill = new CUniFill();
pen.Fill.fill = new CSolidFill();
pen.Fill.fill.color = new CUniColor();
pen.Fill.fill.color.color = new CRGBColor();
}
this.brush = brush;
this.pen = pen;
this.bChangeCoef = this.translatetNumberHandle % 2 === 0 && this.originalFlipH !== this.originalFlipV;
this.overlayObject = new OverlayObject(this.geometry, this.resizedExtX, this.resizedExtY, this.brush, this.pen, this.transform);
......@@ -1792,9 +1815,9 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
this.y = originalObject.y;
this.extX = originalObject.extX;
this.extY = originalObject.extY;
this.rot = originalObject.rot;
this.flipH = originalObject.flipH;
this.flipV = originalObject.flipV;
this.rot = isRealNumber(originalObject.rot) ? originalObject.rot : 0;
this.flipH = originalObject.flipH === true;
this.flipV = originalObject.flipV === true;
this.transform = originalObject.transform.CreateDublicate();
this.bSwapCoef = !(this.rot < Math.PI*0.25 || this.rot>Math.PI*1.75 || (this.rot>Math.PI*0.75 && this.rot<Math.PI*1.25));
this.centerDistX = this.x + this.extX*0.5 - this.parentTrack.extX*0.5;
......@@ -1804,7 +1827,27 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
{
this.geometry.Recalculate(this.extX, this.extY);
}
this.overlayObject = new OverlayObject(this.geometry, this.extX, this.extY, originalObject.brush, originalObject.pen, this.transform);
var pen, brush;
if(!(originalObject instanceof CChartAsGroup))
{
pen = originalObject.pen;
brush = originalObject.brush;
}
else
{
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.RGBA = {R:255, G:255, B:255, A:255};
brush.fill.color.color = new CRGBColor();
brush.fill.color.color.RGBA = {R:255, G:255, B:255, A:255};
pen = new CLn();
pen.Fill = new CUniFill();
pen.Fill.fill = new CSolidFill();
pen.Fill.fill.color = new CUniColor();
pen.Fill.fill.color.color = new CRGBColor();
}
this.overlayObject = new OverlayObject(this.geometry, this.extX, this.extY, brush, pen, this.transform);
this.updateSize = function(kw, kh)
{
var _kw, _kh;
......
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