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
0357adbe
Commit
0357adbe
authored
Sep 20, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug #35786 From now we do not remove empty comments.
parent
66c4d9d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
26 deletions
+5
-26
word/Editor/Comments.js
word/Editor/Comments.js
+3
-0
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+2
-26
No files found.
word/Editor/Comments.js
View file @
0357adbe
...
@@ -1194,6 +1194,9 @@ ParaComment.prototype.IsStopCursorOnEntryExit = function()
...
@@ -1194,6 +1194,9 @@ ParaComment.prototype.IsStopCursorOnEntryExit = function()
{
{
return
false
;
return
false
;
};
};
ParaComment
.
prototype
.
PreDelete
=
function
()
{
};
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
// Разное
// Разное
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
...
...
word/Editor/Paragraph.js
View file @
0357adbe
...
@@ -814,7 +814,8 @@ Paragraph.prototype.Internal_Content_Remove2 = function(Pos, Count)
...
@@ -814,7 +814,8 @@ Paragraph.prototype.Internal_Content_Remove2 = function(Pos, Count)
for
(
var
nIndex
=
Pos
;
nIndex
<
Pos
+
Count
;
++
nIndex
)
for
(
var
nIndex
=
Pos
;
nIndex
<
Pos
+
Count
;
++
nIndex
)
{
{
this
.
Content
[
nIndex
].
PreDelete
();
if
(
this
.
Content
[
nIndex
].
PreDelete
)
this
.
Content
[
nIndex
].
PreDelete
();
}
}
var
DeletedItems
=
this
.
Content
.
slice
(
Pos
,
Pos
+
Count
);
var
DeletedItems
=
this
.
Content
.
slice
(
Pos
,
Pos
+
Count
);
...
@@ -5269,12 +5270,10 @@ Paragraph.prototype.Correct_Content = function(_StartPos, _EndPos, bDoNotDeleteE
...
@@ -5269,12 +5270,10 @@ Paragraph.prototype.Correct_Content = function(_StartPos, _EndPos, bDoNotDeleteE
// 1. Спаренные пустые раны мы удаляем (удаляем 1 ран)
// 1. Спаренные пустые раны мы удаляем (удаляем 1 ран)
// 2. Удаляем пустые гиперссылки, пустые формулы, пустые поля
// 2. Удаляем пустые гиперссылки, пустые формулы, пустые поля
// 3. Добавляем пустой ран в место, где нет рана (например, между двумя идущими подряд гиперссылками)
// 3. Добавляем пустой ран в место, где нет рана (например, между двумя идущими подряд гиперссылками)
// 4. Удаляем пустые комментарии
var
StartPos
=
(
undefined
===
_StartPos
||
null
===
_StartPos
?
0
:
Math
.
max
(
_StartPos
-
1
,
0
)
);
var
StartPos
=
(
undefined
===
_StartPos
||
null
===
_StartPos
?
0
:
Math
.
max
(
_StartPos
-
1
,
0
)
);
var
EndPos
=
(
undefined
===
_EndPos
||
null
===
_EndPos
?
this
.
Content
.
length
-
1
:
Math
.
min
(
_EndPos
+
1
,
this
.
Content
.
length
-
1
)
);
var
EndPos
=
(
undefined
===
_EndPos
||
null
===
_EndPos
?
this
.
Content
.
length
-
1
:
Math
.
min
(
_EndPos
+
1
,
this
.
Content
.
length
-
1
)
);
var
CommentsToDelete
=
[];
for
(
var
CurPos
=
EndPos
;
CurPos
>=
StartPos
;
CurPos
--
)
for
(
var
CurPos
=
EndPos
;
CurPos
>=
StartPos
;
CurPos
--
)
{
{
var
CurElement
=
this
.
Content
[
CurPos
];
var
CurElement
=
this
.
Content
[
CurPos
];
...
@@ -5283,23 +5282,6 @@ Paragraph.prototype.Correct_Content = function(_StartPos, _EndPos, bDoNotDeleteE
...
@@ -5283,23 +5282,6 @@ Paragraph.prototype.Correct_Content = function(_StartPos, _EndPos, bDoNotDeleteE
{
{
this
.
Internal_Content_Remove
(
CurPos
);
this
.
Internal_Content_Remove
(
CurPos
);
}
}
else
if
(
para_Comment
===
CurElement
.
Type
&&
false
===
CurElement
.
Start
)
{
var
CommentId
=
CurElement
.
CommentId
;
for
(
var
CurPos2
=
CurPos
-
1
;
CurPos2
>=
0
;
CurPos2
--
)
{
var
CurElement2
=
this
.
Content
[
CurPos2
];
if
(
para_Comment
===
CurElement2
.
Type
&&
CommentId
===
CurElement2
.
CommentId
)
{
CommentsToDelete
.
push
(
CommentId
);
break
;
}
else
if
(
true
!==
CurElement2
.
Is_Empty
())
break
;
}
}
else
if
(
para_Run
!==
CurElement
.
Type
)
else
if
(
para_Run
!==
CurElement
.
Type
)
{
{
if
(
CurPos
===
this
.
Content
.
length
-
1
||
para_Run
!==
this
.
Content
[
CurPos
+
1
].
Type
||
CurPos
===
this
.
Content
.
length
-
2
)
if
(
CurPos
===
this
.
Content
.
length
-
1
||
para_Run
!==
this
.
Content
[
CurPos
+
1
].
Type
||
CurPos
===
this
.
Content
.
length
-
2
)
...
@@ -5326,12 +5308,6 @@ Paragraph.prototype.Correct_Content = function(_StartPos, _EndPos, bDoNotDeleteE
...
@@ -5326,12 +5308,6 @@ Paragraph.prototype.Correct_Content = function(_StartPos, _EndPos, bDoNotDeleteE
}
}
}
}
var
CommentsCount
=
CommentsToDelete
.
length
;
for
(
var
CommentIndex
=
0
;
CommentIndex
<
CommentsCount
;
CommentIndex
++
)
{
this
.
LogicDocument
.
RemoveComment
(
CommentsToDelete
[
CommentIndex
],
true
,
false
);
}
// Проверим, чтобы предпоследний элемент был Run
// Проверим, чтобы предпоследний элемент был Run
if
(
1
===
this
.
Content
.
length
||
para_Run
!==
this
.
Content
[
this
.
Content
.
length
-
2
].
Type
)
if
(
1
===
this
.
Content
.
length
||
para_Run
!==
this
.
Content
[
this
.
Content
.
length
-
2
].
Type
)
{
{
...
...
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