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
bf006b95
Commit
bf006b95
authored
Aug 03, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
insert table from presentation into excel
parent
31433402
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
36 deletions
+39
-36
cell/model/clipboard.js
cell/model/clipboard.js
+39
-36
No files found.
cell/model/clipboard.js
View file @
bf006b95
...
@@ -971,16 +971,8 @@
...
@@ -971,16 +971,8 @@
}
}
var
objects
=
this
.
ReadPresentationShapes
(
stream
,
worksheet
);
var
objects
=
this
.
ReadPresentationShapes
(
stream
,
worksheet
);
//****если записана одна табличка, то вставляем html и поддерживаем все цвета и стили****
if
(
!
objects
.
arrImages
.
length
&&
objects
.
arrShapes
.
length
===
1
)
{
var
drawing
=
objects
.
arrShapes
[
0
].
graphicObject
;
if
(
typeof
CGraphicFrame
!==
"
undefined
"
&&
drawing
instanceof
CGraphicFrame
)
return
false
;
}
var
arr_shapes
=
objects
.
arrShapes
;
var
arr_shapes
=
objects
.
arrShapes
;
if
(
arr_shapes
&&
arr_shapes
.
length
)
if
(
arr_shapes
&&
arr_shapes
.
length
)
{
{
var
aPastedImages
=
objects
.
arrImages
;
var
aPastedImages
=
objects
.
arrImages
;
...
@@ -1103,6 +1095,14 @@
...
@@ -1103,6 +1095,14 @@
var
activeRange
=
ws
.
activeRange
;
var
activeRange
=
ws
.
activeRange
;
var
curCol
,
drawingObject
,
curRow
,
startCol
,
startRow
,
xfrm
,
aImagesSync
=
[],
activeRow
,
activeCol
,
tempArr
,
offX
,
offY
,
rot
;
var
curCol
,
drawingObject
,
curRow
,
startCol
,
startRow
,
xfrm
,
aImagesSync
=
[],
activeRow
,
activeCol
,
tempArr
,
offX
,
offY
,
rot
;
//отдельная обработка для вставки одной таблички из презентаций
drawingObject
=
data
.
Drawings
[
0
];
if
(
data
.
Drawings
.
length
===
1
&&
typeof
AscFormat
.
CGraphicFrame
!==
"
undefined
"
&&
drawingObject
.
graphicObject
instanceof
AscFormat
.
CGraphicFrame
)
{
this
.
_insertTableFromPresentation
(
ws
,
data
.
Drawings
[
0
]);
return
;
}
History
.
Create_NewPoint
();
History
.
Create_NewPoint
();
History
.
StartTransaction
();
History
.
StartTransaction
();
...
@@ -1171,37 +1171,13 @@
...
@@ -1171,37 +1171,13 @@
}
}
}
}
}
}
};
}
for
(
var
i
=
0
;
i
<
data
.
Drawings
.
length
;
i
++
)
for
(
var
i
=
0
;
i
<
data
.
Drawings
.
length
;
i
++
)
{
{
data
.
Drawings
[
i
].
graphicObject
=
data
.
Drawings
[
i
].
graphicObject
.
copy
();
data
.
Drawings
[
i
].
graphicObject
=
data
.
Drawings
[
i
].
graphicObject
.
copy
();
drawingObject
=
data
.
Drawings
[
i
];
drawingObject
=
data
.
Drawings
[
i
];
//отдельная обработка для вставки таблички из презентаций
if
(
data
.
Drawings
.
length
===
1
&&
typeof
AscFormat
.
CGraphicFrame
!==
"
undefined
"
&&
drawingObject
.
graphicObject
instanceof
AscFormat
.
CGraphicFrame
)
{
//вставляем табличку из презентаций
var
oPasteFromBinaryWord
=
new
pasteFromBinaryWord
(
this
,
ws
);
var
newCDocument
=
new
CDocument
(
oTempDrawingDocument
,
false
);
newCDocument
.
bFromDocument
=
true
;
newCDocument
.
theme
=
this
.
Api
.
wbModel
.
theme
;
drawingObject
.
graphicObject
.
setBDeleted
(
true
);
drawingObject
.
graphicObject
.
setWordFlag
(
false
,
newCDocument
);
var
oTempDrawingDocument
=
ws
.
model
.
DrawingDocument
;
oTempDrawingDocument
.
m_oLogicDocument
=
newCDocument
;
drawingObject
.
graphicObject
.
graphicObject
.
Set_Parent
(
newCDocument
);
oPasteFromBinaryWord
.
_paste
(
ws
,
{
content
:
[
drawingObject
.
graphicObject
.
graphicObject
]});
return
;
}
if
(
drawingObject
.
graphicObject
.
fromSerialize
&&
drawingObject
.
graphicObject
.
setBFromSerialize
)
if
(
drawingObject
.
graphicObject
.
fromSerialize
&&
drawingObject
.
graphicObject
.
setBFromSerialize
)
{
{
drawingObject
.
graphicObject
.
setBFromSerialize
(
false
);
drawingObject
.
graphicObject
.
setBFromSerialize
(
false
);
...
@@ -1256,6 +1232,7 @@
...
@@ -1256,6 +1232,7 @@
ws
.
objectRender
.
controller
.
updateOverlay
();
ws
.
objectRender
.
controller
.
updateOverlay
();
ws
.
setSelectionShape
(
true
);
ws
.
setSelectionShape
(
true
);
History
.
EndTransaction
();
History
.
EndTransaction
();
if
(
aImagesSync
.
length
>
0
)
if
(
aImagesSync
.
length
>
0
)
{
{
window
[
"
Asc
"
][
"
editor
"
].
ImageLoader
.
LoadDocumentImages
(
aImagesSync
,
null
,
window
[
"
Asc
"
][
"
editor
"
].
ImageLoader
.
LoadDocumentImages
(
aImagesSync
,
null
,
...
@@ -1280,6 +1257,32 @@
...
@@ -1280,6 +1257,32 @@
},
true
);
},
true
);
},
},
_insertTableFromPresentation
:
function
(
ws
,
graphicFrame
)
{
History
.
TurnOff
();
graphicFrame
.
graphicObject
=
graphicFrame
.
graphicObject
.
copy
();
var
drawingObject
=
graphicFrame
;
//вставляем табличку из презентаций
var
oPasteFromBinaryWord
=
new
pasteFromBinaryWord
(
this
,
ws
);
var
newCDocument
=
new
CDocument
(
oTempDrawingDocument
,
false
);
newCDocument
.
bFromDocument
=
true
;
newCDocument
.
theme
=
this
.
Api
.
wbModel
.
theme
;
drawingObject
.
graphicObject
.
setBDeleted
(
true
);
drawingObject
.
graphicObject
.
setWordFlag
(
false
,
newCDocument
);
var
oTempDrawingDocument
=
ws
.
model
.
DrawingDocument
;
oTempDrawingDocument
.
m_oLogicDocument
=
newCDocument
;
drawingObject
.
graphicObject
.
graphicObject
.
Set_Parent
(
newCDocument
);
History
.
TurnOn
();
oPasteFromBinaryWord
.
_paste
(
ws
,
{
content
:
[
drawingObject
.
graphicObject
.
graphicObject
]});
},
editorPasteExec
:
function
(
worksheet
,
node
,
isText
,
onlyFromLocalStorage
)
editorPasteExec
:
function
(
worksheet
,
node
,
isText
,
onlyFromLocalStorage
)
{
{
if
(
node
==
undefined
)
if
(
node
==
undefined
)
...
@@ -1777,7 +1780,7 @@
...
@@ -1777,7 +1780,7 @@
var
extY
=
stream
.
GetULong
()
/
100000
;
var
extY
=
stream
.
GetULong
()
/
100000
;
var
base64
=
stream
.
GetString2
();
var
base64
=
stream
.
GetString2
();
if
(
count
!==
1
&&
typeof
CGraphicFrame
!==
"
undefined
"
&&
drawing
instanceof
CGraphicFrame
)
if
(
count
!==
1
&&
typeof
AscFormat
.
CGraphicFrame
!==
"
undefined
"
&&
drawing
instanceof
AscFormat
.
CGraphicFrame
)
{
{
drawing
=
AscFormat
.
DrawingObjectsController
.
prototype
.
createImage
(
base64
,
x
,
y
,
extX
,
extY
);
drawing
=
AscFormat
.
DrawingObjectsController
.
prototype
.
createImage
(
base64
,
x
,
y
,
extX
,
extY
);
}
}
...
...
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