Commit 16366bfc authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с добавлением изменений во время Undo/Redo.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65263 954022d7-b5bf-4e40-9824-e11837661b57
parent 57f9164c
......@@ -6,7 +6,10 @@
* Time: 14:35
*/
var historyoperation_None = 0x00;
var historyoperation_Undo = 0x01;
var historyoperation_Redo = 0x02;
var historyoperation_GetRecalcData = 0x03;
function CHistory(Document)
{
......@@ -37,6 +40,8 @@ function CHistory(Document)
this.FileCheckSum = 0;
this.FileSize = 0;
this.Operation = historyoperation_None;
}
CHistory.prototype =
......@@ -169,6 +174,8 @@ CHistory.prototype =
if ( true != this.Can_Undo() )
return null;
this.private_StartOperation(historyoperation_Undo);
if (editor)
editor.setUserAlive();
......@@ -212,6 +219,7 @@ CHistory.prototype =
if (null != Point)
this.Document.Set_SelectionState( Point.State );
this.private_EndOperation();
return this.RecalculateData;
},
......@@ -223,6 +231,8 @@ CHistory.prototype =
if (editor)
editor.setUserAlive();
this.private_StartOperation(historyoperation_Redo);
this.Document.Selection_Remove();
......@@ -247,6 +257,7 @@ CHistory.prototype =
this.Document.Set_SelectionState( State );
this.private_EndOperation();
return this.RecalculateData;
},
......@@ -632,7 +643,7 @@ CHistory.prototype =
for ( var Index = 0; Index < Point.Items.length; Index++ )
{
var Item = Point.Items[Index];
if ( true === Item.NeedRecalc )
Item.Class.Refresh_RecalcData( Item.Data );
}
......@@ -828,6 +839,23 @@ CHistory.prototype =
};
CHistory.prototype.private_StartOperation = function(Type)
{
this.Operation = Type;
};
CHistory.prototype.private_EndOperation = function(Type)
{
this.Operation = historyoperation_None;
};
CHistory.prototype.Is_UndoOperation = function()
{
return (this.Operation === historyoperation_Undo ? true : false);
};
CHistory.prototype.Is_RedoOperation = function()
{
return (this.Operation === historyoperation_Redo ? true : false);
};
var History = null;
function CRC32()
......
......@@ -6356,6 +6356,9 @@ CTable.prototype =
if ( true === bNeedRecalc )
{
if (true !== History.Is_UndoOperation() && true !== History.Is_RedoOperation())
this.Internal_RecalculateGrid();
this.Refresh_RecalcData2( nRowIndex, 0 );
}
},
......@@ -21175,7 +21178,7 @@ function CTableCell(Row, ColW)
CurPage : 0,
Y_VAlign_offset : [] // Сдвиг, который нужно сделать из-за VAlign (массив по страницам)
};
this.Index = 0;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
......@@ -21750,7 +21753,6 @@ CTableCell.prototype =
{
this.Content.Cursor_MoveToEndPos();
},
//-----------------------------------------------------------------------------------
// Работаем с настройками ячейки
//-----------------------------------------------------------------------------------
......@@ -22678,32 +22680,32 @@ CTableCell.prototype =
var Table = this.Row.Table;
var TablePr = Table.Get_CompiledPr(false).TablePr;
if ( tbllayout_AutoFit === TablePr.TableLayout )
if (tbllayout_AutoFit === TablePr.TableLayout && true !== History.Is_UndoOperation() && true !== History.Is_RedoOperation())
{
if ( this.Row.Table.Parent.Pages.length > 0 )
if (this.Row.Table.Parent.Pages.length > 0)
{
// Если изменение внутри ячейки влечет за собой изменение сетки таблицы, тогда
// пересчитывать таблицу надо с самого начала.
var CurCol;
var ColsCount = Table.TableGridCalc.length;
var TableGrid_old = [];
for ( CurCol = 0; CurCol < ColsCount; CurCol++ )
for (CurCol = 0; CurCol < ColsCount; CurCol++)
TableGrid_old[CurCol] = Table.TableGridCalc[CurCol];
Table.Internal_RecalculateGrid();
var TableGrid_new = Table.TableGridCalc;
for ( CurCol = 0; CurCol < ColsCount; CurCol++ )
for (CurCol = 0; CurCol < ColsCount; CurCol++)
{
if ( Math.abs( TableGrid_old[CurCol] - TableGrid_new[CurCol] ) > 0.001 )
if (Math.abs(TableGrid_old[CurCol] - TableGrid_new[CurCol]) > 0.001)
{
Table.RecalcInfo.TableBorders = true;
return Table.Refresh_RecalcData2( 0, 0 );
return Table.Refresh_RecalcData2(0, 0);
}
}
}
else
return Table.Refresh_RecalcData2( 0, 0 );
return Table.Refresh_RecalcData2(0, 0);
}
this.Row.Refresh_RecalcData2( this.Index, Page_Rel );
......
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