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
13d18478
Commit
13d18478
authored
Feb 17, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change position special paste button(shape)
parent
ffbf1f28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
20 deletions
+53
-20
cell/model/clipboard.js
cell/model/clipboard.js
+11
-14
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+42
-6
No files found.
cell/model/clipboard.js
View file @
13d18478
...
...
@@ -1389,30 +1389,27 @@
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
cellsLeft
=
worksheet
.
cellsLeft
*
ptToPx
;
var
cellsTop
=
worksheet
.
cellsTop
*
ptToPx
;
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
cursorPos
=
target_doc_content
.
Cursor_GetPos
();
var
offsetX
=
worksheet
.
cols
[
worksheet
.
visibleRange
.
c1
].
left
*
ptToPx
-
cellsLeft
;
var
offsetY
=
worksheet
.
rows
[
worksheet
.
visibleRange
.
r1
].
top
*
ptToPx
-
cellsTop
;
var
posX
=
curShape
.
transformText
.
TransformPointX
(
cursorPos
.
X
,
cursorPos
.
Y
)
*
mmToPx
-
offsetX
+
cellsLeft
;
var
posY
=
curShape
.
transformText
.
TransformPointY
(
cursorPos
.
X
,
cursorPos
.
Y
)
*
mmToPx
-
offsetY
+
cellsTop
;
var
position
=
{
x
:
posX
,
y
:
posY
};
var
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
worksheet
.
showSpecialPasteOptions
(
allowedSpecialPasteProps
,
null
,
position
);
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
specialPasteRange
=
cursorPos
;
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
specialPasteShapeId
=
isIntoShape
.
Id
;
}
},
...
...
cell/view/WorksheetView.js
View file @
13d18478
...
...
@@ -8815,7 +8815,8 @@
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
start_paste
();
//откатываемся до того, что было до вставки
if
(
preSpecialPasteData
&&
preSpecialPasteData
.
data
)
var
isIntoShape
=
this
.
objectRender
.
controller
.
getTargetDocContent
(
true
);
if
(
!
isIntoShape
&&
preSpecialPasteData
&&
preSpecialPasteData
.
data
)
{
var
tempProps
=
new
Asc
.
SpecialPasteProps
();
api
.
wb
.
clipboard
.
specialPasteProps
=
tempProps
;
...
...
@@ -8828,13 +8829,12 @@
undoPreviousPaste
();
}
else
if
(
preSpecialPasteData
&&
preSpecialPasteData
.
shapeSelectionState
)
else
if
(
isIntoShape
&&
preSpecialPasteData
&&
preSpecialPasteData
.
shapeSelectionState
)
{
//таким образом удаляю вставляенный фрагмент до специальной вставки
var
docContent
=
this
.
objectRender
.
controller
.
getTargetDocContent
(
true
);
var
State
=
preSpecialPasteData
.
shapeSelectionState
;
docContent
.
Set_SelectionState
(
State
,
State
.
length
-
1
);
docContent
.
Remove
(
1
,
true
,
true
);
isIntoShape
.
Set_SelectionState
(
State
,
State
.
length
-
1
);
isIntoShape
.
Remove
(
1
,
true
,
true
);
}
//далее специальная вставка
...
...
@@ -9847,7 +9847,43 @@
WorksheetView
.
prototype
.
updateSpecialPasteOptionsPosition
=
function
()
{
var
_clipboard
=
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
;
if
(
_clipboard
.
showSpecialPasteButton
&&
_clipboard
.
specialPasteRange
)
var
isIntoShape
=
this
.
objectRender
.
controller
.
getTargetDocContent
(
true
);
if
(
_clipboard
.
showSpecialPasteButton
&&
isIntoShape
)
{
if
(
_clipboard
.
specialPasteShapeId
===
isIntoShape
.
Id
&&
_clipboard
.
specialPasteRange
)
{
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
var
range
=
_clipboard
.
specialPasteRange
;
/*var trueShapeSelection = isIntoShape.Get_SelectionState();
isIntoShape.Set_SelectionState(range, range.length - 1);*/
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
curShape
=
isIntoShape
.
Parent
.
parent
;
var
asc_getcvt
=
Asc
.
getCvtRatio
;
var
mmToPx
=
asc_getcvt
(
3
/*px*/
,
0
/*pt*/
,
this
.
_getPPIX
());
var
ptToPx
=
asc_getcvt
(
1
/*px*/
,
0
/*pt*/
,
this
.
_getPPIX
());
var
cellsLeft
=
this
.
cellsLeft
*
ptToPx
;
var
cellsTop
=
this
.
cellsTop
*
ptToPx
;
var
cursorPos
=
range
//isIntoShape.Cursor_GetPos();
var
offsetX
=
this
.
cols
[
this
.
visibleRange
.
c1
].
left
*
ptToPx
-
cellsLeft
;
var
offsetY
=
this
.
rows
[
this
.
visibleRange
.
r1
].
top
*
ptToPx
-
cellsTop
;
var
posX
=
curShape
.
transformText
.
TransformPointX
(
cursorPos
.
X
,
cursorPos
.
Y
)
*
mmToPx
-
offsetX
+
cellsLeft
;
var
posY
=
curShape
.
transformText
.
TransformPointY
(
cursorPos
.
X
,
cursorPos
.
Y
)
*
mmToPx
-
offsetY
+
cellsTop
;
cellCoord
=
new
AscCommon
.
asc_CRect
(
posX
,
posY
,
0
,
0
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
//isIntoShape.Set_SelectionState(trueShapeSelection, trueShapeSelection.length - 1);
}
}
else
if
(
_clipboard
.
showSpecialPasteButton
&&
_clipboard
.
specialPasteRange
)
{
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
var
range
=
_clipboard
.
specialPasteRange
;
...
...
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