Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
1d100eda
Commit
1d100eda
authored
Dec 04, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug #33362
parent
d13e5285
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
common/editorscommon.js
common/editorscommon.js
+11
-0
word/Editor/History.js
word/Editor/History.js
+62
-0
No files found.
common/editorscommon.js
View file @
1d100eda
...
@@ -2534,6 +2534,17 @@ CContentChanges.prototype.Add = function(Changes)
...
@@ -2534,6 +2534,17 @@ CContentChanges.prototype.Add = function(Changes)
{
{
this
.
m_aChanges
.
push
(
Changes
);
this
.
m_aChanges
.
push
(
Changes
);
};
};
CContentChanges
.
prototype
.
RemoveByHistoryItem
=
function
(
Item
)
{
for
(
var
nIndex
=
0
,
nCount
=
this
.
m_aChanges
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
if
(
this
.
m_aChanges
[
nIndex
].
m_pData
===
Item
)
{
this
.
m_aChanges
.
splice
(
nIndex
,
1
);
return
;
}
}
};
CContentChanges
.
prototype
.
Clear
=
function
()
CContentChanges
.
prototype
.
Clear
=
function
()
{
{
this
.
m_aChanges
.
length
=
0
;
this
.
m_aChanges
.
length
=
0
;
...
...
word/Editor/History.js
View file @
1d100eda
...
@@ -252,6 +252,7 @@ CHistory.prototype =
...
@@ -252,6 +252,7 @@ CHistory.prototype =
var
Item
=
Point
.
Items
[
Index
];
var
Item
=
Point
.
Items
[
Index
];
Item
.
Class
.
Undo
(
Item
.
Data
);
Item
.
Class
.
Undo
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
this
.
private_UpdateContentChangesOnUndo
(
Item
);
}
}
}
}
}
}
...
@@ -265,6 +266,7 @@ CHistory.prototype =
...
@@ -265,6 +266,7 @@ CHistory.prototype =
var
Item
=
Point
.
Items
[
Index
];
var
Item
=
Point
.
Items
[
Index
];
Item
.
Class
.
Undo
(
Item
.
Data
);
Item
.
Class
.
Undo
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
this
.
private_UpdateContentChangesOnUndo
(
Item
);
}
}
}
}
...
@@ -292,6 +294,7 @@ CHistory.prototype =
...
@@ -292,6 +294,7 @@ CHistory.prototype =
var
Item
=
Point
.
Items
[
Index
];
var
Item
=
Point
.
Items
[
Index
];
Item
.
Class
.
Redo
(
Item
.
Data
);
Item
.
Class
.
Redo
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
this
.
private_UpdateContentChangesOnRedo
(
Item
);
}
}
// Восстанавливаем состояние на следующую точку
// Восстанавливаем состояние на следующую точку
...
@@ -1056,6 +1059,65 @@ CHistory.prototype =
...
@@ -1056,6 +1059,65 @@ CHistory.prototype =
}
}
}
}
};
};
CHistory
.
prototype
.
private_UpdateContentChangesOnUndo
=
function
(
Item
)
{
if
(
this
.
private_IsContentChange
(
Item
.
Class
,
Item
.
Data
))
{
Item
.
Class
.
m_oContentChanges
.
RemoveByHistoryItem
(
Item
);
}
};
CHistory
.
prototype
.
private_UpdateContentChangesOnRedo
=
function
(
Item
)
{
if
(
this
.
private_IsContentChange
(
Item
.
Class
,
Item
.
Data
))
{
var
bAdd
=
this
.
private_IsAddContentChange
(
Item
.
Class
,
Item
.
Data
);
var
Count
=
this
.
private_GetItemsCountInContentChange
(
Item
.
Class
,
Item
.
Data
);
var
ContentChanges
=
new
AscCommon
.
CContentChangesElement
(
(
bAdd
==
true
?
AscCommon
.
contentchanges_Add
:
AscCommon
.
contentchanges_Remove
),
Data
.
Pos
,
Count
,
Item
);
Class
.
Add_ContentChanges
(
ContentChanges
);
this
.
CollaborativeEditing
.
Add_NewDC
(
Class
);
}
};
CHistory
.
prototype
.
private_IsContentChange
=
function
(
Class
,
Data
)
{
var
bPresentation
=
!
(
typeof
CPresentation
===
"
undefined
"
);
var
bSlide
=
!
(
typeof
Slide
===
"
undefined
"
);
if
(
(
Class
instanceof
CDocument
&&
(
AscDFH
.
historyitem_Document_AddItem
===
Data
.
Type
||
AscDFH
.
historyitem_Document_RemoveItem
===
Data
.
Type
)
)
||
(((
Class
instanceof
CDocumentContent
||
Class
instanceof
AscFormat
.
CDrawingDocContent
))
&&
(
AscDFH
.
historyitem_DocumentContent_AddItem
===
Data
.
Type
||
AscDFH
.
historyitem_DocumentContent_RemoveItem
===
Data
.
Type
)
)
||
(
Class
instanceof
CTable
&&
(
AscDFH
.
historyitem_Table_AddRow
===
Data
.
Type
||
AscDFH
.
historyitem_Table_RemoveRow
===
Data
.
Type
)
)
||
(
Class
instanceof
CTableRow
&&
(
AscDFH
.
historyitem_TableRow_AddCell
===
Data
.
Type
||
AscDFH
.
historyitem_TableRow_RemoveCell
===
Data
.
Type
)
)
||
(
Class
instanceof
Paragraph
&&
(
AscDFH
.
historyitem_Paragraph_AddItem
===
Data
.
Type
||
AscDFH
.
historyitem_Paragraph_RemoveItem
===
Data
.
Type
)
)
||
(
Class
instanceof
ParaHyperlink
&&
(
AscDFH
.
historyitem_Hyperlink_AddItem
===
Data
.
Type
||
AscDFH
.
historyitem_Hyperlink_RemoveItem
===
Data
.
Type
)
)
||
(
Class
instanceof
ParaRun
&&
(
AscDFH
.
historyitem_ParaRun_AddItem
===
Data
.
Type
||
AscDFH
.
historyitem_ParaRun_RemoveItem
===
Data
.
Type
)
)
||
(
bPresentation
&&
Class
instanceof
CPresentation
&&
(
AscDFH
.
historyitem_Presentation_AddSlide
===
Data
.
Type
||
AscDFH
.
historyitem_Presentation_RemoveSlide
===
Data
.
Type
))
||
(
bSlide
&&
Class
instanceof
Slide
&&
(
AscDFH
.
historyitem_SlideAddToSpTree
===
Data
.
Type
||
AscDFH
.
historyitem_SlideRemoveFromSpTree
===
Data
.
Type
))
)
return
true
;
return
false
;
};
CHistory
.
prototype
.
private_IsAddContentChange
=
function
(
Class
,
Data
)
{
return
(
(
Class
instanceof
CDocument
&&
AscDFH
.
historyitem_Document_AddItem
===
Data
.
Type
)
||
(
((
Class
instanceof
CDocumentContent
||
Class
instanceof
AscFormat
.
CDrawingDocContent
))
&&
AscDFH
.
historyitem_DocumentContent_AddItem
===
Data
.
Type
)
||
(
Class
instanceof
CTable
&&
AscDFH
.
historyitem_Table_AddRow
===
Data
.
Type
)
||
(
Class
instanceof
CTableRow
&&
AscDFH
.
historyitem_TableRow_AddCell
===
Data
.
Type
)
||
(
Class
instanceof
Paragraph
&&
AscDFH
.
historyitem_Paragraph_AddItem
===
Data
.
Type
)
||
(
Class
instanceof
ParaHyperlink
&&
AscDFH
.
historyitem_Hyperlink_AddItem
===
Data
.
Type
)
||
(
Class
instanceof
ParaRun
&&
AscDFH
.
historyitem_ParaRun_AddItem
===
Data
.
Type
)
||
(
bPresentation
&&
Class
instanceof
CPresentation
&&
(
AscDFH
.
historyitem_Presentation_AddSlide
===
Data
.
Type
))
||
(
bSlide
&&
Class
instanceof
Slide
&&
(
AscDFH
.
historyitem_SlideAddToSpTree
===
Data
.
Type
))
)
?
true
:
false
;
};
CHistory
.
prototype
.
private_GetItemsCountInContentChange
=
function
(
Class
,
Data
)
{
if
(
(
Class
instanceof
Paragraph
)
||
(
Class
instanceof
ParaHyperlink
)
||
(
Class
instanceof
ParaRun
)
||
(
Class
instanceof
CDocument
&&
AscDFH
.
historyitem_Document_RemoveItem
===
Data
.
Type
)
||
(
((
Class
instanceof
CDocumentContent
||
Class
instanceof
AscFormat
.
CDrawingDocContent
))
&&
AscDFH
.
historyitem_DocumentContent_RemoveItem
===
Data
.
Type
)
)
return
Data
.
Items
.
length
;
return
1
;
};
function
CRC32
()
function
CRC32
()
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment