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
d69afa12
Commit
d69afa12
authored
Jun 29, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy/paste binary from/to chart title(word)
parent
7ff92788
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
13 deletions
+26
-13
common/wordcopypaste.js
common/wordcopypaste.js
+26
-13
No files found.
common/wordcopypaste.js
View file @
d69afa12
...
...
@@ -1298,18 +1298,18 @@ CopyProcessor.prototype =
//TODO заглушка для презентационных параграфов(выделен текст внутри диаграммы) - пока не пишем в бинарник
if
(
selectedContent
.
Elements
[
0
].
Element
&&
selectedContent
.
Elements
[
0
].
Element
.
bFromDocument
===
false
)
bFromPresentation
=
true
;
//подменяем Document для копирования(если не подменить, то commentId будет не соответствовать)
this
.
oBinaryFileWriter
.
Document
=
elementsContent
[
0
].
Element
.
LogicDocument
;
if
(
!
bFromPresentation
)
this
.
oBinaryFileWriter
.
CopyStart
();
{
this
.
oBinaryFileWriter
.
Document
=
this
.
oDocument
;
}
else
{
//подменяем Document для копирования(если не подменить, то commentId будет не соответствовать)
this
.
oBinaryFileWriter
.
Document
=
elementsContent
[
0
].
Element
.
LogicDocument
;
}
this
.
oBinaryFileWriter
.
CopyStart
();
this
.
CopyDocument2
(
this
.
oRoot
,
oDocument
,
elementsContent
,
bFromPresentation
);
if
(
!
bFromPresentation
)
this
.
oBinaryFileWriter
.
CopyEnd
();
this
.
oBinaryFileWriter
.
CopyEnd
();
}
else
{
...
...
@@ -2129,7 +2129,7 @@ PasteProcessor.prototype =
ReadFromBinary
:
function
(
sBase64
)
{
var
openParams
=
{
checkFileSize
:
false
,
charCount
:
0
,
parCount
:
0
};
var
oBinaryFileReader
=
new
AscCommonWord
.
BinaryFileReader
(
this
.
oDocument
,
openParams
);
var
oBinaryFileReader
=
new
AscCommonWord
.
BinaryFileReader
(
this
.
o
Logic
Document
,
openParams
);
var
oRes
=
oBinaryFileReader
.
ReadFromString
(
sBase64
,
true
);
this
.
bInBlock
=
oRes
.
bInBlock
;
return
oRes
;
...
...
@@ -2226,15 +2226,28 @@ PasteProcessor.prototype =
}
else
if
(
this
.
oDocument
.
bPresentation
)
{
base64
=
null
;
base64FromExcel
=
null
;
this
.
pasteInPresentationShape
=
true
;
}
var
isImageInNode
=
node
&&
node
.
getElementsByTagName
(
'
img
'
)
&&
node
.
getElementsByTagName
(
'
img
'
).
length
?
true
:
false
;
if
(
base64
!=
null
)
aContent
=
this
.
ReadFromBinary
(
base64
);
//вставляем в заголовок диаграммы, предварительно конвертируем все параграфы в презентационный формат
if
(
aContent
&&
aContent
.
content
&&
this
.
oDocument
.
bPresentation
&&
oThis
.
oDocument
&&
oThis
.
oDocument
.
Parent
&&
oThis
.
oDocument
.
Parent
.
parent
&&
oThis
.
oDocument
.
Parent
.
parent
.
parent
&&
oThis
.
oDocument
.
Parent
.
parent
.
parent
.
getObjectType
&&
oThis
.
oDocument
.
Parent
.
parent
.
parent
.
getObjectType
()
==
AscDFH
.
historyitem_type_Chart
)
{
var
newContent
=
[];
for
(
var
i
=
0
;
i
<
aContent
.
content
.
length
;
i
++
)
{
if
(
type_Paragraph
===
aContent
.
content
[
i
].
Get_Type
())
{
newContent
.
push
(
AscFormat
.
ConvertParagraphToPPTX
(
aContent
.
content
[
i
],
this
.
oDocument
.
DrawingDocument
,
this
.
oDocument
));
}
}
aContent
.
content
=
newContent
;
}
if
(
base64
!=
null
&&
aContent
)
pasteFromBinary
=
true
;
else
if
(
aContentExcel
!=
null
&&
aContent
&&
aContent
.
content
)
...
...
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