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
c511a408
Commit
c511a408
authored
Feb 21, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
special paste format tables
parent
93ca1b55
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+32
-1
No files found.
cell/view/WorksheetView.js
View file @
c511a408
...
...
@@ -9506,6 +9506,24 @@
}
};
var
getTableDxf
=
function
(
pasteRow
,
pasteCol
,
newVal
)
{
var
dxf
=
null
;
var
tables
=
val
.
autoFilters
.
_intersectionRangeWithTableParts
(
newVal
.
bbox
);
if
(
tables
&&
tables
[
0
])
{
var
table
=
tables
[
0
];
var
styleInfo
=
table
.
TableStyleInfo
;
var
styleForCurTable
=
t
.
model
.
workbook
.
TableStyles
.
AllStyles
[
styleInfo
.
Name
];
var
headerRowCount
=
!!
(
null
===
table
.
HeaderRowCount
||
table
.
HeaderRowCount
>
0
);
dxf
=
styleForCurTable
.
getStyle
(
table
.
Ref
,
pasteRow
,
pasteCol
,
styleInfo
,
headerRowCount
,
table
.
HeaderRowCount
);
}
return
dxf
;
};
var
putInsertedCellIntoRange
=
function
(
nRow
,
nCol
,
pasteRow
,
pasteCol
,
rowDiff
,
colDiff
,
range
,
newVal
)
{
var
pastedRangeProps
=
{};
...
...
@@ -9565,6 +9583,8 @@
pastedRangeProps
.
hyperlinkObj
=
newVal
.
getHyperlink
();
}
pastedRangeProps
.
tableDxf
=
getTableDxf
(
pasteRow
,
pasteCol
,
newVal
);
//apply props by cell
var
formulaProps
=
{
firstRange
:
firstRange
,
arrFormula
:
arrFormula
,
tablesMap
:
tablesMap
,
newVal
:
newVal
,
isOneMerge
:
isOneMerge
,
val
:
val
};
t
.
_setPastedDataByCurrentRange
(
range
,
pastedRangeProps
,
formulaProps
,
specialPasteProps
);
...
...
@@ -9733,6 +9753,17 @@
{
range
.
setCellStyle
(
rangeStyle
.
cellStyle
);
}
//если не вставляем форматированную таблицу, но формат необходимо вставить
if
(
specialPasteProps
.
format
&&
!
specialPasteProps
.
formatTable
&&
rangeStyle
.
tableDxf
)
{
var
cells
=
range
.
getCells
();
if
(
cells
&&
cells
[
0
])
{
cells
[
0
].
setStyle
(
rangeStyle
.
tableDxf
);
}
}
//numFormat
if
(
rangeStyle
.
numFormat
&&
specialPasteProps
.
numFormat
)
{
...
...
@@ -9801,7 +9832,7 @@
range
.
setWrap
(
rangeStyle
.
wrap
);
}
//fill
if
(
specialPasteProps
.
fill
)
if
(
specialPasteProps
.
fill
&&
rangeStyle
.
fill
)
{
range
.
setFill
(
rangeStyle
.
fill
);
}
...
...
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