Commit d3a6cecf 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@51136 954022d7-b5bf-4e40-9824-e11837661b57
parent c8c48d59
...@@ -916,6 +916,37 @@ DrawingObjectsController.prototype = ...@@ -916,6 +916,37 @@ DrawingObjectsController.prototype =
} }
default : 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.id = STATES_ID_NULL;
state.selectedObjects = []; state.selectedObjects = [];
for(var i = 0; i < this.selectedObjects.length; ++i) for(var i = 0; i < this.selectedObjects.length; ++i)
...@@ -985,6 +1016,8 @@ DrawingObjectsController.prototype = ...@@ -985,6 +1016,8 @@ DrawingObjectsController.prototype =
break; break;
} }
} }
this.recalculateCurPos();
this.updateSelectionState();
return state; return state;
}, },
......
...@@ -28,7 +28,7 @@ function CChartAsGroup(drawingBase, drawingObjects) ...@@ -28,7 +28,7 @@ function CChartAsGroup(drawingBase, drawingObjects)
this.transform = new CMatrix(); this.transform = new CMatrix();
this.invertTransform = new CMatrix(); this.invertTransform = new CMatrix();
this.group = null; this.group = null;
this.rot = 0;
this.recalculateInfo = this.recalculateInfo =
{ {
recalculateAll: true recalculateAll: true
...@@ -49,6 +49,10 @@ function CChartAsGroup(drawingBase, drawingObjects) ...@@ -49,6 +49,10 @@ function CChartAsGroup(drawingBase, drawingObjects)
CChartAsGroup.prototype = CChartAsGroup.prototype =
{ {
calculateContent: function()
{
this.recalculate();
},
getObjectType: function() getObjectType: function()
{ {
return CLASS_TYPE_CHART_AS_GROUP; return CLASS_TYPE_CHART_AS_GROUP;
...@@ -731,6 +735,20 @@ CChartAsGroup.prototype = ...@@ -731,6 +735,20 @@ CChartAsGroup.prototype =
this.drawingBase = drawingBase; 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) setChartTitle: function(chartTitle)
{ {
...@@ -1593,6 +1611,11 @@ CChartAsGroup.prototype = ...@@ -1593,6 +1611,11 @@ CChartAsGroup.prototype =
{ {
switch(type) switch(type)
{ {
case historyitem_AutoShapes_SetGroup:
{
this.group = g_oTableId.Get_ById(data.oldValue);
break;
}
case historyitem_AutoShapes_RecalculateTransformUndo: case historyitem_AutoShapes_RecalculateTransformUndo:
{ {
this.recalculate(); this.recalculate();
...@@ -1653,6 +1676,11 @@ CChartAsGroup.prototype = ...@@ -1653,6 +1676,11 @@ CChartAsGroup.prototype =
{ {
switch(type) switch(type)
{ {
case historyitem_AutoShapes_SetGroup:
{
this.group = g_oTableId.Get_ById(data.newValue);
break;
}
case historyitem_AutoShapes_SetXfrm: case historyitem_AutoShapes_SetXfrm:
{ {
this.spPr.xfrm = g_oTableId.Get_ById(data.newValue); this.spPr.xfrm = g_oTableId.Get_ById(data.newValue);
......
...@@ -150,8 +150,11 @@ CChartTitle.prototype = ...@@ -150,8 +150,11 @@ CChartTitle.prototype =
increaseFontSize: function () { increaseFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Paragraph_IncDecFontSize(true); this.txBody.content.Paragraph_IncDecFontSize(true);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -160,8 +163,11 @@ CChartTitle.prototype = ...@@ -160,8 +163,11 @@ CChartTitle.prototype =
decreaseFontSize: function () { decreaseFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Paragraph_IncDecFontSize(false); this.txBody.content.Paragraph_IncDecFontSize(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -170,11 +176,15 @@ CChartTitle.prototype = ...@@ -170,11 +176,15 @@ CChartTitle.prototype =
increaseAllFontSize: function () { increaseAllFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(true); this.txBody.content.Paragraph_IncDecFontSize(true);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -182,65 +192,89 @@ CChartTitle.prototype = ...@@ -182,65 +192,89 @@ CChartTitle.prototype =
decreaseAllFontSize: function () { decreaseAllFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(false); this.txBody.content.Paragraph_IncDecFontSize(false);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellFontName: function (fontName) { setCellFontName: function (fontName) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontFamily({Name: fontName, Index: -1}); text_pr.Set_FontFamily({Name: fontName, Index: -1});
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellFontSize: function (fontSize) { setCellFontSize: function (fontSize) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontSize(fontSize); text_pr.Set_FontSize(fontSize);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellBold: function (isBold) { setCellBold: function (isBold) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Bold(isBold); text_pr.Set_Bold(isBold);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellItalic: function (isItalic) { setCellItalic: function (isItalic) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Italic(isItalic); text_pr.Set_Italic(isItalic);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellUnderline: function (isUnderline) { setCellUnderline: function (isUnderline) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Underline(isUnderline); text_pr.Set_Underline(isUnderline);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -248,10 +282,14 @@ CChartTitle.prototype = ...@@ -248,10 +282,14 @@ CChartTitle.prototype =
setCellStrikeout: function (isStrikeout) { setCellStrikeout: function (isStrikeout) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Strikeout(isStrikeout); text_pr.Set_Strikeout(isStrikeout);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -260,6 +298,7 @@ CChartTitle.prototype = ...@@ -260,6 +298,7 @@ CChartTitle.prototype =
setCellTextColor: function (color) { setCellTextColor: function (color) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var unifill = new CUniFill(); var unifill = new CUniFill();
unifill.setFill(new CSolidFill()); unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor2(color, null)); unifill.fill.setColor(CorrectUniColor2(color, null));
...@@ -267,7 +306,7 @@ CChartTitle.prototype = ...@@ -267,7 +306,7 @@ CChartTitle.prototype =
text_pr.SetUniFill(unifill); text_pr.SetUniFill(unifill);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -275,24 +314,28 @@ CChartTitle.prototype = ...@@ -275,24 +314,28 @@ CChartTitle.prototype =
setCellAllFontName: function (fontName) { setCellAllFontName: function (fontName) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontFamily({Name: fontName, Index: -1}); text_pr.Set_FontFamily({Name: fontName, Index: -1});
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellAllFontSize: function (fontSize) { setCellAllFontSize: function (fontSize) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontSize(fontSize); text_pr.Set_FontSize(fontSize);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -300,12 +343,14 @@ CChartTitle.prototype = ...@@ -300,12 +343,14 @@ CChartTitle.prototype =
setCellAllBold: function (isBold) { setCellAllBold: function (isBold) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Bold(isBold); text_pr.Set_Bold(isBold);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -313,12 +358,14 @@ CChartTitle.prototype = ...@@ -313,12 +358,14 @@ CChartTitle.prototype =
setCellAllItalic: function (isItalic) { setCellAllItalic: function (isItalic) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Italic(isItalic); text_pr.Set_Italic(isItalic);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -326,12 +373,14 @@ CChartTitle.prototype = ...@@ -326,12 +373,14 @@ CChartTitle.prototype =
setCellAllUnderline: function (isUnderline) { setCellAllUnderline: function (isUnderline) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Underline(isUnderline); text_pr.Set_Underline(isUnderline);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -339,12 +388,14 @@ CChartTitle.prototype = ...@@ -339,12 +388,14 @@ CChartTitle.prototype =
setCellAllStrikeout: function (isStrikeout) { setCellAllStrikeout: function (isStrikeout) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Strikeout(isStrikeout); text_pr.Set_Strikeout(isStrikeout);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -352,12 +403,14 @@ CChartTitle.prototype = ...@@ -352,12 +403,14 @@ CChartTitle.prototype =
setCellAllSubscript: function (isSubscript) { setCellAllSubscript: function (isSubscript) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline); text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -365,12 +418,14 @@ CChartTitle.prototype = ...@@ -365,12 +418,14 @@ CChartTitle.prototype =
setCellAllSuperscript: function (isSuperscript) { setCellAllSuperscript: function (isSuperscript) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSubscript ? vertalign_SuperScript : vertalign_Baseline); text_pr.Set_VertAlign(isSubscript ? vertalign_SuperScript : vertalign_Baseline);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -379,6 +434,7 @@ CChartTitle.prototype = ...@@ -379,6 +434,7 @@ CChartTitle.prototype =
setCellAllTextColor: function (color) { setCellAllTextColor: function (color) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var unifill = new CUniFill(); var unifill = new CUniFill();
unifill.setFill(new CSolidFill()); unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor2(color, null)); unifill.fill.setColor(CorrectUniColor2(color, null));
...@@ -388,6 +444,7 @@ CChartTitle.prototype = ...@@ -388,6 +444,7 @@ CChartTitle.prototype =
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate(); this.chartGroup.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -585,13 +642,12 @@ CChartTitle.prototype = ...@@ -585,13 +642,12 @@ CChartTitle.prototype =
paragraphAdd: function(paraItem, bRecalculate) paragraphAdd: function(paraItem, bRecalculate)
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null))); History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
if(!isRealObject(this.txBody)) if(!isRealObject(this.txBody))
this.txBody = new CTextBody(this); this.txBody = new CTextBody(this);
this.txBody.paragraphAdd(paraItem); this.txBody.paragraphAdd(paraItem);
this.recalculatePosExt(); this.recalculatePosExt();
this.txBody.recalculateCurPos(); this.txBody.recalculateCurPos();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null))); History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
return; return;
}, },
...@@ -672,15 +728,22 @@ CChartTitle.prototype = ...@@ -672,15 +728,22 @@ CChartTitle.prototype =
addNewParagraph: function() addNewParagraph: function()
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.addNewParagraph(); this.txBody.addNewParagraph();
this.recalculatePosExt(); this.recalculatePosExt();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}, },
remove: function(direction, bOnlyText) remove: function(direction, bOnlyText)
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.remove(direction, bOnlyText); this.txBody.remove(direction, bOnlyText);
this.recalculatePosExt(); this.recalculatePosExt();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}, },
updateSelectionState: function(drawingDocument) updateSelectionState: function(drawingDocument)
......
...@@ -681,6 +681,11 @@ CGroupShape.prototype = ...@@ -681,6 +681,11 @@ CGroupShape.prototype =
canRotate: function() canRotate: function()
{ {
for(var i = 0; i < this.spTree.length; ++i)
{
if(!this.spTree[i].canRotate || !this.spTree[i].canRotate())
return false;
}
return true; return true;
}, },
......
...@@ -6436,7 +6436,7 @@ ParaFlowObjectAnchor.prototype = ...@@ -6436,7 +6436,7 @@ ParaFlowObjectAnchor.prototype =
// Класс начало гиперссылки // Класс начало гиперссылки
function ParaHyperlinkStart() function ParaHyperlinkStart()
{ {
this.Id = g_oIdCounter.Get_NewId(); // this.Id = g_oIdCounter.Get_NewId();
this.Type = para_HyperlinkStart; this.Type = para_HyperlinkStart;
...@@ -6446,7 +6446,7 @@ function ParaHyperlinkStart() ...@@ -6446,7 +6446,7 @@ function ParaHyperlinkStart()
this.ToolTip = null; this.ToolTip = null;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора) // Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id ); // g_oTableId.Add( this, this.Id );
} }
ParaHyperlinkStart.prototype = ParaHyperlinkStart.prototype =
...@@ -6498,7 +6498,7 @@ ParaHyperlinkStart.prototype = ...@@ -6498,7 +6498,7 @@ ParaHyperlinkStart.prototype =
Set_ToolTip : function(ToolTip) 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; this.ToolTip = ToolTip;
}, },
...@@ -6522,7 +6522,7 @@ ParaHyperlinkStart.prototype = ...@@ -6522,7 +6522,7 @@ ParaHyperlinkStart.prototype =
Set_Value : function(Value) 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; this.Value = Value;
}, },
......
...@@ -1128,6 +1128,7 @@ Path.prototype = { ...@@ -1128,6 +1128,7 @@ Path.prototype = {
case historyitem_AutoShapes_Add_PathArcTo: case historyitem_AutoShapes_Add_PathArcTo:
case historyitem_AutoShapes_Add_PathQuadBezTo: case historyitem_AutoShapes_Add_PathQuadBezTo:
case historyitem_AutoShapes_Add_PathCubicBezTo: case historyitem_AutoShapes_Add_PathCubicBezTo:
case historyitem_AutoShapes_Add_PathClose:
{ {
this.ArrPathCommandInfo.splice(this.ArrPathCommandInfo.length - 1, 1); this.ArrPathCommandInfo.splice(this.ArrPathCommandInfo.length - 1, 1);
break; break;
...@@ -1151,6 +1152,17 @@ Path.prototype = { ...@@ -1151,6 +1152,17 @@ Path.prototype = {
break; 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: case historyitem_AutoShapes_Add_PathArcTo:
{ {
......
...@@ -240,54 +240,74 @@ CShape.prototype = ...@@ -240,54 +240,74 @@ CShape.prototype =
setCellFontName: function (fontName) { setCellFontName: function (fontName) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontFamily({Name: fontName, Index: -1}); text_pr.Set_FontFamily({Name: fontName, Index: -1});
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellFontSize: function (fontSize) { setCellFontSize: function (fontSize) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontSize(fontSize); text_pr.Set_FontSize(fontSize);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellBold: function (isBold) { setCellBold: function (isBold) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Bold(isBold); text_pr.Set_Bold(isBold);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellItalic: function (isItalic) { setCellItalic: function (isItalic) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Italic(isItalic); text_pr.Set_Italic(isItalic);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
this.drawingObjects.showDrawingObjects(); this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellUnderline: function (isUnderline) { setCellUnderline: function (isUnderline) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Underline(isUnderline); text_pr.Set_Underline(isUnderline);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -295,10 +315,14 @@ CShape.prototype = ...@@ -295,10 +315,14 @@ CShape.prototype =
setCellStrikeout: function (isStrikeout) { setCellStrikeout: function (isStrikeout) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Strikeout(isStrikeout); text_pr.Set_Strikeout(isStrikeout);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -306,10 +330,14 @@ CShape.prototype = ...@@ -306,10 +330,14 @@ CShape.prototype =
setCellSubscript: function (isSubscript) { setCellSubscript: function (isSubscript) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline); text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -317,10 +345,14 @@ CShape.prototype = ...@@ -317,10 +345,14 @@ CShape.prototype =
setCellSuperscript: function (isSuperscript) { setCellSuperscript: function (isSuperscript) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSuperscript ? vertalign_SuperScript : vertalign_Baseline); text_pr.Set_VertAlign(isSuperscript ? vertalign_SuperScript : vertalign_Baseline);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -328,6 +360,8 @@ CShape.prototype = ...@@ -328,6 +360,8 @@ CShape.prototype =
setCellAlign: function (align) { setCellAlign: function (align) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var align_num = null; var align_num = null;
switch(align) switch(align)
{ {
...@@ -360,6 +394,8 @@ CShape.prototype = ...@@ -360,6 +394,8 @@ CShape.prototype =
//this.calculateTransformTextMatrix(); //this.calculateTransformTextMatrix();
} }
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -380,9 +416,13 @@ CShape.prototype = ...@@ -380,9 +416,13 @@ CShape.prototype =
setPaddings: function (paddings) { setPaddings: function (paddings) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.setPaddings(paddings); this.txBody.setPaddings(paddings);
this.calculateContent(); this.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -411,6 +451,8 @@ CShape.prototype = ...@@ -411,6 +451,8 @@ CShape.prototype =
setCellTextColor: function (color) { setCellTextColor: function (color) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var unifill = new CUniFill(); var unifill = new CUniFill();
unifill.setFill(new CSolidFill()); unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor2(color, null)); unifill.fill.setColor(CorrectUniColor2(color, null));
...@@ -418,6 +460,8 @@ CShape.prototype = ...@@ -418,6 +460,8 @@ CShape.prototype =
text_pr.SetUniFill(unifill); text_pr.SetUniFill(unifill);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
...@@ -440,9 +484,13 @@ CShape.prototype = ...@@ -440,9 +484,13 @@ CShape.prototype =
setCellAngle: function (angle) { setCellAngle: function (angle) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.setVert(angle); this.txBody.setVert(angle);
this.calculateContent(); this.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -461,24 +509,32 @@ CShape.prototype = ...@@ -461,24 +509,32 @@ CShape.prototype =
setCellAllFontName: function (fontName) { setCellAllFontName: function (fontName) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontFamily({Name: fontName, Index: -1}); text_pr.Set_FontFamily({Name: fontName, Index: -1});
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellAllFontSize: function (fontSize) { setCellAllFontSize: function (fontSize) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_FontSize(fontSize); text_pr.Set_FontSize(fontSize);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -486,12 +542,16 @@ CShape.prototype = ...@@ -486,12 +542,16 @@ CShape.prototype =
setCellAllBold: function (isBold) { setCellAllBold: function (isBold) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Bold(isBold); text_pr.Set_Bold(isBold);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -499,12 +559,16 @@ CShape.prototype = ...@@ -499,12 +559,16 @@ CShape.prototype =
setCellAllItalic: function (isItalic) { setCellAllItalic: function (isItalic) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Italic(isItalic); text_pr.Set_Italic(isItalic);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -512,12 +576,16 @@ CShape.prototype = ...@@ -512,12 +576,16 @@ CShape.prototype =
setCellAllUnderline: function (isUnderline) { setCellAllUnderline: function (isUnderline) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Underline(isUnderline); text_pr.Set_Underline(isUnderline);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -525,12 +593,16 @@ CShape.prototype = ...@@ -525,12 +593,16 @@ CShape.prototype =
setCellAllStrikeout: function (isStrikeout) { setCellAllStrikeout: function (isStrikeout) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_Strikeout(isStrikeout); text_pr.Set_Strikeout(isStrikeout);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -538,12 +610,16 @@ CShape.prototype = ...@@ -538,12 +610,16 @@ CShape.prototype =
setCellAllSubscript: function (isSubscript) { setCellAllSubscript: function (isSubscript) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline); text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -551,12 +627,16 @@ CShape.prototype = ...@@ -551,12 +627,16 @@ CShape.prototype =
setCellAllSuperscript: function (isSuperscript) { setCellAllSuperscript: function (isSuperscript) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var text_pr = new ParaTextPr(); var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSubscript ? vertalign_SuperScript : vertalign_Baseline); text_pr.Set_VertAlign(isSubscript ? vertalign_SuperScript : vertalign_Baseline);
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -591,11 +671,15 @@ CShape.prototype = ...@@ -591,11 +671,15 @@ CShape.prototype =
} }
if(isRealNumber(align_num)) if(isRealNumber(align_num))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Set_ParagraphAlign(align_num); this.txBody.content.Set_ParagraphAlign(align_num);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateContent(); this.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
} }
}, },
...@@ -605,8 +689,12 @@ CShape.prototype = ...@@ -605,8 +689,12 @@ CShape.prototype =
setCellAllVertAlign: function (align) { setCellAllVertAlign: function (align) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.setVerticalAlign(align); this.txBody.setVerticalAlign(align);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -633,6 +721,8 @@ CShape.prototype = ...@@ -633,6 +721,8 @@ CShape.prototype =
setCellAllTextColor: function (color) { setCellAllTextColor: function (color) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var unifill = new CUniFill(); var unifill = new CUniFill();
unifill.setFill(new CSolidFill()); unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor2(color, null)); unifill.fill.setColor(CorrectUniColor2(color, null));
...@@ -642,6 +732,8 @@ CShape.prototype = ...@@ -642,6 +732,8 @@ CShape.prototype =
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -664,29 +756,30 @@ CShape.prototype = ...@@ -664,29 +756,30 @@ CShape.prototype =
setCellAllAngle: function (angle) { setCellAllAngle: function (angle) {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.setVert(angle); this.txBody.setVert(angle);
this.calculateContent(); this.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddredo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
setCellAllStyle: function (name) { setCellAllStyle: function (name) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_FontFamily({Name: fontName, Index: -1});
this.txBody.paragraphAdd(text_pr);
this.calculateTransformTextMatrix();
}
}, },
// Увеличение размера шрифта // Увеличение размера шрифта
increaseFontSize: function () { increaseFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Paragraph_IncDecFontSize(true); this.txBody.content.Paragraph_IncDecFontSize(true);
this.txBody.calculateContent(); this.txBody.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -694,9 +787,13 @@ CShape.prototype = ...@@ -694,9 +787,13 @@ CShape.prototype =
decreaseFontSize: function () { decreaseFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Paragraph_IncDecFontSize(false); this.txBody.content.Paragraph_IncDecFontSize(false);
this.txBody.calculateContent(); this.txBody.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -704,11 +801,15 @@ CShape.prototype = ...@@ -704,11 +801,15 @@ CShape.prototype =
increaseAllFontSize: function () { increaseAllFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(true); this.txBody.content.Paragraph_IncDecFontSize(true);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.txBody.calculateContent(); this.txBody.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -716,21 +817,33 @@ CShape.prototype = ...@@ -716,21 +817,33 @@ CShape.prototype =
decreaseAllFontSize: function () { decreaseAllFontSize: function () {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(false); this.txBody.content.Paragraph_IncDecFontSize(false);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.txBody.calculateContent(); this.txBody.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
insertHyperlink: function (options) { insertHyperlink: function (options) {
if(typeof this.curState.insertHyperlink === "function") if(isRealObject(this.txBody) && this.txBody.content.Hyperlink_CanAdd(false)
&& options && options.hyperlinkModel && options.hyperlinkModel.Hyperlink)
{ {
var text_pr = new ParaTextPr(); History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
text_pr.Set_FontFamily({Name: fontName, Index: -1}); new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.paragraphAdd(text_pr); var hyper_props = new CHyperlinkProperty();
hyper_props.Text = options.text;
hyper_props.Value = options.hyperlinkModel.Hyperlink;
this.txBody.content.Hyperlink_Add(hyper_props);
this.txBody.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
this.drawingObjects.showDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -738,9 +851,13 @@ CShape.prototype = ...@@ -738,9 +851,13 @@ CShape.prototype =
{ {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Set_ParagraphSpacing(val); this.txBody.content.Set_ParagraphSpacing(val);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
}, },
...@@ -2731,7 +2848,7 @@ CShape.prototype = ...@@ -2731,7 +2848,7 @@ CShape.prototype =
{ {
this.txBody.calculateContent(); this.txBody.calculateContent();
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
this.recalculateCurPos(); //this.recalculateCurPos();
} }
break; break;
} }
...@@ -3443,3 +3560,26 @@ function CorrectUniColor2(asc_color, unicolor) ...@@ -3443,3 +3560,26 @@ function CorrectUniColor2(asc_color, unicolor)
} }
return ret; return ret;
} }
function CHyperlinkProperty( obj )
{
if( obj )
{
this.Text = (undefined != obj.Text ) ? obj.Text : null;
this.Value = (undefined != obj.Value ) ? obj.Value : "";
this.ToolTip = (undefined != obj.ToolTip) ? obj.ToolTip : "";
}
else
{
this.Text = null;
this.Value = "";
this.ToolTip = "";
}
}
CHyperlinkProperty.prototype.get_Value = function() { return this.Value; }
CHyperlinkProperty.prototype.put_Value = function(v) { this.Value = v; }
CHyperlinkProperty.prototype.get_ToolTip = function() { return this.ToolTip; }
CHyperlinkProperty.prototype.put_ToolTip = function(v) { this.ToolTip = v; }
CHyperlinkProperty.prototype.get_Text = function() { return this.Text; }
CHyperlinkProperty.prototype.put_Text = function(v) { this.Text = v; }
...@@ -410,7 +410,7 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -410,7 +410,7 @@ function NullState(drawingObjectsController, drawingObjects)
selected_objects[0].paragraphAdd(new ParaText(String.fromCharCode(e.charCode))); selected_objects[0].paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, selected_objects[0])); this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, selected_objects[0]));
this.drawingObjects.showDrawingObjects(true); this.drawingObjects.showDrawingObjects(true);
this.drawingObjects.OnUpdateOverlay(); this.drawingObjectsController.updateSelectionState();
} }
} }
} }
...@@ -5227,7 +5227,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e) ...@@ -5227,7 +5227,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
{ {
drawingObjectsController.drawingObjects.objectLocker.reset(); 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()); drawingObjectsController.drawingObjects.objectLocker.addObjectId(drawingObjectsController.curState.textObject.Get_Id());
else if(state.id === STATES_ID_CHART_TEXT_ADD) else if(state.id === STATES_ID_CHART_TEXT_ADD)
{ {
...@@ -5301,7 +5301,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e) ...@@ -5301,7 +5301,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
if(!e.ctrlKey) if(!e.ctrlKey)
{ {
drawingObjectsController.drawingObjects.objectLocker.reset(); 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()); drawingObjectsController.drawingObjects.objectLocker.addObjectId(drawingObjectsController.curState.textObject.Get_Id());
else if(state.id === STATES_ID_CHART_TEXT_ADD) else if(state.id === STATES_ID_CHART_TEXT_ADD)
{ {
...@@ -5810,7 +5810,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e) ...@@ -5810,7 +5810,7 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
case STATES_ID_CHART_TEXT_ADD: case STATES_ID_CHART_TEXT_ADD:
{ {
drawingObjectsController.drawingObjects.objectLocker.reset(); 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()); drawingObjectsController.drawingObjects.objectLocker.addObjectId(drawingObjectsController.curState.textObject.Get_Id());
else if(state.id === STATES_ID_CHART_TEXT_ADD) else if(state.id === STATES_ID_CHART_TEXT_ADD)
{ {
......
...@@ -61,7 +61,29 @@ function MoveShapeImageTrackInGroup(originalObject) ...@@ -61,7 +61,29 @@ function MoveShapeImageTrackInGroup(originalObject)
this.x = null; this.x = null;
this.y = null; this.y = null;
this.transform = new CMatrix(); 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 = global_MatrixTransformer.Invert(originalObject.group.transform);
this.inv.tx = 0; this.inv.tx = 0;
this.inv.ty = 0; this.inv.ty = 0;
...@@ -129,8 +151,29 @@ function MoveGroupTrack(originalObject) ...@@ -129,8 +151,29 @@ function MoveGroupTrack(originalObject)
var gr_obj_transform_copy = arr_graphic_objects[i].getTransform().CreateDublicate(); var gr_obj_transform_copy = arr_graphic_objects[i].getTransform().CreateDublicate();
global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform); global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform);
this.arrTransforms2[i] = gr_obj_transform_copy; 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, 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) ...@@ -706,11 +706,34 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection)
this.transform = originalObject.transform.CreateDublicate(); this.transform = originalObject.transform.CreateDublicate();
this.geometry = originalObject.spPr.geometry.createDuplicate(); 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.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); this.overlayObject = new OverlayObject(this.geometry, this.resizedExtX, this.resizedExtY, this.brush, this.pen, this.transform);
...@@ -1792,9 +1815,9 @@ function ShapeForResizeInGroup(originalObject, parentTrack) ...@@ -1792,9 +1815,9 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
this.y = originalObject.y; this.y = originalObject.y;
this.extX = originalObject.extX; this.extX = originalObject.extX;
this.extY = originalObject.extY; this.extY = originalObject.extY;
this.rot = originalObject.rot; this.rot = isRealNumber(originalObject.rot) ? originalObject.rot : 0;
this.flipH = originalObject.flipH; this.flipH = originalObject.flipH === true;
this.flipV = originalObject.flipV; this.flipV = originalObject.flipV === true;
this.transform = originalObject.transform.CreateDublicate(); 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.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; this.centerDistX = this.x + this.extX*0.5 - this.parentTrack.extX*0.5;
...@@ -1804,7 +1827,27 @@ function ShapeForResizeInGroup(originalObject, parentTrack) ...@@ -1804,7 +1827,27 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
{ {
this.geometry.Recalculate(this.extX, this.extY); 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) this.updateSize = function(kw, kh)
{ {
var _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