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
8d6f8196
Commit
8d6f8196
authored
Dec 02, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add getLocationRanges
add union on range
parent
f39ee7dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+11
-0
cell/utils/utils.js
cell/utils/utils.js
+27
-0
No files found.
cell/model/WorkbookElems.js
View file @
8d6f8196
...
...
@@ -5309,6 +5309,17 @@ CellArea.prototype = {
}
return
bRemove
;
};
sparklineGroup
.
prototype
.
getLocationRanges
=
function
()
{
var
result
=
new
AscCommonExcel
.
SelectionRange
();
this
.
arrSparklines
.
forEach
(
function
(
item
,
i
)
{
if
(
0
===
i
)
{
result
.
assign2
(
item
.
sqref
);
}
else
{
result
.
union
(
item
.
sqref
);
}
});
return
result
;
};
sparklineGroup
.
prototype
.
asc_getId
=
function
()
{
return
this
.
Id
;
};
...
...
cell/utils/utils.js
View file @
8d6f8196
...
...
@@ -674,6 +674,33 @@
this
.
getLast
().
assign2
(
range
);
this
.
update
();
};
SelectionRange
.
prototype
.
union
=
function
(
range
)
{
var
res
=
this
.
ranges
.
some
(
function
(
item
)
{
var
success
=
false
;
if
(
item
.
c1
===
range
.
c1
&&
item
.
c2
===
range
.
c2
)
{
if
(
range
.
r1
===
item
.
r2
+
1
)
{
item
.
r2
=
range
.
r2
;
success
=
true
;
}
else
if
(
range
.
r2
===
item
.
r1
-
1
)
{
item
.
r1
=
range
.
r1
;
success
=
true
;
}
}
else
if
(
item
.
r1
===
range
.
r1
&&
item
.
r2
===
range
.
r2
)
{
if
(
range
.
c1
===
item
.
c2
+
1
)
{
item
.
c2
=
range
.
c2
;
success
=
true
;
}
else
if
(
range
.
c2
===
item
.
c1
-
1
)
{
item
.
c1
=
range
.
c1
;
success
=
true
;
}
}
return
success
;
});
if
(
!
res
)
{
this
.
addRange
();
this
.
getLast
().
assign2
(
range
);
}
};
SelectionRange
.
prototype
.
offsetCell
=
function
(
dr
,
dc
,
fCheckSize
)
{
var
done
,
curRange
,
mc
;
var
lastRow
=
this
.
activeCell
.
row
;
...
...
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