Commit ebc83beb 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@50069 954022d7-b5bf-4e40-9824-e11837661b57
parent 70a0fb2a
......@@ -2249,6 +2249,10 @@ CChartAsGroup.prototype =
}
}
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
if(!this.parent)
{
delete editor.WordControl.m_oLogicDocument.recalcMap[this.Id];
}
},
Redo: function(data)
......
......@@ -86,6 +86,10 @@ CGroupShape.prototype =
recalculateCursorTypes: true,
recalculateScaleCoefficients: true
};
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].recalcAll();
}
},
recalcAllColors: function()
......
......@@ -3222,7 +3222,7 @@ CPresentation.prototype =
}
else if ( true === e.ShiftKey && false === editor.isViewMode ) // Shift + Insert (аналогично Ctrl + V)
{
if ( false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
if ( false === this.Document_Is_SelectionLocked(changestype_Drawing_Props) )
{
if (!window.GlobalPasteFlag)
{
......@@ -3469,7 +3469,7 @@ CPresentation.prototype =
}
else if ( e.KeyCode == 86 && false === editor.isViewMode && true === e.CtrlKey ) // Ctrl + V - paste
{
if ( false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
if ( false === this.Document_Is_SelectionLocked(changestype_Drawing_Props) )
{
this.Create_NewHistoryPoint();
if ( true === e.ShiftKey ) // Ctrl + Shift + V - вставляем по образцу
......@@ -5368,6 +5368,36 @@ CPresentation.prototype =
}
break;
}
case historyitem_Presenattion_SlideSize:
{
var kw = Data.oldW/this.Width;
var kh = Data.oldH/this.Height;
var b_is_on = History.Is_On();
if(b_is_on)
{
History.TurnOff();
}
for(var i = 0; i < this.slideMasters.length; ++i)
{
this.slideMasters[i].changeSize(kw, kh);
}
for(var i = 0; i < this.slideLayouts.length; ++i)
{
this.slideLayouts[i].changeSize(kw, kh);
}
for(var i = 0; i < this.Slides.length; ++i)
{
this.Slides[i].changeSize(kw, kh);
}
if(b_is_on)
{
History.TurnOn();
}
break;
}
}
},
......@@ -5395,6 +5425,36 @@ CPresentation.prototype =
}
break;
}
case historyitem_Presenattion_SlideSize:
{
var kw = Data.newW/this.Width;
var kh = Data.newH/this.Height;
var b_is_on = History.Is_On();
if(b_is_on)
{
History.TurnOff();
}
for(var i = 0; i < this.slideMasters.length; ++i)
{
this.slideMasters[i].changeSize(kw, kh);
}
for(var i = 0; i < this.slideLayouts.length; ++i)
{
this.slideLayouts[i].changeSize(kw, kh);
}
for(var i = 0; i < this.Slides.length; ++i)
{
this.Slides[i].changeSize(kw, kh);
}
if(b_is_on)
{
History.TurnOn();
}
break;
}
}
},
......@@ -5405,6 +5465,7 @@ CPresentation.prototype =
Refresh_RecalcData : function(Data)
{
return;
var ChangePos = -1;
var bNeedRecalcHdrFtr = false;
......@@ -5550,77 +5611,137 @@ CPresentation.prototype =
alignLeft : function()
{
this.Slides[this.CurPage].alignLeft();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].alignLeft();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
alignRight : function()
{
this.Slides[this.CurPage].alignRight();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].alignRight();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
alignTop : function()
{
this.Slides[this.CurPage].alignTop();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].alignTop();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
alignBottom : function()
{
this.Slides[this.CurPage].alignBottom();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].alignBottom();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
alignCenter : function()
{
this.Slides[this.CurPage].alignCenter();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].alignCenter();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
alignMiddle : function()
{
this.Slides[this.CurPage].alignMiddle();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].alignMiddle();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
distributeHor : function()
{
this.Slides[this.CurPage].distributeHor();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].distributeHor();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
distributeVer : function()
{
this.Slides[this.CurPage].distributeVer();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].distributeVer();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
bringToFront : function()
{
this.Slides[this.CurPage].bringToFront();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].bringToFront();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
bringForward : function()
{
this.Slides[this.CurPage].bringForward();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].bringForward();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
sendToBack : function()
{
this.Slides[this.CurPage].sendToBack();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].sendToBack();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
bringBackward : function()
{
this.Slides[this.CurPage].bringBackward();
this.Recalculate();
if(this.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
this.Slides[this.CurPage].bringBackward();
this.Recalculate();
this.Document_UpdateUndoRedoState();
}
},
// Проверяем, находимся ли мы в гиперссылке сейчас
......@@ -5847,9 +5968,42 @@ CPresentation.prototype =
this.Document_UpdateUndoRedoState();
},
changeSlideSize: function()
changeSlideSize: function(width, height)
{
if(this.Document_Is_SelectionLocked(changestype_SlideSize) === false)
{
History.Create_NewPoint();
History.Add(this, {Type: historyitem_Presenattion_SlideSize, oldW:this.Width, oldH: this.Height, newW: width, newH: height});
var kw = width/this.Width;
var kh = height/this.Height;
this.Width = width;
this.Height = height;
var b_is_on = History.Is_On();
if(b_is_on)
{
History.TurnOff();
}
for(var i = 0; i < this.slideMasters.length; ++i)
{
this.slideMasters[i].changeSize(kw, kh);
}
for(var i = 0; i < this.slideLayouts.length; ++i)
{
this.slideLayouts[i].changeSize(kw, kh);
}
for(var i = 0; i < this.Slides.length; ++i)
{
this.Slides[i].changeSize(kw, kh);
}
if(b_is_on)
{
History.TurnOn();
}
this.Recalculate();
}
},
changeColorScheme: function(colorScheme)
......@@ -6343,6 +6497,12 @@ CPresentation.prototype =
Writer.WriteString2(Data.Id);
break;
}
case historyitem_Presenattion_SlideSize:
{
Writer.WriteDouble(Data.newW);
Writer.WriteDouble(Data.newH);
break;
}
}
return Writer;
......@@ -6421,6 +6581,40 @@ CPresentation.prototype =
this.Slides.splice(ChangesPos, 1);
break;
}
case historyitem_Presenattion_SlideSize:
{
var w = Reader.GetDouble();
var h = Reader.GetDouble();
var kw = w/this.Width;
var kh = h/this.Height;
this.Width = w;
this.Height = h;
var b_is_on = History.Is_On();
if(b_is_on)
{
History.TurnOff();
}
for(var i = 0; i < this.slideMasters.length; ++i)
{
this.slideMasters[i].changeSize(kw, kh);
}
for(var i = 0; i < this.slideLayouts.length; ++i)
{
this.slideLayouts[i].changeSize(kw, kh);
}
for(var i = 0; i < this.Slides.length; ++i)
{
this.Slides[i].changeSize(kw, kh);
}
if(b_is_on)
{
History.TurnOn();
}
}
}
return true;
},
......
......@@ -181,6 +181,7 @@ CShape.prototype =
recalculateGroupHierarchy: true,
recalculateTextStyles: [true, true, true, true, true, true, true, true, true]
};
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
recalcAllColors: function()
......
......@@ -1053,6 +1053,8 @@ Slide.prototype =
{
this.cSld.spTree[i].recalcAll();
}
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
recalcAllColors: function()
......@@ -1259,67 +1261,70 @@ Slide.prototype =
alignLeft : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
var selected_objects = this.graphicObjects.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{
this.selectedObjects[i].setXfrm(0, this.selectedObjects[i].y, null, null, null, null, null);
selected_objects[i].setXfrm(0, selected_objects[i].y, null, null, null, null, null);
}
},
alignRight : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
var selected_objects = this.graphicObjects.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{
this.selectedObjects[i].setXfrm(this.Width - this.selectedObjects[i].extX, this.selectedObjects[i].y, null, null, null, null, null);
selected_objects[i].setXfrm(this.Width - selected_objects[i].extX, selected_objects[i].y, null, null, null, null, null);
}
},
alignTop : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
for(var i = 0; i < this.graphicObjects.selectedObjects.length; ++i)
{
this.selectedObjects[i].setXfrm(this.selectedObjects[i].x, 0, null, null, null, null, null);
this.graphicObjects.selectedObjects[i].setXfrm(this.graphicObjects.selectedObjects[i].x, 0, null, null, null, null, null);
}
},
alignBottom : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
for(var i = 0; i < this.graphicObjects.selectedObjects.length; ++i)
{
this.selectedObjects[i].setXfrm(this.selectedObjects[i].x, this.Height - this.selectedObjects[i].extY, null, null, null, null, null);
this.graphicObjects.selectedObjects[i].setXfrm(this.graphicObjects.selectedObjects[i].x, this.Height - this.graphicObjects.selectedObjects[i].extY, null, null, null, null, null);
}
},
alignCenter : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
for(var i = 0; i < this.graphicObjects.selectedObjects.length; ++i)
{
this.selectedObjects[i].setXfrm((this.Width - this.selectedObjects[i].extX)*0.5, this.selectedObjects[i].y, null, null, null, null, null);
this.graphicObjects.selectedObjects[i].setXfrm((this.Width - this.graphicObjects.selectedObjects[i].extX)*0.5, this.graphicObjects.selectedObjects[i].y, null, null, null, null, null);
}
},
alignMiddle : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
for(var i = 0; i < this.graphicObjects.selectedObjects.length; ++i)
{
this.selectedObjects[i].setXfrm( this.selectedObjects[i].x, (this.Height - this.selectedObjects[i].extY)*0.5, null, null, null, null, null);
this.graphicObjects.selectedObjects[i].setXfrm(this.graphicObjects.selectedObjects[i].x, (this.Height - this.graphicObjects.selectedObjects[i].extY)*0.5, null, null, null, null, null);
}
},
distributeHor : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
for(var i = 0; i < this.graphicObjects.selectedObjects.length; ++i)
{
this.selectedObjects[i].setXfrm((this.Width - this.selectedObjects[i].extX)*0.5, this.selectedObjects[i].y, null, null, null, null, null);
this.graphicObjects.selectedObjects[i].setXfrm((this.Width - this.graphicObjects.selectedObjects[i].extX)*0.5, this.graphicObjects.selectedObjects[i].y, null, null, null, null, null);
}
},
distributeVer : function()
{
for(var i = 0; i < this.selectedObjects.length; ++i)
for(var i = 0; i < this.graphicObjects.selectedObjects.length; ++i)
{
this.selectedObjects[i].setXfrm( this.selectedObjects[i].x, (this.Height - this.selectedObjects[i].extY)*0.5, null, null, null, null, null);
this.graphicObjects.selectedObjects[i].setXfrm( this.graphicObjects.selectedObjects[i].x, (this.Height - this.graphicObjects.selectedObjects[i].extY)*0.5, null, null, null, null, null);
}
},
......@@ -1342,7 +1347,7 @@ Slide.prototype =
this.removeSelectedObjects();
for(i = 0; i < selected.length; ++i)
{
this.addSp(selected[i]);
this.addToSpTreeToPos(sp_tree.length, selected[i]);
}
break;
}
......
......@@ -381,6 +381,14 @@ MasterSlide.prototype =
this.recalcAll();
},
recalcAll: function()
{
for(var i = 0; i < this.cSld.spTree.length; ++i)
{
this.cSld.spTree[i].recalcAll();
}
},
Get_Id: function()
{
return this.Id;
......
......@@ -1617,9 +1617,8 @@ CGraphicObjects.prototype = {
{
var chart = new CChartAsGroup(this.slide);
chart.initFromBinary(binary);
this.slide.addSp(chart);
this.slide.addToSpTreeToPos(this.slide.cSld.spTree, chart);
editor.WordControl.m_oLogicDocument.recalcMap[chart.Id] = chart;
},
editChart: function(binary)
......
......@@ -2806,7 +2806,7 @@ function GroupState(drawingObjectsController, drawingObjects, group)
this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
}
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects,x, y, e.ShiftKey, e.ctrl, cur_drawing, false, true));
this.drawingObjectsController.OnUpdateOverlay();
editor.WordControl.OnUpdateOverlay();
return;
}
else if(hit_in_text_rect)
......
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