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