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
c3f34f7f
Commit
c3f34f7f
authored
Feb 28, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply list level from mso html(copy/paste from ms word)
parent
0b6e913f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
3 deletions
+83
-3
common/wordcopypaste.js
common/wordcopypaste.js
+83
-3
No files found.
common/wordcopypaste.js
View file @
c3f34f7f
...
...
@@ -4824,6 +4824,14 @@ PasteProcessor.prototype =
if
(
null
!=
pNoHtmlPr
.
numType
)
num
=
pNoHtmlPr
.
numType
;
var
type
=
pNoHtmlPr
[
"
list-style-type
"
];
//TODO обработать символы из mso html
/*if(pNoHtmlPr['mso-list'])
{
var msoListIgnoreSymbol = this._getMsoListSymbol(node);
}*/
if
(
type
)
{
switch
(
type
)
...
...
@@ -4961,13 +4969,17 @@ PasteProcessor.prototype =
var
startIndex
;
if
(
-
1
!=
(
startIndex
=
pNoHtmlPr
[
'
mso-list
'
].
indexOf
(
"
level
"
)))
{
//lvl = parseInt(pNoHtmlPr['mso-list'].substr(startIndex + 5, 1)) - 1;
}
lvl
=
parseInt
(
pNoHtmlPr
[
'
mso-list
'
].
substr
(
startIndex
+
5
,
1
))
-
1
;
}
Para
.
Numbering_Set
(
NumId
,
lvl
);
}
else
{
Para
.
Numbering_Add
(
NumId
,
lvl
);
}
}
}
else
{
var
numPr
=
Para
.
Numbering_Get
();
...
...
@@ -5235,6 +5247,74 @@ PasteProcessor.prototype =
}
}
},
_getMsoListSymbol
:
function
(
node
)
{
var
res
=
null
;
var
nodeList
=
this
.
_getMsoListIgnore
(
node
);
if
(
nodeList
)
{
var
value
=
nodeList
.
innerText
;
if
(
value
)
{
for
(
var
k
=
0
,
length
=
value
.
length
;
k
<
length
;
k
++
)
{
var
nUnicode
=
null
;
var
nCharCode
=
value
.
charCodeAt
(
k
);
if
(
AscCommon
.
isLeadingSurrogateChar
(
nCharCode
))
{
if
(
k
+
1
<
length
)
{
k
++
;
var
nTrailingChar
=
value
.
charCodeAt
(
k
);
nUnicode
=
AscCommon
.
decodeSurrogateChar
(
nCharCode
,
nTrailingChar
);
}
}
else
nUnicode
=
nCharCode
;
if
(
null
!=
nUnicode
)
{
var
Item
;
if
(
0x20
!=
nUnicode
&&
0xA0
!=
nUnicode
&&
0x2009
!=
nUnicode
)
{
if
(
!
res
)
{
res
=
""
;
}
res
+=
value
.
charAt
(
k
);
}
}
}
}
}
return
res
;
},
_getMsoListIgnore
:
function
(
node
)
{
if
(
!
node
||
(
node
&&
!
node
.
children
))
{
return
null
;
}
for
(
var
i
=
0
;
i
<
node
.
children
.
length
;
i
++
)
{
var
child
=
node
.
children
[
i
];
var
style
=
child
.
getAttribute
(
"
style
"
);
if
(
style
)
{
var
pNoHtml
=
{};
this
.
_parseCss
(
style
,
pNoHtml
);
if
(
"
Ignore
"
===
pNoHtml
[
"
mso-list
"
])
{
return
child
;
}
}
if
(
child
.
children
&&
child
.
children
.
length
)
{
return
this
.
_getMsoListIgnore
(
child
);
}
}
},
_AddNextPrevToContent
:
function
(
oDoc
)
{
var
prev
=
null
;
...
...
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