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
c0a82df2
Commit
c0a82df2
authored
Feb 01, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add asc_SpecialPaste function into api
+ add c_oSpecialPasteProps into apiDefines
parent
f599a97a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
28 deletions
+83
-28
cell/api.js
cell/api.js
+10
-0
cell/apiDefines.js
cell/apiDefines.js
+30
-1
cell/model/clipboard.js
cell/model/clipboard.js
+15
-13
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+6
-0
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+10
-14
common/clipboard_base.js
common/clipboard_base.js
+12
-0
No files found.
cell/api.js
View file @
c0a82df2
...
...
@@ -368,6 +368,16 @@ var editor;
}
return
false
;
};
spreadsheet_api
.
prototype
.
asc_SpecialPaste
=
function
(
props
)
{
return
AscCommon
.
g_clipboardBase
.
Special_Paste
(
props
);
};
spreadsheet_api
.
prototype
.
asc_SpecialPasteData
=
function
(
preSpecialPasteData
,
specialPasteData
,
props
)
{
if
(
!
this
.
getViewMode
())
{
this
.
wb
.
specialPasteData
(
preSpecialPasteData
,
specialPasteData
,
props
);
}
};
spreadsheet_api
.
prototype
.
asc_Cut
=
function
()
{
if
(
window
[
"
AscDesktopEditor
"
])
...
...
cell/apiDefines.js
View file @
c0a82df2
...
...
@@ -365,7 +365,22 @@ var c_oAscPopUpSelectorType = {
Group
:
1
,
Custom
:
2
};
var
c_oSpecialPasteProps
=
{
formulas
:
0
,
formulasNumberFormating
:
1
,
keepSourceFormating
:
2
,
noBorders
:
3
,
keepSourceColumnWidths
:
4
,
transpose
:
5
,
values
:
6
,
valuesNumberFormating
:
7
,
formating
:
8
,
pasteLink
:
9
,
picture
:
10
,
linkedPicture
:
11
};
var
c_kMaxPrintPages
=
1500
;
//----------------------------------------------------------export----------------------------------------------------
...
...
@@ -556,4 +571,18 @@ var c_oAscPopUpSelectorType = {
prot
[
'
Individual
'
]
=
prot
.
Individual
;
prot
[
'
Group
'
]
=
prot
.
Group
;
prot
[
'
Custom
'
]
=
prot
.
Custom
;
window
[
'
Asc
'
][
'
c_oSpecialPasteProps
'
]
=
window
[
'
Asc
'
].
c_oSpecialPasteProps
=
c_oSpecialPasteProps
;
prot
=
c_oSpecialPasteProps
;
prot
[
'
formulas
'
]
=
prot
.
formulas
;
prot
[
'
formulasNumberFormating
'
]
=
prot
.
formulasNumberFormating
;
prot
[
'
keepSourceFormating
'
]
=
prot
.
keepSourceFormating
;
prot
[
'
noBorders
'
]
=
prot
.
noBorders
;
prot
[
'
keepSourceColumnWidths
'
]
=
prot
.
keepSourceColumnWidths
;
prot
[
'
transpose
'
]
=
prot
.
transpose
;
prot
[
'
values
'
]
=
prot
.
values
;
prot
[
'
valuesNumberFormating
'
]
=
prot
.
valuesNumberFormating
;
prot
[
'
formating
'
]
=
prot
.
formating
;
prot
[
'
pasteLink
'
]
=
prot
.
pasteLink
;
prot
[
'
picture
'
]
=
prot
.
picture
;
prot
[
'
linkedPicture
'
]
=
prot
.
linkedPicture
;
})(
window
);
cell/model/clipboard.js
View file @
c0a82df2
...
...
@@ -49,6 +49,8 @@
var
copyPasteUseBinary
=
true
;
var
CopyPasteCorrectString
=
AscCommon
.
CopyPasteCorrectString
;
var
c_oSpecialPasteProps
=
Asc
.
c_oSpecialPasteProps
function
number2color
(
n
)
{
if
(
typeof
(
n
)
==
"
string
"
&&
n
.
indexOf
(
"
rgb
"
)
>-
1
)
...
...
@@ -119,7 +121,7 @@
{
switch
(
props
)
{
case
"
formulas
"
:
case
c_oSpecialPasteProps
.
formulas
:
{
//только формулы(или значения)
this
.
revert
();
...
...
@@ -128,7 +130,7 @@
break
;
}
case
"
formulasNumberFormating
"
:
case
c_oSpecialPasteProps
.
formulasNumberFormating
:
{
//только формулы(или значения) и числовой формат
this
.
revert
();
...
...
@@ -138,62 +140,62 @@
break
;
}
case
"
keepSourceFormating
"
:
case
c_oSpecialPasteProps
.
keepSourceFormating
:
{
//формулы и формат
break
;
}
case
"
noBorders
"
:
case
c_oSpecialPasteProps
.
noBorders
:
{
//всё кроме бордеров
this
.
borders
=
null
;
break
;
}
case
"
keepSourceColumnWidths
"
:
case
c_oSpecialPasteProps
.
keepSourceColumnWidths
:
{
break
;
}
case
"
transpose
"
:
case
c_oSpecialPasteProps
.
transpose
:
{
break
;
}
case
"
values
"
:
case
c_oSpecialPasteProps
.
values
:
{
//только значения(вместо формул также вставляются значения)
this
.
revert
();
this
.
val
=
true
;
}
case
"
valuesNumberFormating
"
:
case
c_oSpecialPasteProps
.
valuesNumberFormating
:
{
this
.
revert
();
this
.
val
=
true
;
this
.
numFormat
=
true
;
break
;
}
case
"
valuesSourceFormating
"
:
case
c_oSpecialPasteProps
.
valuesSourceFormating
:
{
//все кроме формул
this
.
formula
=
null
;
break
;
}
case
"
formating
"
:
case
c_oSpecialPasteProps
.
formating
:
{
this
.
formula
=
null
;
break
;
}
case
"
pasteLink
"
:
case
c_oSpecialPasteProps
.
pasteLink
:
{
this
.
revert
();
break
;
}
case
"
picture
"
:
case
c_oSpecialPasteProps
.
picture
:
{
break
;
}
case
"
linkedPicture
"
:
case
c_oSpecialPasteProps
.
linkedPicture
:
{
break
;
}
...
...
cell/view/WorkbookView.js
View file @
c0a82df2
...
...
@@ -2054,6 +2054,12 @@
ws
=
t
.
getWorksheet
();
t
.
clipboard
.
pasteData
(
ws
,
_format
,
data1
,
data2
,
text_data
);
};
WorkbookView
.
prototype
.
specialPasteData
=
function
(
preSpecialPasteData
,
specialPasteData
,
props
)
{
if
(
!
this
.
getCellEditMode
())
{
this
.
getWorksheet
().
specialPaste
(
preSpecialPasteData
,
specialPasteData
,
props
);
}
};
WorkbookView
.
prototype
.
selectionCut
=
function
()
{
if
(
this
.
getCellEditMode
())
{
...
...
cell/view/WorksheetView.js
View file @
c0a82df2
...
...
@@ -8759,27 +8759,27 @@
}
};
WorksheetView
.
prototype
.
specialPaste
=
function
(
props
)
{
WorksheetView
.
prototype
.
specialPaste
=
function
(
pr
eSpecialPasteData
,
specialPasteData
,
pr
ops
)
{
var
api
=
window
[
"
Asc
"
][
"
editor
"
];
var
g_clipboardBase
=
window
[
'
AscCommon
'
].
g_clipboardBase
;
//откатываемся до того, что было до вставки
if
(
g_clipboardBase
.
specialPasteUndo
Data
.
data
)
if
(
preSpecialPasteData
&&
preSpecialPaste
Data
.
data
)
{
var
tempProps
=
new
AscCommonExcel
.
SpecialPasteProps
();
api
.
wb
.
clipboard
.
specialPasteProps
=
tempProps
;
//меняем activeRange
if
(
g_clipboardBase
.
specialPasteData
&&
g_clipboardBase
.
specialPasteData
.
activeRange
)
if
(
specialPasteData
&&
specialPasteData
.
activeRange
)
{
this
.
model
.
selectionRange
=
g_clipboardBase
.
specialPasteData
.
activeRange
.
clone
(
this
.
model
);
this
.
model
.
selectionRange
=
specialPasteData
.
activeRange
.
clone
(
this
.
model
);
}
//откатываем данные в ячейках
api
.
wb
.
clipboard
.
pasteProcessor
.
pasteFromBinary
(
this
,
g_clipboardBase
.
specialPasteUndo
Data
.
data
);
api
.
wb
.
clipboard
.
pasteProcessor
.
pasteFromBinary
(
this
,
preSpecialPaste
Data
.
data
);
//удаляем вставленные изображения
if
(
g_clipboardBase
.
specialPasteUndo
Data
.
images
)
if
(
preSpecialPaste
Data
.
images
)
{
var
images
=
g_clipboardBase
.
specialPasteUndo
Data
.
images
;
var
images
=
preSpecialPaste
Data
.
images
;
for
(
var
i
=
0
;
i
<
images
.
length
;
i
++
)
{
var
id
=
images
[
i
];
...
...
@@ -8791,13 +8791,9 @@
}
//далее специальная вставка
if
(
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
)
if
(
specialPasteData
)
{
var
tempProps
=
new
AscCommonExcel
.
SpecialPasteProps
();
tempProps
.
setProps
(
props
);
api
.
wb
.
clipboard
.
specialPasteProps
=
tempProps
;
var
specialPasteData
=
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
;
api
.
wb
.
clipboard
.
specialPasteProps
=
props
;
api
.
wb
.
clipboard
.
pasteData
(
this
,
specialPasteData
.
_format
,
specialPasteData
.
data1
,
specialPasteData
.
data2
,
specialPasteData
.
text_data
,
true
);
}
};
...
...
common/clipboard_base.js
View file @
c0a82df2
...
...
@@ -925,6 +925,18 @@
this
.
Api
.
asc_PasteData
(
this
.
LastCopyBinary
[
0
].
type
,
this
.
LastCopyBinary
[
0
].
data
);
}
return
_ret
;
},
Special_Paste
:
function
(
props
)
{
this
.
Api
.
asc_SpecialPasteData
(
this
.
specialPasteUndoData
,
this
.
specialPasteData
,
props
);
return
true
;
},
Clean_SpecialPasteObj
:
function
()
{
this
.
specialPasteData
=
{};
this
.
specialPasteUndoData
=
{};
}
};
...
...
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