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
b30d3bb1
Commit
b30d3bb1
authored
Feb 15, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for special paste into shape content
parent
025ce72a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
6 deletions
+54
-6
cell/model/clipboard.js
cell/model/clipboard.js
+38
-0
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+16
-6
No files found.
cell/model/clipboard.js
View file @
b30d3bb1
...
@@ -1373,6 +1373,36 @@
...
@@ -1373,6 +1373,36 @@
this
.
_insertSelectedContentIntoShapeContent
(
worksheet
,
insertContent
,
target_doc_content
);
this
.
_insertSelectedContentIntoShapeContent
(
worksheet
,
insertContent
,
target_doc_content
);
History
.
EndTransaction
();
History
.
EndTransaction
();
//for special paste
if
(
!
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
specialPasteStart
)
{
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
curParPos
=
isIntoShape
.
Content
[
isIntoShape
.
CurPos
.
ContentPos
].
CurPos
;
var
curShape
=
isIntoShape
.
Parent
.
parent
;
var
asc_getcvt
=
Asc
.
getCvtRatio
;
var
mmToPx
=
asc_getcvt
(
3
/*px*/
,
0
/*pt*/
,
worksheet
.
_getPPIX
());
var
ptToPx
=
asc_getcvt
(
1
/*px*/
,
0
/*pt*/
,
worksheet
.
_getPPIX
());
var
cellsLeftPx
=
worksheet
.
cellsLeft
*
ptToPx
;
var
cellsTopPx
=
worksheet
.
cellsTop
*
ptToPx
;
var
offsetXPx
=
worksheet
.
cols
[
worksheet
.
visibleRange
.
c1
].
left
*
ptToPx
-
cellsLeftPx
;
var
offsetYPx
=
worksheet
.
rows
[
worksheet
.
visibleRange
.
r1
].
top
*
ptToPx
-
cellsTopPx
;
var
x_curParPosPx
=
curParPos
.
X
*
mmToPx
;
var
x_curShapePosPx
=
curShape
.
x
*
mmToPx
+
cellsLeftPx
;
var
xPos
=
x_curParPosPx
+
x_curShapePosPx
-
offsetXPx
;
var
y_curParPosPx
=
curParPos
.
Y
*
mmToPx
;
var
y_curShapePosPx
=
curShape
.
y
*
mmToPx
+
cellsTopPx
;
var
yPos
=
y_curParPosPx
+
y_curShapePosPx
-
offsetYPx
;
var
position
=
{
x
:
xPos
,
y
:
yPos
};
var
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
worksheet
.
showSpecialPasteOptions
(
allowedSpecialPasteProps
,
null
,
position
);
}
},
},
_convertBeforeInsertIntoShapeContent
:
function
(
worksheet
,
content
,
isConvertToPPTX
,
target_doc_content
)
_convertBeforeInsertIntoShapeContent
:
function
(
worksheet
,
content
,
isConvertToPPTX
,
target_doc_content
)
...
@@ -2548,6 +2578,14 @@
...
@@ -2548,6 +2578,14 @@
}
}
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
end_paste
();
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
end_paste
();
//for special paste
if
(
!
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
specialPasteStart
)
{
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
//worksheet.showSpecialPasteOptions(allowedSpecialPasteProps);
}
};
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
...
...
cell/view/WorksheetView.js
View file @
b30d3bb1
...
@@ -9807,19 +9807,29 @@
...
@@ -9807,19 +9807,29 @@
}
}
};
};
WorksheetView
.
prototype
.
showSpecialPasteOptions
=
function
(
props
,
range
)
WorksheetView
.
prototype
.
showSpecialPasteOptions
=
function
(
props
,
range
,
positionShapeContent
)
{
{
var
_clipboard
=
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
;
var
_clipboard
=
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
;
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
_clipboard
.
specialPasteRange
=
range
;
_clipboard
.
specialPasteRange
=
range
;
var
isVisible
=
null
!==
this
.
getCellVisibleRange
(
range
.
c2
,
range
.
r2
);
var
cellCoord
;
var
cellCoord
=
this
.
getCellCoord
(
range
.
c2
,
range
.
r2
);
if
(
!
positionShapeContent
)
if
(
!
isVisible
)
{
{
cellCoord
.
_x
=
-
1
;
var
isVisible
=
null
!==
this
.
getCellVisibleRange
(
range
.
c2
,
range
.
r2
);
cellCoord
.
_y
=
-
1
;
cellCoord
=
this
.
getCellCoord
(
range
.
c2
,
range
.
r2
);
if
(
!
isVisible
)
{
cellCoord
.
_x
=
-
1
;
cellCoord
.
_y
=
-
1
;
}
}
}
else
{
//var isVisible = null !== this.getCellVisibleRange(range.c2, range.r2);
cellCoord
=
new
AscCommon
.
asc_CRect
(
positionShapeContent
.
x
,
positionShapeContent
.
y
,
0
,
0
);
}
specialPasteShowOptions
.
asc_setOptions
(
props
);
specialPasteShowOptions
.
asc_setOptions
(
props
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
...
...
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