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
56d244c3
Commit
56d244c3
authored
Feb 03, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add class SpecialPasteShowOptions(for send information into menu about special paste options)
parent
176d0b3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
cell/model/clipboard.js
cell/model/clipboard.js
+23
-1
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+7
-2
No files found.
cell/model/clipboard.js
View file @
56d244c3
...
...
@@ -43,6 +43,7 @@
* Import
* -----------------------------------------------------------------------------
*/
var
prot
;
var
c_oAscBorderStyles
=
AscCommon
.
c_oAscBorderStyles
;
var
c_oAscMaxCellOrCommentLength
=
Asc
.
c_oAscMaxCellOrCommentLength
;
var
doc
=
window
.
document
;
...
...
@@ -58,6 +59,22 @@
return
"
rgb(
"
+
(
n
>>
16
&
0xFF
)
+
"
,
"
+
(
n
>>
8
&
0xFF
)
+
"
,
"
+
(
n
&
0xFF
)
+
"
)
"
;
}
function
SpecialPasteShowOptions
()
{
this
.
options
=
[];
this
.
cellCoord
=
null
;
}
SpecialPasteShowOptions
.
prototype
=
{
constructor
:
SpecialPasteShowOptions
,
asc_setCellCoord
:
function
(
val
)
{
this
.
cellCoord
=
val
;
},
asc_setOptions
:
function
(
val
)
{
this
.
options
=
val
;
},
asc_getCellCoord
:
function
()
{
return
this
.
cellCoord
;
},
asc_getOptions
:
function
(
val
)
{
return
this
.
options
;
}
};
function
SpecialPasteProps
()
{
this
.
cellStyle
=
true
;
...
...
@@ -174,7 +191,7 @@
this
.
numFormat
=
true
;
break
;
}
case
c_oSpecialPasteProps
.
values
SourceFormating
:
case
c_oSpecialPasteProps
.
keep
SourceFormating
:
{
//все кроме формул
this
.
formula
=
null
;
...
...
@@ -4224,5 +4241,10 @@
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
window
[
"
AscCommonExcel
"
].
Clipboard
=
Clipboard
;
window
[
"
AscCommonExcel
"
].
SpecialPasteProps
=
SpecialPasteProps
;
window
[
"
Asc
"
][
"
SpecialPasteShowOptions
"
]
=
window
[
"
Asc
"
].
SpecialPasteShowOptions
=
SpecialPasteShowOptions
;
prot
=
SpecialPasteShowOptions
.
prototype
;
prot
[
"
asc_getCellCoord
"
]
=
prot
.
asc_getCellCoord
;
prot
[
"
asc_getOptions
"
]
=
prot
.
asc_getOptions
;
}
)(
jQuery
,
window
);
cell/view/WorksheetView.js
View file @
56d244c3
...
...
@@ -8938,18 +8938,23 @@
History
.
SetSelectionRedo
(
oSelection
);
}
//for special paste
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
var
allowedSpecialPasteProps
;
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
if
(
fromBinary
)
{
allowedSpecialPasteProps
=
[
sProps
.
formulas
,
sProps
.
formulasNumberFormating
,
sProps
.
keepSourceFormating
,
sProps
.
noBorders
,
sProps
.
keepSourceColumnWidths
,
sProps
.
transpose
,
sProps
.
values
,
sProps
.
valuesNumberFormating
,
sProps
.
values
SourceFormating
,
sProps
.
formating
,
sProps
.
pasteLink
,
sProps
.
picture
,
sProps
.
linkedPicture
];
allowedSpecialPasteProps
=
[
sProps
.
formulas
,
sProps
.
formulasNumberFormating
,
sProps
.
keepSourceFormating
,
sProps
.
noBorders
,
sProps
.
keepSourceColumnWidths
,
sProps
.
transpose
,
sProps
.
values
,
sProps
.
valuesNumberFormating
,
sProps
.
keep
SourceFormating
,
sProps
.
formating
,
sProps
.
pasteLink
,
sProps
.
picture
,
sProps
.
linkedPicture
];
}
else
{
//matchDestinationFormatting - пока не добавляю, так как работает как и values
allowedSpecialPasteProps
=
[
sProps
.
keepSourceFormating
,
sProps
.
values
];
}
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
allowedSpecialPasteProps
);
specialPasteShowOptions
.
asc_setOptions
(
allowedSpecialPasteProps
);
var
cellCoord
=
this
.
getCellCoord
(
selectData
[
0
].
c2
,
selectData
[
0
].
r2
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
};
WorksheetView
.
prototype
.
_loadDataBeforePaste
=
function
(
isLargeRange
,
fromBinary
,
pasteContent
,
bIsUpdate
,
canChangeColWidth
)
{
...
...
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