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
31205f9b
Commit
31205f9b
authored
Mar 16, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug #34312
parent
50faec32
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
word/Editor/Document.js
word/Editor/Document.js
+7
-9
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+8
-13
word/Editor/DocumentContentBase.js
word/Editor/DocumentContentBase.js
+7
-0
No files found.
word/Editor/Document.js
View file @
31205f9b
...
...
@@ -1525,7 +1525,7 @@ function CDocument(DrawingDocument, isMainLogicDocument)
this
.
StartTime
=
0
;
}
CDocument
.
prototype
=
Object
.
create
(
CDocumentContentBase
.
prototype
);
CDocument
.
prototype
=
Object
.
create
(
CDocumentContentBase
.
prototype
);
CDocument
.
prototype
.
constructor
=
CDocument
;
CDocument
.
prototype
.
Init
=
function
()
...
...
@@ -12047,7 +12047,7 @@ CDocument.prototype.controller_Remove = function(Count, bOnlyText, bRemoveOnlySe
{
if
(
true
===
bOnTextAdd
&&
type_Table
===
this
.
Content
[
StartPos
+
1
].
Get_Type
()
&&
type_Table
===
this
.
Content
[
StartPos
].
Get_Type
())
{
this
.
Internal_Content_Add
(
StartPos
+
1
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
+
1
,
this
.
private_CreateNewParagraph
(
));
this
.
CurPos
.
ContentPos
=
StartPos
+
1
;
this
.
Content
[
StartPos
+
1
].
Cursor_MoveToStartPos
();
}
...
...
@@ -12075,7 +12075,7 @@ CDocument.prototype.controller_Remove = function(Count, bOnlyText, bRemoveOnlySe
this
.
Internal_Content_Remove
(
StartPos
+
1
,
EndPos
-
StartPos
-
1
);
if
(
type_Table
===
this
.
Content
[
StartPos
+
1
].
Get_Type
()
&&
true
===
bOnTextAdd
)
this
.
Internal_Content_Add
(
StartPos
+
1
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
+
1
,
this
.
private_CreateNewParagraph
(
));
// Встаем в начало параграфа
this
.
CurPos
.
ContentPos
=
StartPos
+
1
;
...
...
@@ -12107,7 +12107,7 @@ CDocument.prototype.controller_Remove = function(Count, bOnlyText, bRemoveOnlySe
this
.
Internal_Content_Remove
(
StartPos
,
EndPos
-
StartPos
);
if
(
type_Table
===
this
.
Content
[
StartPos
].
Get_Type
()
&&
true
===
bOnTextAdd
)
this
.
Internal_Content_Add
(
StartPos
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
,
this
.
private_CreateNewParagraph
(
));
// Встаем в начало параграфа
this
.
CurPos
.
ContentPos
=
StartPos
;
...
...
@@ -12125,7 +12125,7 @@ CDocument.prototype.controller_Remove = function(Count, bOnlyText, bRemoveOnlySe
this
.
Internal_Content_Remove
(
StartPos
,
EndPos
-
StartPos
);
if
(
type_Table
===
this
.
Content
[
StartPos
].
Get_Type
()
&&
true
===
bOnTextAdd
)
this
.
Internal_Content_Add
(
StartPos
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
,
this
.
private_CreateNewParagraph
(
));
this
.
CurPos
.
ContentPos
=
StartPos
;
this
.
Content
[
StartPos
].
Cursor_MoveToStartPos
();
...
...
@@ -12136,8 +12136,7 @@ CDocument.prototype.controller_Remove = function(Count, bOnlyText, bRemoveOnlySe
// При таком удалении надо убедиться, что в документе останется хотя бы один элемент
if
(
0
===
StartPos
&&
(
EndPos
-
StartPos
+
1
)
>=
this
.
Content
.
length
)
{
var
NewPara
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
);
this
.
Internal_Content_Add
(
0
,
NewPara
);
this
.
Internal_Content_Add
(
0
,
this
.
private_CreateNewParagraph
());
this
.
Internal_Content_Remove
(
1
,
this
.
Content
.
length
-
1
);
}
else
...
...
@@ -12211,8 +12210,7 @@ CDocument.prototype.controller_Remove = function(Count, bOnlyText, bRemoveOnlySe
}
else
if
(
this
.
Content
.
length
===
1
&&
true
===
this
.
Content
[
0
].
IsEmpty
()
&&
Count
>
0
)
{
var
NewPara
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
);
this
.
Internal_Content_Add
(
0
,
NewPara
);
this
.
Internal_Content_Add
(
0
,
this
.
private_CreateNewParagraph
());
this
.
Internal_Content_Remove
(
1
,
this
.
Content
.
length
-
1
);
}
}
...
...
word/Editor/DocumentContent.js
View file @
31205f9b
...
...
@@ -151,7 +151,7 @@ function CDocumentContent(Parent, DrawingDocument, X, Y, XLimit, YLimit, Split,
this
.
Save_StartState
();
}
}
CDocumentContent
.
prototype
=
Object
.
create
(
CDocumentContentBase
.
prototype
);
CDocumentContent
.
prototype
=
Object
.
create
(
CDocumentContentBase
.
prototype
);
CDocumentContent
.
prototype
.
constructor
=
CDocumentContent
;
CDocumentContent
.
prototype
.
Get_Id
=
function
()
...
...
@@ -2806,11 +2806,8 @@ CDocumentContent.prototype.Remove = function(Count,
{
if
(
true
===
this
.
ApplyToAll
)
{
var
oNewPara
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
this
.
X
,
this
.
Y
,
this
.
XLimit
,
this
.
YLimit
,
this
.
bPresentation
===
true
);
oNewPara
.
Correct_Content
();
this
.
Internal_Content_RemoveAll
();
this
.
Internal_Content_Add
(
0
,
oNewPara
);
this
.
Internal_Content_Add
(
0
,
this
.
private_CreateNewParagraph
()
);
this
.
CurPos
=
{
...
...
@@ -2953,7 +2950,7 @@ CDocumentContent.prototype.Remove = function(Count,
{
if
(
true
===
bOnTextAdd
&&
type_Table
===
this
.
Content
[
StartPos
+
1
].
Get_Type
()
&&
type_Table
===
this
.
Content
[
StartPos
].
Get_Type
())
{
this
.
Internal_Content_Add
(
StartPos
+
1
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
+
1
,
this
.
private_CreateNewParagraph
(
));
this
.
CurPos
.
ContentPos
=
StartPos
+
1
;
this
.
Content
[
StartPos
+
1
].
Cursor_MoveToStartPos
();
}
...
...
@@ -2981,7 +2978,7 @@ CDocumentContent.prototype.Remove = function(Count,
this
.
Internal_Content_Remove
(
StartPos
+
1
,
EndPos
-
StartPos
-
1
);
if
(
type_Table
===
this
.
Content
[
StartPos
+
1
].
Get_Type
()
&&
true
===
bOnTextAdd
)
this
.
Internal_Content_Add
(
StartPos
+
1
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
+
1
,
this
.
private_CreateNewParagraph
(
));
// Встаем в начало параграфа
this
.
CurPos
.
ContentPos
=
StartPos
+
1
;
...
...
@@ -3013,7 +3010,7 @@ CDocumentContent.prototype.Remove = function(Count,
this
.
Internal_Content_Remove
(
StartPos
,
EndPos
-
StartPos
);
if
(
type_Table
===
this
.
Content
[
StartPos
].
Get_Type
()
&&
true
===
bOnTextAdd
)
this
.
Internal_Content_Add
(
StartPos
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
,
this
.
private_CreateNewParagraph
(
));
// Встаем в начало параграфа
this
.
CurPos
.
ContentPos
=
StartPos
;
...
...
@@ -3031,7 +3028,7 @@ CDocumentContent.prototype.Remove = function(Count,
this
.
Internal_Content_Remove
(
StartPos
,
EndPos
-
StartPos
);
if
(
type_Table
===
this
.
Content
[
StartPos
].
Get_Type
()
&&
true
===
bOnTextAdd
)
this
.
Internal_Content_Add
(
StartPos
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
StartPos
,
this
.
private_CreateNewParagraph
(
));
this
.
CurPos
.
ContentPos
=
StartPos
;
this
.
Content
[
StartPos
].
Cursor_MoveToStartPos
();
...
...
@@ -3042,8 +3039,7 @@ CDocumentContent.prototype.Remove = function(Count,
// При таком удалении надо убедиться, что в документе останется хотя бы один элемент
if
(
0
===
StartPos
&&
(
EndPos
-
StartPos
+
1
)
>=
this
.
Content
.
length
)
{
var
NewPara
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
this
.
XLimit
,
this
.
YLimit
,
this
.
bPresentation
===
true
);
this
.
Internal_Content_Add
(
0
,
NewPara
);
this
.
Internal_Content_Add
(
0
,
this
.
private_CreateNewParagraph
());
this
.
Internal_Content_Remove
(
1
,
this
.
Content
.
length
-
1
);
}
else
...
...
@@ -3109,8 +3105,7 @@ CDocumentContent.prototype.Remove = function(Count,
}
else
if
(
this
.
Content
.
length
===
1
&&
true
===
this
.
Content
[
0
].
IsEmpty
()
&&
Count
>
0
)
{
var
NewPara
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
,
this
.
bPresentation
===
true
);
this
.
Internal_Content_Add
(
0
,
NewPara
);
this
.
Internal_Content_Add
(
0
,
this
.
private_CreateNewParagraph
());
this
.
Internal_Content_Remove
(
1
,
this
.
Content
.
length
-
1
);
}
}
...
...
word/Editor/DocumentContentBase.js
View file @
31205f9b
...
...
@@ -286,3 +286,10 @@ CDocumentContentBase.prototype.MoveCursorToNearestPos = function(oNearestPos)
oPara
.
Set_ParaContentPos
(
oNearestPos
.
ContentPos
,
true
,
-
1
,
-
1
);
oPara
.
Document_SetThisElementCurrent
(
true
);
};
CDocumentContentBase
.
prototype
.
private_CreateNewParagraph
=
function
()
{
var
oPara
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
,
this
.
bPresentation
===
true
);
oPara
.
Correct_Content
();
oPara
.
Cursor_MoveToStartPos
(
false
);
return
oPara
;
};
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