From b6a5dc6a6bfa276f6492f249f58a75dd75bca85e Mon Sep 17 00:00:00 2001
From: "Ilya.Kirillov" <Ilya.Kirillov@OnlyOffice.com>
Date: Tue, 25 Aug 2015 15:39:54 +0000
Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=B4=D0=B0=D1=87=D0=B0=20=D0=B8?=
 =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=20?=
 =?UTF-8?q?=D1=80=D0=B5=D0=B6=D0=B8=D0=BC=D0=B5=20=D1=80=D0=B5=D1=86=D0=B5?=
 =?UTF-8?q?=D0=BD=D0=B7=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?=
 =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D0=B0=20?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=BC=D0=B0=D1=81=D1=81=D0=B8=D0=B2.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64307 954022d7-b5bf-4e40-9824-e11837661b57
---
 Word/Editor/Document.js  |  3 ++-
 Word/Editor/Paragraph.js | 12 ++++++------
 Word/api.js              | 19 ++++++++++++-------
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/Word/Editor/Document.js b/Word/Editor/Document.js
index b240c45de..83d389070 100644
--- a/Word/Editor/Document.js
+++ b/Word/Editor/Document.js
@@ -11908,10 +11908,10 @@ CDocument.prototype =
         
         // Удаляем весь список
         editor.sync_BeginCatchSelectedElements();
+        editor.sync_BeginCatchRevisionsChanges();
 
         // Уберем из интерфейса записи о том где мы находимся (параграф, таблица, картинка или колонтитул)
         editor.ClearPropObjCallback();
-        editor.sync_HideAllRevisionsChanges();
 
         // Работаем с колонтитулом
         if ( docpostype_HdrFtr === this.CurPos.Type )
@@ -11959,6 +11959,7 @@ CDocument.prototype =
         }
 
         // Сообщаем, что список составлен
+        editor.sync_EndCatchRevisionsChanges();
         editor.sync_EndCatchSelectedElements();
 
         this.Document_UpdateUndoRedoState();
diff --git a/Word/Editor/Paragraph.js b/Word/Editor/Paragraph.js
index 64dc32c54..060bdbe70 100644
--- a/Word/Editor/Paragraph.js
+++ b/Word/Editor/Paragraph.js
@@ -9226,7 +9226,7 @@ Paragraph.prototype =
                     Change.put_Type(c_oAscRevisionsChangeType.ParaPr);
                     Change.put_Value("Change paragraph properties.");
                     Change.put_XY(X, Y);
-                    editor.sync_ShowRevisionsChange(Change);
+                    editor.sync_AddRevisionsChange(Change);
                 }
 
                 var ReviewType = this.Get_ReviewType();
@@ -9236,7 +9236,7 @@ Paragraph.prototype =
                     Change.put_Type(c_oAscRevisionsChangeType.ParaAdd);
                     Change.put_Value("Add paragraph.");
                     Change.put_XY(X, Y);
-                    editor.sync_ShowRevisionsChange(Change);
+                    editor.sync_AddRevisionsChange(Change);
                 }
                 else if (reviewtype_Remove == ReviewType)
                 {
@@ -9244,7 +9244,7 @@ Paragraph.prototype =
                     Change.put_Type(c_oAscRevisionsChangeType.ParaRem);
                     Change.put_Value("Delete paragraph.");
                     Change.put_XY(X, Y);
-                    editor.sync_ShowRevisionsChange(Change);
+                    editor.sync_AddRevisionsChange(Change);
                 }
 
                 var CurPos = this.Get_ParaContentPos(false, false);
@@ -9257,7 +9257,7 @@ Paragraph.prototype =
                         Change.put_Type(c_oAscRevisionsChangeType.TextPr);
                         Change.put_Value("Change text properties.");
                         Change.put_XY(X, Y);
-                        editor.sync_ShowRevisionsChange(Change);
+                        editor.sync_AddRevisionsChange(Change);
                     }
 
                     var RunReviewType = Run.Get_ReviewType();
@@ -9267,7 +9267,7 @@ Paragraph.prototype =
                         Change.put_Type(c_oAscRevisionsChangeType.TextAdd);
                         Change.put_Value("Add text.");
                         Change.put_XY(X, Y);
-                        editor.sync_ShowRevisionsChange(Change);
+                        editor.sync_AddRevisionsChange(Change);
                     }
                     else if (reviewtype_Remove == RunReviewType)
                     {
@@ -9275,7 +9275,7 @@ Paragraph.prototype =
                         Change.put_Type(c_oAscRevisionsChangeType.TextRem);
                         Change.put_Value("Delete text.");
                         Change.put_XY(X, Y);
-                        editor.sync_ShowRevisionsChange(Change);
+                        editor.sync_AddRevisionsChange(Change);
                     }
                 }
             }
diff --git a/Word/api.js b/Word/api.js
index f32a8f85c..fbcaebb14 100644
--- a/Word/api.js
+++ b/Word/api.js
@@ -587,6 +587,8 @@ function asc_docs_api(name)
             editor = window.editor;
     }
     CHART_STYLE_MANAGER = new CChartStyleManager();
+
+    this.RevisionChangesStack = [];
 }
 
 asc_docs_api.prototype.LoadFontsFromServer = function(_fonts)
@@ -6761,7 +6763,7 @@ asc_docs_api.prototype.AddTextArt = function(nStyle)
         History.Create_NewPoint(historydescription_Document_AddTextArt);
         this.WordControl.m_oLogicDocument.Add_TextArt(nStyle);
     }
-}
+};
 
 
 asc_docs_api.prototype.sync_StartAddShapeCallback = function(value)
@@ -7442,15 +7444,18 @@ asc_docs_api.prototype.asc_IsTrackResivisions = function()
 {
     return this.WordControl.m_oLogicDocument.Is_TrackRevisions();
 };
-asc_docs_api.prototype.sync_ShowRevisionsChange = function(Change)
+asc_docs_api.prototype.sync_BeginCatchRevisionsChanges = function()
 {
-//    var document.
-//    alert(Change.get_Value());
-    this.asc_fireCallback("asc_onShowRevisionsChange", Change);
+    this.RevisionChangesStack = [];
 };
-asc_docs_api.prototype.sync_HideAllRevisionsChanges = function()
+asc_docs_api.prototype.sync_EndCatchRevisionsChanges = function()
+{
+    this.asc_fireCallback("asc_onShowRevisionsChange", this.RevisionChangesStack);
+};
+
+asc_docs_api.prototype.sync_AddRevisionsChange = function(Change)
 {
-    this.asc_fireCallback("asc_onHideAllRevisionsChanges");
+    this.RevisionChangesStack.push(Change);
 };
 
 function CRevisionsChange()
-- 
2.30.9