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
0e8c3fb8
Commit
0e8c3fb8
authored
Jun 21, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for paste format table
parent
5a066c58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
17 deletions
+72
-17
cell/model/Serialize.js
cell/model/Serialize.js
+1
-1
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+71
-16
No files found.
cell/model/Serialize.js
View file @
0e8c3fb8
...
...
@@ -1177,7 +1177,7 @@
if
(
this
.
isCopyPaste
)
rangeTable
=
aTables
[
i
].
Ref
;
if
(
!
this
.
isCopyPaste
||
(
this
.
isCopyPaste
&&
rangeTable
&&
this
.
isCopyPaste
.
containsRange
(
rangeTable
)
&&
!
ws
.
bExcludeHiddenRows
))
if
(
!
this
.
isCopyPaste
||
(
this
.
isCopyPaste
&&
rangeTable
&&
this
.
isCopyPaste
.
isIntersect
(
rangeTable
)
&&
!
ws
.
bExcludeHiddenRows
))
this
.
bs
.
WriteItem
(
c_oSer_TablePart
.
Table
,
function
(){
oThis
.
WriteTable
(
aTables
[
i
]);});
}
};
...
...
cell/view/WorksheetView.js
View file @
0e8c3fb8
...
...
@@ -8885,6 +8885,8 @@
//добавляем форматированные таблицы
var
arnToRange
=
t
.
model
.
selectionRange
.
getLast
();
var
pasteRange
=
AscCommonExcel
.
g_clipboardExcel
.
pasteProcessor
.
activeRange
;
var
activeCellsPasteFragment
=
typeof
pasteRange
===
"
string
"
?
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
pasteRange
)
:
pasteRange
;
var
tablesMap
=
null
;
if
(
fromBinary
&&
val
.
TableParts
&&
val
.
TableParts
.
length
&&
specialPasteProps
.
formatTable
)
{
var
range
,
tablePartRange
,
tables
=
val
.
TableParts
,
diffRow
,
diffCol
,
curTable
,
bIsAddTable
;
...
...
@@ -8898,6 +8900,11 @@
range
=
t
.
model
.
getRange3
(
diffRow
,
diffCol
,
diffRow
+
(
tablePartRange
.
r2
-
tablePartRange
.
r1
),
diffCol
+
(
tablePartRange
.
c2
-
tablePartRange
.
c1
));
//если в активную область при записи попала лишь часть таблицы
if
(
activeCellsPasteFragment
&&
!
activeCellsPasteFragment
.
containsRange
(
tablePartRange
)){
continue
;
}
//если область вставки содержит форматированную таблицу, которая пересекается с вставляемой форматированной таблицей
var
intersectionRangeWithTableParts
=
t
.
model
.
autoFilters
.
_intersectionRangeWithTableParts
(
range
.
bbox
);
if
(
intersectionRangeWithTableParts
)
{
...
...
@@ -9542,27 +9549,56 @@
}
}
};
var
getTableDxf
=
function
(
pasteRow
,
pasteCol
,
newVal
)
var
getTableDxf
=
function
(
pasteRow
,
pasteCol
,
newVal
)
{
var
dxf
=
null
;
var
tables
=
val
.
autoFilters
.
_intersectionRangeWithTableParts
(
newVal
.
bbox
);
if
(
tables
&&
tables
[
0
])
var
blocalArea
=
true
;
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
);
var
bbox
=
{
r1
:
0
,
c1
:
0
,
r2
:
table
.
Ref
.
r2
-
table
.
Ref
.
r1
,
c2
:
table
.
Ref
.
c2
-
table
.
Ref
.
c1
};
pasteRow
=
pasteRow
-
table
.
Ref
.
r1
;
pasteCol
=
pasteCol
-
table
.
Ref
.
c1
;
//todo
//dxf = styleForCurTable.getStyle(bbox, pasteRow, pasteCol, styleInfo, headerRowCount, table.TotalsRowCount);
if
(
activeCellsPasteFragment
.
containsRange
(
table
.
Ref
))
{
blocalArea
=
false
;
}
if
(
!
styleForCurTable
)
{
return
null
;
}
var
headerRowCount
=
1
;
var
totalsRowCount
=
0
;
if
(
null
!=
table
.
HeaderRowCount
)
{
headerRowCount
=
table
.
HeaderRowCount
;
}
if
(
null
!=
table
.
TotalsRowCount
)
{
totalsRowCount
=
table
.
TotalsRowCount
;
}
var
bbox
=
new
Asc
.
Range
(
0
,
0
,
table
.
Ref
.
c2
-
table
.
Ref
.
c1
,
table
.
Ref
.
r2
-
table
.
Ref
.
r1
);
styleForCurTable
.
initStyle
(
val
.
sheetMergedStyles
,
bbox
,
styleInfo
,
headerRowCount
,
totalsRowCount
);
var
cell
=
val
.
_getCell
(
pasteRow
,
pasteCol
);
if
(
cell
)
{
dxf
=
cell
.
getCompiledStyle
();
}
if
(
null
===
dxf
)
{
pasteRow
=
pasteRow
-
table
.
Ref
.
r1
;
pasteCol
=
pasteCol
-
table
.
Ref
.
c1
;
dxf
=
AscCommonExcel
.
getCompiledStyleWs
(
val
,
pasteRow
,
pasteCol
);
}
}
return
dxf
;
return
{
dxf
:
dxf
,
blocalArea
:
blocalArea
}
;
};
var
colsWidth
=
{};
...
...
@@ -9636,8 +9672,18 @@
//hyperlink
pastedRangeProps
.
hyperlinkObj
=
newVal
.
getHyperlink
();
}
pastedRangeProps
.
tableDxf
=
getTableDxf
(
pasteRow
,
pasteCol
,
newVal
);
var
tableDxf
=
getTableDxf
(
pasteRow
,
pasteCol
,
newVal
);
if
(
tableDxf
.
blocalArea
)
{
pastedRangeProps
.
tableDxfLocal
=
tableDxf
.
dxf
;
}
else
{
pastedRangeProps
.
tableDxf
=
tableDxf
.
dxf
;
}
if
(
undefined
===
colsWidth
[
nCol
])
{
colsWidth
[
nCol
]
=
val
.
_getCol
(
pasteCol
);
...
...
@@ -10017,7 +10063,16 @@
{
range
.
setAngle
(
rangeStyle
.
angle
);
}
if
(
rangeStyle
.
tableDxfLocal
&&
specialPasteProps
.
format
)
{
var
cells
=
range
.
getCells
();
if
(
cells
&&
cells
[
0
])
{
cells
[
0
].
setStyle
(
rangeStyle
.
tableDxfLocal
);
}
}
//hyperLink
if
(
rangeStyle
.
hyperLink
&&
specialPasteProps
.
hyperlink
)
{
...
...
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