Commit e3782513 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Поправлен баг с зависанием при Undo изменения текстовых свойств, примененных с помощью слайдеров.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65129 954022d7-b5bf-4e40-9824-e11837661b57
parent 0b180512
...@@ -2655,11 +2655,24 @@ function DrawingObjects() { ...@@ -2655,11 +2655,24 @@ function DrawingObjects() {
{ {
if(History.CurPoint && History.CurPoint.Items.length > 0) if(History.CurPoint && History.CurPoint.Items.length > 0)
{ {
ExecuteNoHistory(function(){ // 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.setGraphicObjectPropsCallBack(props);
_this.controller.startRecalculate(); _this.controller.startRecalculate();
_this.sendGraphicObjectProps(); //_this.sendGraphicObjectProps();
}, this, []); //}, this, []);
} }
} }
......
...@@ -2883,10 +2883,6 @@ function CorrectUniFill(asc_fill, unifill, editorId) ...@@ -2883,10 +2883,6 @@ function CorrectUniFill(asc_fill, unifill, editorId)
} }
case c_oAscFill.FILL_TYPE_BLIP: case c_oAscFill.FILL_TYPE_BLIP:
{ {
if (ret.fill == null || ret.fill.type != FILL_TYPE_BLIP)
{
ret.fill = new CBlipFill();
}
var _url = _fill.url; var _url = _fill.url;
var _tx_id = _fill.texture_id; var _tx_id = _fill.texture_id;
...@@ -2895,6 +2891,21 @@ function CorrectUniFill(asc_fill, unifill, editorId) ...@@ -2895,6 +2891,21 @@ function CorrectUniFill(asc_fill, unifill, editorId)
_url = g_oUserTexturePresets[_tx_id]; _url = g_oUserTexturePresets[_tx_id];
} }
if (ret.fill == null)
{
ret.fill = new CBlipFill();
}
if(ret.fill.type != FILL_TYPE_BLIP)
{
if(!(typeof (_url) === "string" && _url.length > 0) || !isRealNumber(_fill.type))
{
break;
}
ret.fill = new CBlipFill();
}
if (_url != null && _url !== undefined && _url != "") if (_url != null && _url !== undefined && _url != "")
ret.fill.setRasterImageId(_url); ret.fill.setRasterImageId(_url);
...@@ -2911,10 +2922,22 @@ function CorrectUniFill(asc_fill, unifill, editorId) ...@@ -2911,10 +2922,22 @@ function CorrectUniFill(asc_fill, unifill, editorId)
} }
case c_oAscFill.FILL_TYPE_PATT: case c_oAscFill.FILL_TYPE_PATT:
{ {
if (ret.fill == null || ret.fill.type != FILL_TYPE_PATT) if (ret.fill == null)
{
ret.fill = new CPattFill();
}
if(ret.fill.type != FILL_TYPE_PATT)
{
if(undefined != _fill.PatternType && undefined != _fill.fgClr && undefined != _fill.bgClr)
{ {
ret.fill = new CPattFill(); ret.fill = new CPattFill();
} }
else
{
break;
}
}
if (undefined != _fill.PatternType) if (undefined != _fill.PatternType)
{ {
...@@ -2941,13 +2964,26 @@ function CorrectUniFill(asc_fill, unifill, editorId) ...@@ -2941,13 +2964,26 @@ function CorrectUniFill(asc_fill, unifill, editorId)
} }
case c_oAscFill.FILL_TYPE_GRAD: case c_oAscFill.FILL_TYPE_GRAD:
{ {
if (ret.fill == null || ret.fill.type != FILL_TYPE_GRAD) if (ret.fill == null)
{ {
ret.fill = new CGradFill(); ret.fill = new CGradFill();
} }
var _colors = _fill.Colors; var _colors = _fill.Colors;
var _positions = _fill.Positions; var _positions = _fill.Positions;
if(ret.fill.type != FILL_TYPE_GRAD )
{
if(undefined != _colors && undefined != _positions)
{
ret.fill = new CGradFill();
}
else
{
break;
}
}
if (undefined != _colors && undefined != _positions) if (undefined != _colors && undefined != _positions)
{ {
if (_colors.length == _positions.length) if (_colors.length == _positions.length)
......
...@@ -2704,11 +2704,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2704,11 +2704,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
spreadsheet_api.prototype.setStartPointHistory = function() { spreadsheet_api.prototype.setStartPointHistory = function() {
this.noCreatePoint = true; this.noCreatePoint = true;
this.exucuteHistory = true; this.exucuteHistory = true;
this.asc_stopSaving();
}; };
spreadsheet_api.prototype.setEndPointHistory = function() { spreadsheet_api.prototype.setEndPointHistory = function() {
this.noCreatePoint = false; this.noCreatePoint = false;
this.exucuteHistoryEnd = true; this.exucuteHistoryEnd = true;
this.asc_continueSaving();
}; };
spreadsheet_api.prototype.asc_startAddShape = function(sPreset) { spreadsheet_api.prototype.asc_startAddShape = function(sPreset) {
......
...@@ -2167,6 +2167,7 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -2167,6 +2167,7 @@ asc_docs_api.prototype.ShapeApply = function(prop)
{ {
if( !this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd) if( !this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd)
{ {
History.UndoLastPoint();
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();
...@@ -2187,13 +2188,15 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -2187,13 +2188,15 @@ 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(){ //ExecuteNoHistory(function(){
History.UndoLastPoint();
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, []); //}, this, []);
} }
} }
} }
...@@ -2202,10 +2205,12 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -2202,10 +2205,12 @@ asc_docs_api.prototype.ShapeApply = function(prop)
asc_docs_api.prototype.setStartPointHistory = function(){ asc_docs_api.prototype.setStartPointHistory = function(){
this.noCreatePoint = true; this.noCreatePoint = true;
this.exucuteHistory = true; this.exucuteHistory = true;
this.asc_IncrementCounterLongAction();
}; };
asc_docs_api.prototype.setEndPointHistory = function(){ asc_docs_api.prototype.setEndPointHistory = function(){
this.noCreatePoint = false; this.noCreatePoint = false;
this.exucuteHistoryEnd = true; this.exucuteHistoryEnd = true;
this.asc_DecrementCounterLongAction();
}; };
asc_docs_api.prototype.SetSlideProps = function(prop) asc_docs_api.prototype.SetSlideProps = function(prop)
{ {
......
...@@ -137,6 +137,22 @@ CHistory.prototype = ...@@ -137,6 +137,22 @@ CHistory.prototype =
return false; return false;
}, },
UndoLastPoint : function()
{
var oPoint = this.Points[this.Index];
if(oPoint)
{
var aItems = oPoint.Items;
for (var i = aItems.length - 1; i >= 0; i--)
{
var oItem = aItems[i];
oItem.Class.Undo(oItem.Data);
}
oPoint.Items.length = 0;
this.Document.Set_SelectionState(oPoint.State);
}
},
Undo : function(Options) Undo : function(Options)
{ {
this.Check_UninonLastPoints(); this.Check_UninonLastPoints();
......
...@@ -2529,10 +2529,14 @@ asc_docs_api.prototype.sync_CanCopyCutCallback = function(bCanCopyCut) ...@@ -2529,10 +2529,14 @@ asc_docs_api.prototype.sync_CanCopyCutCallback = function(bCanCopyCut)
asc_docs_api.prototype.setStartPointHistory = function(){ asc_docs_api.prototype.setStartPointHistory = function(){
this.noCreatePoint = true; this.noCreatePoint = true;
this.exucuteHistory = true; this.exucuteHistory = true;
this.asc_IncrementCounterLongAction();
this.WordControl.m_oLogicDocument.TurnOff_InterfaceEvents();
}; };
asc_docs_api.prototype.setEndPointHistory = function(){ asc_docs_api.prototype.setEndPointHistory = function(){
this.noCreatePoint = false; this.noCreatePoint = false;
this.exucuteHistoryEnd = true; this.exucuteHistoryEnd = true;
this.asc_DecrementCounterLongAction();
this.WordControl.m_oLogicDocument.TurnOn_InterfaceEvents();
}; };
function CDocInfoProp(obj) function CDocInfoProp(obj)
...@@ -5020,6 +5024,7 @@ asc_docs_api.prototype.ImgApply = function(obj) ...@@ -5020,6 +5024,7 @@ asc_docs_api.prototype.ImgApply = function(obj)
{ {
if( !this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd) if( !this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd)
{ {
History.UndoLastPoint();
this.WordControl.m_oLogicDocument.Set_ImageProps( ImagePr ); this.WordControl.m_oLogicDocument.Set_ImageProps( ImagePr );
this.exucuteHistoryEnd = false; this.exucuteHistoryEnd = false;
} }
...@@ -5035,9 +5040,10 @@ asc_docs_api.prototype.ImgApply = function(obj) ...@@ -5035,9 +5040,10 @@ asc_docs_api.prototype.ImgApply = function(obj)
} }
else else
{ {
ExecuteNoHistory(function(){ //ExecuteNoHistory(function(){
History.UndoLastPoint();
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