Commit 989825e0 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@65145 954022d7-b5bf-4e40-9824-e11837661b57
parent 2459bb16
......@@ -386,6 +386,8 @@ function DrawingObjects() {
_this.asyncImageEndLoaded = null;
_this.asyncImagesDocumentEndLoaded = null;
_this.nCurPointItemsLength = 0;
// Task timer
var aDrawTasks = [];
......@@ -2641,6 +2643,7 @@ function DrawingObjects() {
_this.controller.startRecalculate();
_this.sendGraphicObjectProps();
api.exucuteHistoryEnd = false;
_this.nCurPointItemsLength = 0;
}
else
{
......@@ -2648,6 +2651,14 @@ function DrawingObjects() {
}
if(api.exucuteHistory)
{
if(History.CurPoint)
{
_this.nCurPointItemsLength = History.CurPoint.Items.length;
}
else
{
_this.nCurPointItemsLength = 0;
}
api.exucuteHistory = false;
}
}
......@@ -2655,24 +2666,19 @@ function DrawingObjects() {
{
if(History.CurPoint && History.CurPoint.Items.length > 0)
{
// ExecuteNoHistory(function(){
var Point = History.CurPoint;
// Откатываем все действия в обратном порядке (относительно их выполенения)
for ( var Index = Point.Items.length - 1; Index > -1; Index-- )
{
var Item = Point.Items[Index];
if(!Item.Class.Read_FromBinary2)
Item.Class.Undo( Item.Type, Item.Data, Item.SheetId );
else
Item.Class.Undo(Item.Data);
}
Point.Items.length = 0;
_this.controller.setSelectionState(Point.SelectionState, Point.SelectionState.length-1);
_this.controller.setGraphicObjectPropsCallBack(props);
_this.controller.startRecalculate();
//_this.sendGraphicObjectProps();
//}, this, []);
var Point = History.CurPoint;
var nBottomIndex = this.nCurPointItemsLength - 1;
for ( var Index = Point.Items.length - 1; Index > nBottomIndex; Index-- )
{
var Item = Point.Items[Index];
if(!Item.Class.Read_FromBinary2)
Item.Class.Undo( Item.Type, Item.Data, Item.SheetId );
else
Item.Class.Undo(Item.Data);
}
Point.Items.length = this.nCurPointItemsLength;
_this.controller.setGraphicObjectPropsCallBack(props);
_this.controller.startRecalculate();
}
}
......
......@@ -106,6 +106,8 @@ function asc_docs_api(name)
this.noCreatePoint = false;
this.exucuteHistory = false;
this.exucuteHistoryEnd = false;
this.nCurPointItemsLength = 0;
this.pasteCallback = null;
this.pasteImageMap = null;
this.EndActionLoadImages = 0;
......@@ -2167,13 +2169,14 @@ asc_docs_api.prototype.ShapeApply = function(prop)
{
if( !this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd)
{
History.UndoLastPoint();
History.UndoLastPoint(this.nCurPointItemsLength);
var slide = this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage];
slide.graphicObjects.applyDrawingProps(prop);
slide.graphicObjects.recalculate();
this.WordControl.m_oDrawingDocument.OnRecalculatePage(this.WordControl.m_oLogicDocument.CurPage, slide);
this.WordControl.m_oDrawingDocument.OnEndRecalculate();
this.exucuteHistoryEnd = false;
this.nCurPointItemsLength = 0;
}
else
{
......@@ -2181,6 +2184,11 @@ asc_docs_api.prototype.ShapeApply = function(prop)
}
if(this.exucuteHistory)
{
var oPoint = History.Points[History.Index];
if(oPoint)
{
this.nCurPointItemsLength = oPoint.Items.length;
}
this.exucuteHistory = false;
}
}
......@@ -2188,15 +2196,12 @@ asc_docs_api.prototype.ShapeApply = function(prop)
{
if(this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage])
{
//ExecuteNoHistory(function(){
History.UndoLastPoint();
var slide = this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage];
slide.graphicObjects.applyDrawingProps(prop);
slide.graphicObjects.recalculate();
this.WordControl.m_oDrawingDocument.OnRecalculatePage(this.WordControl.m_oLogicDocument.CurPage, slide);
this.WordControl.m_oDrawingDocument.OnEndRecalculate();
//}, this, []);
History.UndoLastPoint(this.nCurPointItemsLength);
var slide = this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage];
slide.graphicObjects.applyDrawingProps(prop);
slide.graphicObjects.recalculate();
this.WordControl.m_oDrawingDocument.OnRecalculatePage(this.WordControl.m_oLogicDocument.CurPage, slide);
this.WordControl.m_oDrawingDocument.OnEndRecalculate();
}
}
}
......
......@@ -137,19 +137,27 @@ CHistory.prototype =
return false;
},
UndoLastPoint : function()
UndoLastPoint : function(nBottomIndex)
{
var oPoint = this.Points[this.Index];
if(oPoint)
{
var aItems = oPoint.Items;
for (var i = aItems.length - 1; i >= 0; i--)
var _bottomIndex;
if(isRealNumber(nBottomIndex))
{
_bottomIndex = nBottomIndex - 1;
}
else
{
_bottomIndex = -1;
}
for (var i = aItems.length - 1; i > _bottomIndex; i--)
{
var oItem = aItems[i];
oItem.Class.Undo(oItem.Data);
}
oPoint.Items.length = 0;
this.Document.Set_SelectionState(oPoint.State);
oPoint.Items.length = _bottomIndex + 1;
}
},
......
......@@ -490,6 +490,7 @@ function asc_docs_api(name)
this.noCreatePoint = false;
this.exucuteHistory = false;
this.exucuteHistoryEnd = false;
this.nCurPointItemsLength = 0;
this.isDocumentEditor = true;
this.OpenDocumentProgress = new CDocOpenProgress();
......@@ -5024,9 +5025,10 @@ asc_docs_api.prototype.ImgApply = function(obj)
{
if( !this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd)
{
History.UndoLastPoint();
History.UndoLastPoint(this.nCurPointItemsLength);
this.WordControl.m_oLogicDocument.Set_ImageProps( ImagePr );
this.exucuteHistoryEnd = false;
this.nCurPointItemsLength = 0;
}
else
{
......@@ -5036,12 +5038,17 @@ asc_docs_api.prototype.ImgApply = function(obj)
if(this.exucuteHistory)
{
this.exucuteHistory = false;
var oPoint = History.Points[History.Index];
if(oPoint)
{
this.nCurPointItemsLength = oPoint.Items.length;
}
}
}
else
{
//ExecuteNoHistory(function(){
History.UndoLastPoint();
History.UndoLastPoint(this.nCurPointItemsLength);
this.WordControl.m_oLogicDocument.Set_ImageProps( ImagePr );
//}, this, []);
}
......
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