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
4af17cb6
Commit
4af17cb6
authored
Aug 03, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 32892, 32891
parent
9bf1a693
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
30 deletions
+129
-30
cell/model/clipboard.js
cell/model/clipboard.js
+28
-1
common/wordcopypaste.js
common/wordcopypaste.js
+101
-29
No files found.
cell/model/clipboard.js
View file @
4af17cb6
...
@@ -1005,8 +1005,35 @@
...
@@ -1005,8 +1005,35 @@
{
{
return
""
;
return
""
;
}
}
else
{
//для слайда читаем только запись бинарника, где хранится base64
History
.
TurnOff
();
break
;
var
loader
=
new
AscCommon
.
BinaryPPTYLoader
();
loader
.
presentation
=
worksheet
.
model
;
loader
.
Start_UseFullUrl
();
loader
.
stream
=
stream
;
//read base64(first slide)
var
imageUrl
=
stream
.
GetString2
();
loader
.
End_UseFullUrl
()
var
drawing
=
AscFormat
.
DrawingObjectsController
.
prototype
.
createImage
(
imageUrl
,
0
,
0
,
p_width
,
p_height
);
var
arr_shapes
=
[];
arr_shapes
[
0
]
=
worksheet
.
objectRender
.
createDrawingObject
();
arr_shapes
[
0
].
graphicObject
=
drawing
;
History
.
TurnOn
();
if
(
!
(
window
[
"
Asc
"
][
"
editor
"
]
&&
window
[
"
Asc
"
][
"
editor
"
].
isChartEditor
))
{
t
.
_insertImagesFromBinary
(
worksheet
,
{
Drawings
:
arr_shapes
},
isIntoShape
);
}
}
return
true
;
}
}
}
}
...
...
common/wordcopypaste.js
View file @
4af17cb6
...
@@ -1151,6 +1151,8 @@ CopyProcessor.prototype =
...
@@ -1151,6 +1151,8 @@ CopyProcessor.prototype =
this
.
oPresentationWriter
.
WriteString2
(
"
SlideObjects
"
);
this
.
oPresentationWriter
.
WriteString2
(
"
SlideObjects
"
);
this
.
oPresentationWriter
.
WriteString2
(
selected_slides
[
0
].
ImageUrl
);
this
.
oPresentationWriter
.
WriteULong
(
selected_slides
.
length
);
this
.
oPresentationWriter
.
WriteULong
(
selected_slides
.
length
);
var
layouts_map
=
{};
var
layouts_map
=
{};
var
layout_count
=
0
;
var
layout_count
=
0
;
...
@@ -2442,37 +2444,106 @@ PasteProcessor.prototype =
...
@@ -2442,37 +2444,106 @@ PasteProcessor.prototype =
for
(
var
i
=
0
;
i
<
objects
.
arrImages
.
length
;
++
i
)
for
(
var
i
=
0
;
i
<
objects
.
arrImages
.
length
;
++
i
)
{
{
var
oBuilderImage
=
objects
.
arrImages
[
i
];
var
oBuilderImage
=
objects
.
arrImages
[
i
];
if
(
oBuilderImage
.
AdditionalUrls
)
{
if
(
oBuilderImage
.
AdditionalUrls
)
for
(
var
j
=
0
;
j
<
oBuilderImage
.
AdditionalUrls
.
length
;
++
j
)
{
{
for
(
var
j
=
0
;
j
<
oBuilderImage
.
AdditionalUrls
.
length
;
++
j
)
{
aImagesToDownload
.
push
(
oBuilderImage
.
AdditionalUrls
[
j
]);
aImagesToDownload
.
push
(
oBuilderImage
.
AdditionalUrls
[
j
]);
}
}
}
}
}
}
AscCommon
.
sendImgUrls
(
oThis
.
api
,
aImagesToDownload
,
function
(
data
)
{
AscCommon
.
sendImgUrls
(
oThis
.
api
,
aImagesToDownload
,
function
(
data
)
{
var
image_map
=
{};
var
image_map
=
{};
for
(
var
i
=
0
,
length
=
Math
.
min
(
data
.
length
,
objects
.
arrImages
.
length
);
i
<
length
;
++
i
)
{
for
(
var
i
=
0
,
length
=
Math
.
min
(
data
.
length
,
objects
.
arrImages
.
length
);
i
<
length
;
++
i
)
{
var
elem
=
data
[
i
];
var
elem
=
data
[
i
];
if
(
null
!=
elem
.
url
)
{
if
(
null
!=
elem
.
url
)
{
var
name
=
g_oDocumentUrls
.
imagePath2Local
(
elem
.
path
);
var
name
=
g_oDocumentUrls
.
imagePath2Local
(
elem
.
path
);
var
imageElem
=
objects
.
arrImages
[
i
];
var
imageElem
=
objects
.
arrImages
[
i
];
if
(
null
!=
imageElem
)
{
if
(
null
!=
imageElem
)
{
//для вставки graphicFrame в виде картинки(если было при копировании выделено несколько графических объектов)
//для вставки graphicFrame в виде картинки(если было при копировании выделено несколько графических объектов)
if
(
imageElem
.
base64
)
{
if
(
imageElem
.
base64
)
{
imageElem
.
base64
=
name
;
imageElem
.
base64
=
name
;
}
else
{
}
else
{
imageElem
.
SetUrl
(
name
);
imageElem
.
SetUrl
(
name
);
}
}
}
}
image_map
[
i
]
=
name
;
image_map
[
i
]
=
name
;
}
else
{
}
else
{
image_map
[
i
]
=
aImagesToDownload
[
i
];
image_map
[
i
]
=
aImagesToDownload
[
i
];
}
}
}
}
aContent
=
oThis
.
_convertExcelBinary
(
null
,
arr_shapes
);
aContent
=
oThis
.
_convertExcelBinary
(
null
,
arr_shapes
);
oThis
.
aContent
=
aContent
.
content
;
oThis
.
aContent
=
aContent
.
content
;
oThis
.
api
.
pre_Paste
(
aContent
.
fonts
,
image_map
,
fPrepasteCallback
);
oThis
.
api
.
pre_Paste
(
aContent
.
fonts
,
image_map
,
fPrepasteCallback
);
});
});
if
(
bTurnOffTrackRevisions
){
if
(
bTurnOffTrackRevisions
)
{
oThis
.
api
.
WordControl
.
m_oLogicDocument
.
TrackRevisions
=
true
;
}
return
;
}
case
"
SlideObjects
"
:
{
History
.
TurnOff
();
var
loader
=
new
AscCommon
.
BinaryPPTYLoader
();
loader
.
Start_UseFullUrl
();
pptx_content_loader
.
Reader
.
Start_UseFullUrl
();
loader
.
stream
=
stream
;
loader
.
presentation
=
editor
.
WordControl
.
m_oLogicDocument
;
var
imageUrl
=
stream
.
GetString2
();
History
.
TurnOn
();
var
aImagesToDownload
=
[];
aImagesToDownload
.
push
(
imageUrl
);
//load image(slide base64)
AscCommon
.
sendImgUrls
(
oThis
.
api
,
aImagesToDownload
,
function
(
data
)
{
var
image_map
=
{};
var
elem
=
data
[
0
];
if
(
null
!=
elem
.
url
)
{
imageUrl
=
g_oDocumentUrls
.
imagePath2Local
(
elem
.
path
);
image_map
[
0
]
=
imageUrl
;
}
//create paragraph, pararun and paradrawing
var
tempParagraph
=
new
Paragraph
(
oThis
.
oDocument
.
DrawingDocument
,
oThis
.
oDocument
,
0
,
0
,
0
,
0
,
0
);
var
graphicObj
=
AscFormat
.
DrawingObjectsController
.
prototype
.
createImage
(
imageUrl
,
0
,
0
,
p_width
,
p_height
);
var
tempParaRun
=
new
ParaRun
();
tempParaRun
.
Paragraph
=
null
;
tempParaRun
.
Add_ToContent
(
0
,
new
ParaDrawing
(),
false
);
tempParaRun
.
Content
[
0
].
Set_GraphicObject
(
graphicObj
);
tempParaRun
.
Content
[
0
].
GraphicObj
.
setParent
(
tempParaRun
.
Content
[
0
]);
tempParaRun
.
Content
[
0
].
CheckWH
();
tempParagraph
.
Content
.
splice
(
tempParagraph
.
Content
.
length
-
1
,
0
,
tempParaRun
);
aContent
=
[];
aContent
.
push
(
tempParagraph
);
oThis
.
aContent
=
aContent
;
oThis
.
api
.
pre_Paste
(
null
,
image_map
,
fPrepasteCallback
);
});
if
(
bTurnOffTrackRevisions
)
{
oThis
.
api
.
WordControl
.
m_oLogicDocument
.
TrackRevisions
=
true
;
oThis
.
api
.
WordControl
.
m_oLogicDocument
.
TrackRevisions
=
true
;
}
}
return
;
return
;
...
@@ -2718,6 +2789,7 @@ PasteProcessor.prototype =
...
@@ -2718,6 +2789,7 @@ PasteProcessor.prototype =
loader
.
presentation
=
editor
.
WordControl
.
m_oLogicDocument
;
loader
.
presentation
=
editor
.
WordControl
.
m_oLogicDocument
;
//read slides
//read slides
var
imageUrl
=
stream
.
GetString2
();
var
slide_count
=
stream
.
GetULong
();
var
slide_count
=
stream
.
GetULong
();
var
arr_arrTransforms
=
[];
var
arr_arrTransforms
=
[];
for
(
var
i
=
0
;
i
<
slide_count
;
++
i
)
for
(
var
i
=
0
;
i
<
slide_count
;
++
i
)
...
...
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