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
4c3aa3b4
Commit
4c3aa3b4
authored
Aug 26, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
_rangeIsSingleCell -> Range.isOneCell
parent
209e800c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
27 deletions
+17
-27
cell/utils/utils.js
cell/utils/utils.js
+1
-1
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+16
-26
No files found.
cell/utils/utils.js
View file @
4c3aa3b4
...
...
@@ -306,7 +306,7 @@
};
Range
.
prototype
.
isOneCell
=
function
()
{
return
this
.
r1
==
this
.
r2
&&
this
.
c1
==
this
.
c2
;
return
this
.
r1
==
=
this
.
r2
&&
this
.
c1
=
==
this
.
c2
;
};
Range
.
prototype
.
union
=
function
(
range
)
{
...
...
cell/view/WorksheetView.js
View file @
4c3aa3b4
...
...
@@ -821,41 +821,40 @@
// Проверяет, есть ли числовые значения в диапазоне
WorksheetView
.
prototype
.
_hasNumberValueInActiveRange
=
function
()
{
var
cell
,
cellType
,
isNumberFormat
,
arrCols
=
null
,
arrRows
=
null
;
if
(
this
.
_rangeIsSingleCell
(
this
.
activeRange
)
)
{
if
(
this
.
activeRange
.
isOneCell
()
)
{
// Для одной ячейки не стоит ничего делать
return
null
;
}
var
mergedRange
=
this
.
model
.
getMergedByCell
(
this
.
activeRange
.
r1
,
this
.
activeRange
.
c1
);
if
(
mergedRange
&&
mergedRange
.
isEqual
(
this
.
activeRange
)
)
{
var
mergedRange
=
this
.
model
.
getMergedByCell
(
this
.
activeRange
.
r1
,
this
.
activeRange
.
c1
);
if
(
mergedRange
&&
mergedRange
.
isEqual
(
this
.
activeRange
)
)
{
// Для одной ячейки не стоит ничего делать
return
null
;
}
for
(
var
c
=
this
.
activeRange
.
c1
;
c
<=
this
.
activeRange
.
c2
;
++
c
)
{
for
(
var
r
=
this
.
activeRange
.
r1
;
r
<=
this
.
activeRange
.
r2
;
++
r
)
{
cell
=
this
.
_getCellTextCache
(
c
,
r
);
if
(
cell
)
{
for
(
var
c
=
this
.
activeRange
.
c1
;
c
<=
this
.
activeRange
.
c2
;
++
c
)
{
for
(
var
r
=
this
.
activeRange
.
r1
;
r
<=
this
.
activeRange
.
r2
;
++
r
)
{
cell
=
this
.
_getCellTextCache
(
c
,
r
);
if
(
cell
)
{
// Нашли не пустую ячейку, проверим формат
cellType
=
cell
.
cellType
;
isNumberFormat
=
(
null
==
cellType
||
CellValueType
.
Number
===
cellType
);
if
(
isNumberFormat
)
{
if
(
!
arrCols
)
{
if
(
isNumberFormat
)
{
if
(
!
arrCols
)
{
arrCols
=
[];
arrRows
=
[];
}
arrCols
.
push
(
c
);
arrRows
.
push
(
r
);
arrCols
.
push
(
c
);
arrRows
.
push
(
r
);
}
}
}
}
if
(
arrCols
)
{
if
(
arrCols
)
{
// Делаем массивы уникальными и сортируем
arrCols
=
arrCols
.
filter
(
AscCommon
.
fOnlyUnique
);
arrRows
=
arrRows
.
filter
(
AscCommon
.
fOnlyUnique
);
return
{
arrCols
:
arrCols
.
sort
(
fSortAscending
),
arrRows
:
arrRows
.
sort
(
fSortAscending
)};
}
else
{
arrCols
=
arrCols
.
filter
(
AscCommon
.
fOnlyUnique
);
arrRows
=
arrRows
.
filter
(
AscCommon
.
fOnlyUnique
);
return
{
arrCols
:
arrCols
.
sort
(
fSortAscending
),
arrRows
:
arrRows
.
sort
(
fSortAscending
)};
}
else
{
return
null
;
}
};
...
...
@@ -5227,15 +5226,6 @@
return
range
.
c2
-
range
.
c1
+
1
>
(
vr
.
c2
-
vr
.
c1
+
1
)
*
3
||
range
.
r2
-
range
.
r1
+
1
>
(
vr
.
r2
-
vr
.
r1
+
1
)
*
3
;
};
/**
* Возвращает true, если диапазон состоит из одной ячейки
* @param {Asc.Range} range Диапазон
* @returns {Boolean}
*/
WorksheetView
.
prototype
.
_rangeIsSingleCell
=
function
(
range
)
{
return
range
.
c1
===
range
.
c2
&&
range
.
r1
===
range
.
r2
;
};
WorksheetView
.
prototype
.
drawDepCells
=
function
()
{
var
ctx
=
this
.
overlayCtx
,
_cc
=
this
.
cellCommentator
,
c
,
node
,
that
=
this
;
...
...
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