Commit 4af53424 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с Undo после добавления автофигуры (баг 20497).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50397 954022d7-b5bf-4e40-9824-e11837661b57
parent 89fa0a98
...@@ -9952,42 +9952,54 @@ CDocument.prototype = ...@@ -9952,42 +9952,54 @@ CDocument.prototype =
DocState.CurComment = this.Comments.Get_CurrentId(); DocState.CurComment = this.Comments.Get_CurrentId();
var State = null; var State = null;
// Работаем с колонтитулом if ( true === editor.isStartAddShape && docpostype_DrawingObjects === this.CurPos.Type )
if ( docpostype_HdrFtr === this.CurPos.Type )
State = this.HdrFtr.Get_SelectionState();
else if ( docpostype_DrawingObjects == this.CurPos.Type )
State = this.DrawingObjects.getSelectionState();
else //if ( docpostype_Content === this.CurPos.Type )
{ {
if ( true === this.Selection.Use ) DocState.CurPos.Type = docpostype_Content;
DocState.Selection.Start = false;
DocState.Selection.Use = false;
this.Content[DocState.CurPos.ContentPos].Selection_Remove();
State = this.Content[this.CurPos.ContentPos].Get_SelectionState();
}
else
{
// Работаем с колонтитулом
if ( docpostype_HdrFtr === this.CurPos.Type )
State = this.HdrFtr.Get_SelectionState();
else if ( docpostype_DrawingObjects == this.CurPos.Type )
State = this.DrawingObjects.getSelectionState();
else //if ( docpostype_Content === this.CurPos.Type )
{ {
// Выделение нумерации if ( true === this.Selection.Use )
if ( selectionflag_Numbering == this.Selection.Flag )
State = new Array();
else
{ {
var StartPos = this.Selection.StartPos; // Выделение нумерации
var EndPos = this.Selection.EndPos; if ( selectionflag_Numbering == this.Selection.Flag )
if ( StartPos > EndPos ) State = new Array();
else
{ {
var Temp = StartPos; var StartPos = this.Selection.StartPos;
StartPos = EndPos; var EndPos = this.Selection.EndPos;
EndPos = Temp; if ( StartPos > EndPos )
} {
var Temp = StartPos;
StartPos = EndPos;
EndPos = Temp;
}
State = new Array(); State = new Array();
var TempState = new Array(); var TempState = new Array();
for ( var Index = StartPos; Index <= EndPos; Index++ ) for ( var Index = StartPos; Index <= EndPos; Index++ )
{ {
TempState.push( this.Content[Index].Get_SelectionState() ); TempState.push( this.Content[Index].Get_SelectionState() );
} }
State.push( TempState ); State.push( TempState );
}
} }
else
State = this.Content[this.CurPos.ContentPos].Get_SelectionState();
} }
else
State = this.Content[this.CurPos.ContentPos].Get_SelectionState();
} }
State.push( DocState ); State.push( DocState );
......
...@@ -7235,40 +7235,53 @@ CDocumentContent.prototype = ...@@ -7235,40 +7235,53 @@ CDocumentContent.prototype =
DocState.CurPage = this.CurPage; DocState.CurPage = this.CurPage;
var State = null; var State = null;
// Работаем с колонтитулом
if ( docpostype_DrawingObjects === this.CurPos.Type ) if ( true === editor.isStartAddShape && docpostype_DrawingObjects === this.CurPos.Type )
State = this.LogicDocument.DrawingObjects.getSelectionState();
else if ( docpostype_Content === this.CurPos.Type )
{ {
if ( true === this.Selection.Use ) DocState.CurPos.Type = docpostype_Content;
DocState.Selection.Start = false;
DocState.Selection.Use = false;
this.Content[DocState.CurPos.ContentPos].Selection_Remove();
State = this.Content[this.CurPos.ContentPos].Get_SelectionState();
}
else
{
// Работаем с колонтитулом
if ( docpostype_DrawingObjects === this.CurPos.Type )
State = this.LogicDocument.DrawingObjects.getSelectionState();
else if ( docpostype_Content === this.CurPos.Type )
{ {
// Выделение нумерации if ( true === this.Selection.Use )
if ( selectionflag_Numbering == this.Selection.Flag )
State = new Array();
else
{ {
var StartPos = this.Selection.StartPos; // Выделение нумерации
var EndPos = this.Selection.EndPos; if ( selectionflag_Numbering == this.Selection.Flag )
if ( StartPos > EndPos ) State = new Array();
else
{ {
var Temp = StartPos; var StartPos = this.Selection.StartPos;
StartPos = EndPos; var EndPos = this.Selection.EndPos;
EndPos = Temp; if ( StartPos > EndPos )
} {
var Temp = StartPos;
StartPos = EndPos;
EndPos = Temp;
}
State = new Array(); State = new Array();
var TempState = new Array(); var TempState = new Array();
for ( var Index = StartPos; Index <= EndPos; Index++ ) for ( var Index = StartPos; Index <= EndPos; Index++ )
{ {
TempState.push( this.Content[Index].Get_SelectionState() ); TempState.push( this.Content[Index].Get_SelectionState() );
} }
State.push( TempState ); State.push( TempState );
}
} }
else
State = this.Content[this.CurPos.ContentPos].Get_SelectionState();
} }
else
State = this.Content[this.CurPos.ContentPos].Get_SelectionState();
} }
State.push( DocState ); State.push( DocState );
......
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