Commit 36973b27 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с быстрым пересчетом.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53864 954022d7-b5bf-4e40-9824-e11837661b57
parent 309c67fb
...@@ -1099,10 +1099,10 @@ CDocument.prototype = ...@@ -1099,10 +1099,10 @@ CDocument.prototype =
var Para = Run.Paragraph; var Para = Run.Paragraph;
var Res = Para.Recalculate_Fast( SimpleChanges ); var Res = Para.Recalculate_Fast( SimpleChanges );
if ( false !== Res ) if ( -1 !== Res )
{ {
// Перерисуем страницу, на которой произошли изменения // Перерисуем страницу, на которой произошли изменения
this.DrawingDocument.OnRecalculatePage( 0, this.Pages[0] ); this.DrawingDocument.OnRecalculatePage( Res, this.Pages[Res] );
this.DrawingDocument.OnEndRecalculate( false, true ); this.DrawingDocument.OnEndRecalculate( false, true );
return; return;
......
...@@ -4952,13 +4952,34 @@ Paragraph.prototype = ...@@ -4952,13 +4952,34 @@ Paragraph.prototype =
// Не нашли нужный Run // Не нашли нужный Run
if ( RunPos > EndPos ) if ( RunPos > EndPos )
return false; return -1;
var ParaPos = Run.Get_SimpleChanges_ParaPos(SimpleChanges); var ParaPos = Run.Get_SimpleChanges_ParaPos(SimpleChanges);
var PRS = g_oPRSW; var PRS = g_oPRSW;
var XStart, YStart, XLimit, YLimit; var XStart, YStart, XLimit, YLimit;
// Определим номер страницы
var CurLine = ParaPos.Line;
var CurRange = ParaPos.Range;
var CurPage = 0;
var PagesLen = this.Pages.length;
for ( var TempPage = 0; TempPage < PagesLen; TempPage++ )
{
var __Page = this.Pages[TempPage];
if ( CurLine <= __Page.EndLine && CurLine >= __Page.FirstLine )
{
CurPage = TempPage;
break;
}
}
if ( -1 === CurPage )
return -1;
if ( 0 === CurPage )//|| ( undefined != this.Get_FramePr() && this.Parent instanceof CDocument ) ) if ( 0 === CurPage )//|| ( undefined != this.Get_FramePr() && this.Parent instanceof CDocument ) )
{ {
XStart = this.X; XStart = this.X;
...@@ -4991,9 +5012,6 @@ Paragraph.prototype = ...@@ -4991,9 +5012,6 @@ Paragraph.prototype =
PRS.Paragraph = Run.Paragraph; PRS.Paragraph = Run.Paragraph;
var CurLine = PRS.Line;
var CurRange = PRS.Range;
var CurPage = PRS.Page;
var RangesCount = PRS.RangesCount; var RangesCount = PRS.RangesCount;
var Line = this.Lines[CurLine]; var Line = this.Lines[CurLine];
...@@ -5021,11 +5039,11 @@ Paragraph.prototype = ...@@ -5021,11 +5039,11 @@ Paragraph.prototype =
Item.Recalculate_Range( ParaPr ); Item.Recalculate_Range( ParaPr );
if ( ( true === PRS.NewRange && Pos !== EndPos ) || ( Pos === EndPos && true !== PRS.NewRange ) ) if ( ( true === PRS.NewRange && Pos !== EndPos ) || ( Pos === EndPos && true !== PRS.NewRange ) )
return false; return -1;
// Нам нужно проверить только строку с номером CurLine // Нам нужно проверить только строку с номером CurLine
if ( false === SavedLines[CurLine - Item.StartLine].Compare( Item.Lines[CurLine - Item.StartLine] ) ) if ( false === SavedLines[CurLine - Item.StartLine].Compare( Item.Lines[CurLine - Item.StartLine] ) )
return false; return -1;
Item.Restore_Lines( SL ); Item.Restore_Lines( SL );
} }
...@@ -5049,12 +5067,12 @@ Paragraph.prototype = ...@@ -5049,12 +5067,12 @@ Paragraph.prototype =
var RecalcResultAlign = this.Recalculate_Lines_Align(PRS, CurPage, ParaPr); var RecalcResultAlign = this.Recalculate_Lines_Align(PRS, CurPage, ParaPr);
if ( recalcresult_NextElement !== RecalcResultAlign ) if ( recalcresult_NextElement !== RecalcResultAlign )
return false; return -1;
// Во время пересчета сбрасываем привязку курсора к строке. // Во время пересчета сбрасываем привязку курсора к строке.
this.CurPos.Line = -1; this.CurPos.Line = -1;
return true; return this.Get_StartPage_Absolute() + CurPage;
}, },
Start_FromNewPage : function() Start_FromNewPage : function()
......
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