Commit 4f60f63f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov
Browse files

Сделано, чтобы при скролле, если открыто окно с текущими изменениями в...

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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65202 954022d7-b5bf-4e40-9824-e11837661b57
parent 7bc8c7e6
......@@ -1002,7 +1002,7 @@ ParaComment.prototype =
Get_ParaPosByContentPos : function(ContentPos, Depth)
{
return new CParaPos(StartRange, StartLine, 0, 0);
return new CParaPos(this.StartRange, this.StartLine, 0, 0);
},
//-----------------------------------------------------------------------------------
// Функции пересчета
......
......@@ -14896,26 +14896,77 @@ CDocument.prototype.private_GetRevisionsChangeParagraph = function(Direction, Cu
return SearchEngine;
}
if (docpostype_HdrFtr === this.CurPos.Type)
var HdrFtr = CurrentPara.Get_HdrFtr();
if (null !== HdrFtr)
{
// TODO: Реализовать
this.private_GetRevisionsChangeParagraphInHdrFtr(SearchEngine, HdrFtr);
if (Direction < 0 && true !== SearchEngine.Is_Found())
this.private_GetRevisionsChangeParagraphInDocument(SearchEngine, this.Content.length - 1);
}
else //if (docpostype_Content === this.CurPos.Type)
else
{
var Pos = (true === this.Selection.Use && docpostype_DrawingObjects !== this.CurPos.Type ? (this.Selection.StartPos <= this.Selection.EndPos ? this.Selection.StartPos : this.Selection.EndPos) : this.CurPos.ContentPos);
this.private_GetRevisionsChangeParagraphInDocument(SearchEngine, Pos);
if (Direction > 0 && true !== SearchEngine.Is_Found())
this.private_GetRevisionsChangeParagraphInHdrFtr(SearchEngine, null);
}
return SearchEngine;
};
CDocument.prototype.private_GetRevisionsChangeParagraphInDocument = function(SearchEngine, Pos)
{
var Direction = SearchEngine.Get_Direction();
this.Content[Pos].Get_RevisionsChangeParagraph(SearchEngine);
while (true !== SearchEngine.Is_Found())
{
Pos = (Direction > 0 ? Pos + 1 : Pos - 1);
if (Pos >= this.Content.length || Pos < 0)
break;
this.Content[Pos].Get_RevisionsChangeParagraph(SearchEngine);
while (true !== SearchEngine.Is_Found())
}
};
CDocument.prototype.private_GetRevisionsChangeParagraphInHdrFtr = function(SearchEngine, HdrFtr)
{
var AllHdrFtrs = this.SectionsInfo.Get_AllHdrFtrs();
var Count = AllHdrFtrs.length;
if (Count <= 0)
return;
var Pos = -1;
if (null !== HdrFtr)
{
for (var Index = 0; Index < Count; ++Index)
{
Pos = (Direction > 0 ? Pos + 1 : Pos - 1);
if (Pos >= this.Content.length || Pos < 0)
if (HdrFtr === AllHdrFtrs[Index])
{
Pos = Index;
break;
this.Content[Pos].Get_RevisionsChangeParagraph(SearchEngine);
}
}
}
return SearchEngine;
var Direction = SearchEngine.Get_Direction();
if (Pos < 0 || Pos >= Count)
{
if (Direction > 0)
Pos = 0;
else
Pos = Count - 1;
}
AllHdrFtrs[Pos].Get_RevisionsChangeParagraph(SearchEngine);
while (true !== SearchEngine.Is_Found())
{
Pos = (Direction > 0 ? Pos + 1 : Pos - 1);
if (Pos >= Count || Pos < 0)
break;
AllHdrFtrs[Pos].Get_RevisionsChangeParagraph(SearchEngine);
}
};
CDocument.prototype.Accept_RevisionChange = function(Change)
{
......@@ -15219,7 +15270,21 @@ CDocumentSectionsInfo.prototype =
return -1;
},
Get_AllHdrFtrs : function()
{
var HdrFtrs = [];
var Count = this.Elements.length;
for (var Index = 0; Index < Count; Index++)
{
var SectPr = this.Elements[Index].SectPr;
SectPr.Get_AllHdrFtrs(HdrFtrs);
}
return HdrFtrs;
},
Reset_HdrFtrRecalculateCache : function()
{
var Count = this.Elements.length;
......@@ -15739,6 +15804,9 @@ CTrackRevisionsManager.prototype.Begin_CollectChanges = function(bSaveCurrentCha
};
CTrackRevisionsManager.prototype.End_CollectChanges = function(oEditor)
{
if (null !== this.CurChange)
this.VisibleChanges = [this.CurChange];
var bMove = false;
var bChange = false;
......
......@@ -95,7 +95,7 @@ function CDocumentContent(Parent, DrawingDocument, X, Y, XLimit, YLimit, Split,
this.m_oContentChanges = new CContentChanges(); // список изменений(добавление/удаление элементов)
this.StartState = null;
this.ReindexStartPos = -1;
this.ReindexStartPos = 0;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id );
......
......@@ -277,34 +277,34 @@ CHeaderFooter.prototype =
Set_CurrentElement : function(bUpdateStates)
{
var PageIndex = -1;
for (var Key in this.Parent.Pages)
{
var PIndex = Key | 0;
if ( ( this === this.Parent.Pages[PIndex].Header || this === this.Parent.Pages[PIndex].Footer ) && ( -1 === PageIndex || PageIndex > PIndex ) )
if ((this === this.Parent.Pages[PIndex].Header || this === this.Parent.Pages[PIndex].Footer) && (-1 === PageIndex || PageIndex > PIndex))
PageIndex = PIndex;
}
if ( -1 === PageIndex )
return;
this.Parent.CurHdrFtr = this;
this.Parent.CurHdrFtr = this;
this.Parent.WaitMouseDown = true;
this.Parent.CurPage = PageIndex;
this.Parent.CurPage = PageIndex;
if (-1 === PageIndex)
this.RecalcInfo.CurPage = -1;
var OldDocPosType = this.LogicDocument.CurPos.Type;
this.LogicDocument.CurPos.Type = docpostype_HdrFtr;
if ( true === bUpdateStates )
if (true === bUpdateStates && -1 !== PageIndex)
{
this.Set_Page( PageIndex );
this.Set_Page(PageIndex);
this.LogicDocument.Document_UpdateInterfaceState();
this.LogicDocument.Document_UpdateRulersState();
this.LogicDocument.Document_UpdateSelectionState();
}
if ( docpostype_HdrFtr !== OldDocPosType )
if (docpostype_HdrFtr !== OldDocPosType)
{
this.DrawingDocument.ClearCachePages();
this.DrawingDocument.FirePaint();
......@@ -548,6 +548,13 @@ CHeaderFooter.prototype =
Document_UpdateSelectionState : function()
{
if (-1 === this.RecalcInfo.CurPage)
{
this.DrawingDocument.TargetEnd();
this.DrawingDocument.SelectEnabled(false);
return;
}
if ( docpostype_DrawingObjects == this.Content.CurPos.Type )
{
return this.LogicDocument.DrawingObjects.documentUpdateSelectionState();
......@@ -910,6 +917,9 @@ CHeaderFooter.prototype =
Selection_Check : function(X, Y, Page_Abs, NearPos)
{
if (-1 === this.RecalcInfo.CurPage)
return false;
var HdrFtrPage = this.Content.Get_StartPage_Absolute();
if ( undefined !== NearPos || HdrFtrPage === Page_Abs )
return this.Content.Selection_Check( X, Y, Page_Abs, NearPos );
......@@ -1152,6 +1162,10 @@ CHeaderFooter.prototype.Set_ParagraphFramePr = function(FramePr, bDelete)
{
return this.Content.Set_ParagraphFramePr(FramePr, bDelete);
};
CHeaderFooter.prototype.Get_RevisionsChangeParagraph = function(SearchEngine)
{
return this.Content.Get_RevisionsChangeParagraph(SearchEngine);
};
//-----------------------------------------------------------------------------------
// Класс для работы с колонтитулами
......
......@@ -9289,12 +9289,15 @@ Paragraph.prototype =
if (this.Is_TrackRevisions() && editor && this.bFromDocument)
{
var TrackManager = this.LogicDocument.Get_TrackRevisionsManager();
var TextTransform = this.Get_ParentTextTransform();
var ContentPos = this.Get_ParaContentPos(this.Selection.Use, true);
var ParaPos = this.Get_ParaPosByContentPos(ContentPos);
var Page_abs = this.Get_StartPage_Absolute() + ParaPos.Page;
var _Y = this.Pages[ParaPos.Page].Y + this.Lines[ParaPos.Line].Top;
var _Y = 0, Page_abs = 0, TextTransform = undefined;
if (this.Pages.length > 0 && this.Lines.length > 0)
{
var ContentPos = this.Get_ParaContentPos(this.Selection.Use, true);
var ParaPos = this.Get_ParaPosByContentPos(ContentPos);
Page_abs = this.Get_StartPage_Absolute() + ParaPos.Page;
_Y = this.Pages[ParaPos.Page].Y + this.Lines[ParaPos.Line].Top;
TextTransform = this.Get_ParentTextTransform();
}
var _X = (this.LogicDocument ? this.LogicDocument.Get_PageLimits(Page_abs).XLimit : 0);
var Coords = this.DrawingDocument.ConvertCoordsToCursorWR(_X, _Y, Page_abs, TextTransform);
......@@ -13378,6 +13381,13 @@ Paragraph.prototype.Is_SelectedAll = function()
return ((true === bStart && true === bEnd) || true === this.ApplyToAll ? true : false);
};
Paragraph.prototype.Get_HdrFtr = function()
{
if (this.Parent)
return this.Parent.Is_HdrFtr(true);
return null;
};
var pararecalc_0_All = 0;
var pararecalc_0_None = 1;
......
......@@ -150,6 +150,22 @@ CSectionPr.prototype =
return true;
},
Get_AllHdrFtrs : function(HdrFtrs)
{
if (!HdrFtrs)
HdrFtrs = [];
if (null !== this.HeaderFirst) HdrFtrs.push(this.HeaderFirst);
if (null !== this.HeaderEven) HdrFtrs.push(this.HeaderEven);
if (null !== this.HeaderDefault) HdrFtrs.push(this.HeaderDefault);
if (null !== this.FooterFirst) HdrFtrs.push(this.FooterFirst);
if (null !== this.FooterEven) HdrFtrs.push(this.FooterEven);
if (null !== this.FooterDefault) HdrFtrs.push(this.FooterDefault);
return HdrFtrs;
},
Compare_PageSize : function(OtherSectionPr)
{
var ThisPS = this.PageSize;
......
......@@ -7242,6 +7242,10 @@ asc_docs_api.prototype.asc_GetPrevRevisionsChange = function()
{
return this.WordControl.m_oLogicDocument.Get_PrevRevisionChange();
};
asc_docs_api.prototype.sync_UpdateRevisionsChangesPosition = function(X, Y)
{
this.asc_fireCallback("asc_onUpdateRevisionsChangesPosition", X, Y);
};
function CRevisionsChange()
{
......@@ -7257,6 +7261,11 @@ function CRevisionsChange()
this.Paragraph = null;
this.StartPos = null;
this.EndPos = null;
this._X = 0;
this._Y = 0;
this._PageNum = 0;
this._PosChanged = false;
}
CRevisionsChange.prototype.get_UserId = function(){return this.UserId;};
CRevisionsChange.prototype.put_UserId = function(UserId){this.UserId = UserId;};
......@@ -7277,7 +7286,41 @@ CRevisionsChange.prototype.put_XY = function(X, Y){this.X = X; this.Y = Y;};
CRevisionsChange.prototype.put_Value = function(Value){this.Value = Value;};
CRevisionsChange.prototype.put_Paragraph = function(Para){this.Paragraph = Para;};
CRevisionsChange.prototype.get_Paragraph = function(){return this.Paragraph;};
CRevisionsChange.prototype.put_InternalPos = function(x, y, pageNum)
{
if (this._PageNum !== pageNum
|| Math.abs(this._X - x) > 0.001
|| Math.abs(this._Y - y) > 0.001)
{
this._X = x;
this._Y = y;
this._PageNum = pageNum;
this._PosChanged = true;
}
else
{
this._PosChanged = false;
}
};
CRevisionsChange.prototype.get_InternalPosX = function()
{
return this._X;
};
CRevisionsChange.prototype.get_InternalPosY = function()
{
return this._Y;
};
CRevisionsChange.prototype.get_InternalPosPageNum = function()
{
return this._PageNum;
};
CRevisionsChange.prototype.ComparePrevPosition = function()
{
if (true === this._PosChanged)
return false;
return true;
};
asc_docs_api.prototype.asc_stopSaving = function () {
this.asc_IncrementCounterLongAction();
......
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