Commit 9993e6ae authored by Ilya.Kirillov's avatar Ilya.Kirillov

Сделано, чтобы пересчета не происходило, если других пользователей не пришло...

Сделано, чтобы пересчета не происходило, если других пользователей не пришло изменений. Исправлен баг с нажатием PgDn во время загрузки документа.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56742 954022d7-b5bf-4e40-9824-e11837661b57
parent 0050a32a
......@@ -705,28 +705,28 @@ function CCollaborativeEditing()
this.Apply_Changes = function()
{
editor.WordControl.m_oLogicDocument.Stop_Recalculate();
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.ApplyChanges);
var LogicDocument = editor.WordControl.m_oLogicDocument;
var OtherChanges = ( this.m_aChanges.length > 0 ? true : false );
var DocState = null;
// Если нет чужих изменений, тогда и делать ничего не надо
if ( true === OtherChanges )
DocState = LogicDocument.Get_SelectionState2();
{
editor.WordControl.m_oLogicDocument.Stop_Recalculate();
this.Clear_NewImages();
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.ApplyChanges);
this.Apply_OtherChanges();
var LogicDocument = editor.WordControl.m_oLogicDocument;
var DocState = LogicDocument.Get_SelectionState2();
// После того как мы приняли чужие изменения, мы должны залочить новые объекты, которые были залочены
this.Lock_NeedLock();
this.Clear_NewImages();
if ( true === OtherChanges )
LogicDocument.Set_SelectionState2( DocState );
this.Apply_OtherChanges();
// После того как мы приняли чужие изменения, мы должны залочить новые объекты, которые были залочены
this.Lock_NeedLock();
this.OnStart_Load_Objects();
LogicDocument.Set_SelectionState2( DocState );
this.OnStart_Load_Objects();
}
};
this.Send_Changes = function()
......
......@@ -9123,74 +9123,75 @@ CDocument.prototype =
}
else
{
var TempXY = this.Cursor_GetPos();
if ( this.Pages.length > 0 )
{
var TempXY = this.Cursor_GetPos();
var X = TempXY.X;
var Y = TempXY.Y;
var X = TempXY.X;
var Y = TempXY.Y;
var Dy = this.DrawingDocument.GetVisibleMMHeight();
if ( Y + Dy > this.Get_PageLimits(this.CurPage).YLimit )
{
this.CurPage++;
var PageH = this.Get_PageLimits(this.CurPage).YLimit;
Dy -= PageH - Y;
Y = 0;
while ( Dy > PageH )
var Dy = this.DrawingDocument.GetVisibleMMHeight();
if ( Y + Dy > this.Get_PageLimits(this.CurPage).YLimit )
{
Dy -= PageH;
this.CurPage++;
}
var PageH = this.Get_PageLimits(this.CurPage).YLimit;
Dy -= PageH - Y;
Y = 0;
while ( Dy > PageH )
{
Dy -= PageH;
this.CurPage++;
}
// TODO: переделать данную проверку
if ( this.CurPage >= this.DrawingDocument.m_lPagesCount )
{
this.CurPage = this.DrawingDocument.m_lPagesCount - 1;
Dy = this.Content[this.Content.length - 1].Pages[this.Content[this.Content.length - 1].Pages.length - 1].Bounds.Bottom;
if ( this.CurPage >= this.Pages.length )
{
this.CurPage = this.Pages.length - 1;
var LastElement = this.Content[this.Pages[this.CurPage].EndPos];
Dy = LastElement.Pages[LastElement.Pages.length - 1].Bounds.Bottom;
}
}
}
// TODO: переделать данную проверку
if ( this.CurPage >= this.DrawingDocument.m_lPagesCount )
this.CurPage = this.DrawingDocument.m_lPagesCount;
if ( this.CurPage >= this.Pages.length )
this.CurPage = this.Pages.length - 1;
var StartX = X;
var StartY = Y;
var CurY = Y;
while ( Math.abs(StartY - Y) < 0.001 )
{
var bBreak = false;
CurY += Dy;
var StartX = X;
var StartY = Y;
var CurY = Y;
var PageH = this.Get_PageLimits(this.CurPage).YLimit;
if ( CurY > PageH )
while ( Math.abs(StartY - Y) < 0.001 )
{
this.CurPage++;
CurY = 0;
var bBreak = false;
CurY += Dy;
// TODO: переделать данную проверку
// Эта проверка нужна для выполнения PgDn в конце документа
if ( this.CurPage >= this.DrawingDocument.m_lPagesCount )
var PageH = this.Get_PageLimits(this.CurPage).YLimit;
if ( CurY > PageH )
{
var LastElement = this.Content[this.Content.length - 1];
this.CurPage = this.DrawingDocument.m_lPagesCount - 1;
CurY = LastElement.Pages[LastElement.Pages.length - 1].Bounds.Bottom;
}
this.CurPage++;
CurY = 0;
// Поскольку мы перешли на другую страницу, то можно из цикла выходить
bBreak = true;
}
// Эта проверка нужна для выполнения PgDn в конце документа
if ( this.CurPage >= this.Pages.length )
{
this.CurPage = this.Pages.length - 1;
var LastElement = this.Content[this.Pages[this.CurPage].EndPos];
CurY = LastElement.Pages[LastElement.Pages.length - 1].Bounds.Bottom;
}
this.Cursor_MoveAt( StartX, CurY, false );
this.CurPos.RealX = StartX;
this.CurPos.RealY = CurY;
// Поскольку мы перешли на другую страницу, то можно из цикла выходить
bBreak = true;
}
TempXY = this.Cursor_GetPos();
X = TempXY.X;
Y = TempXY.Y;
this.Cursor_MoveAt( StartX, CurY, false );
this.CurPos.RealX = StartX;
this.CurPos.RealY = CurY;
if ( true === bBreak )
break;
TempXY = this.Cursor_GetPos();
X = TempXY.X;
Y = TempXY.Y;
if ( true === bBreak )
break;
}
}
bRetValue = true;
......
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