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
8ba0c549
Commit
8ba0c549
authored
Oct 27, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete asc_ActiveRange
parent
3aa0ad5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
94 deletions
+91
-94
cell/model/autofilters.js
cell/model/autofilters.js
+82
-82
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+8
-11
common/Charts/DrawingObjects.js
common/Charts/DrawingObjects.js
+1
-1
No files found.
cell/model/autofilters.js
View file @
8ba0c549
...
...
@@ -796,59 +796,59 @@
getAddFormatTableOptions
:
function
(
activeCells
,
userRange
)
{
var
res
;
if
(
userRange
)
{
activeCells
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
userRange
);
}
//данная функция возвращает false в двух случаях - при смене стиля ф/т или при поптыке добавить ф/т к части а/ф
//TODO переделать взаимодействие с меню. если находимся внутри ф/т - вызывать сразу из меню смену стиля ф/т.
var
res
;
if
(
userRange
)
{
activeCells
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
userRange
);
}
//данная функция возвращает false в двух случаях - при смене стиля ф/т или при поптыке добавить ф/т к части а/ф
//TODO переделать взаимодействие с меню. если находимся внутри ф/т - вызывать сразу из меню смену стиля ф/т.
//для проверки возможности добавить ф/т - попробовать использовать parserHelper.checkDataRange
var
bIsInFilter
=
this
.
_searchRangeInFilters
(
activeCells
);
var
addRange
;
var
bIsInFilter
=
this
.
_searchRangeInFilters
(
activeCells
);
var
addRange
;
if
(
false
===
bIsInFilter
)
{
bIsInFilter
=
null
;
}
if
(
null
===
bIsInFilter
)
{
if
(
activeCells
.
r1
==
activeCells
.
r2
&&
activeCells
.
c1
==
activeCells
.
c2
)
//если ячейка выделенная одна
{
addRange
=
this
.
_getAdjacentCellsAF
(
activeCells
);
}
else
{
addRange
=
activeCells
;
}
}
else
//range внутри а/ф или ф/т
{
if
(
bIsInFilter
.
isAutoFilter
())
{
addRange
=
bIsInFilter
.
Ref
;
}
else
{
res
=
false
;
}
}
if
(
false
!==
res
)
{
res
=
new
AddFormatTableOptions
();
var
bIsTitle
=
this
.
_isAddNameColumn
(
addRange
);
var
range
=
addRange
.
clone
();
addRange
.
setAbs
(
true
,
true
,
true
,
true
);
res
.
asc_setIsTitle
(
bIsTitle
);
res
.
asc_setRange
(
range
.
getName
());
}
if
(
null
===
bIsInFilter
)
{
if
(
activeCells
.
r1
==
activeCells
.
r2
&&
activeCells
.
c1
==
activeCells
.
c2
)
//если ячейка выделенная одна
{
addRange
=
this
.
_getAdjacentCellsAF
(
activeCells
);
}
else
{
addRange
=
activeCells
;
}
}
else
//range внутри а/ф или ф/т
{
if
(
bIsInFilter
.
isAutoFilter
())
{
addRange
=
bIsInFilter
.
Ref
;
}
else
{
res
=
false
;
}
}
if
(
false
!==
res
)
{
res
=
new
AddFormatTableOptions
();
var
bIsTitle
=
this
.
_isAddNameColumn
(
addRange
);
var
range
=
addRange
.
clone
();
addRange
.
setAbs
(
true
,
true
,
true
,
true
);
res
.
asc_setIsTitle
(
bIsTitle
);
res
.
asc_setRange
(
range
.
getName
());
}
return
res
;
},
...
...
@@ -1206,7 +1206,7 @@
{
var
worksheet
=
this
.
worksheet
;
var
t
=
this
,
selectedTableParts
;
//if first row AF in
Active
Range - delete AF
//if first row AF in Range - delete AF
if
(
worksheet
.
AutoFilter
&&
worksheet
.
AutoFilter
.
Ref
&&
range
.
containsFirstLineRange
(
worksheet
.
AutoFilter
.
Ref
))
this
.
isEmptyAutoFilters
(
worksheet
.
AutoFilter
.
Ref
);
else
...
...
@@ -4468,39 +4468,39 @@
return
result
;
},
_searchRangeInFilters
:
function
(
range
)
//find filters in this range
{
var
result
=
null
;
var
worksheet
=
this
.
worksheet
;
if
(
worksheet
.
AutoFilter
)
{
if
(
worksheet
.
AutoFilter
.
Ref
.
containsRange
(
range
))
{
result
=
worksheet
.
AutoFilter
;
}
else
if
(
worksheet
.
AutoFilter
.
Ref
.
intersection
(
range
))
{
result
=
false
;
}
}
if
(
worksheet
.
TableParts
&&
null
===
result
)
{
for
(
var
i
=
0
;
i
<
worksheet
.
TableParts
.
length
;
i
++
)
{
if
(
worksheet
.
TableParts
[
i
])
{
if
(
worksheet
.
TableParts
[
i
].
Ref
.
containsRange
(
range
))
{
result
=
worksheet
.
TableParts
[
i
];
break
;
}
}
}
}
return
result
;
_searchRangeInFilters
:
function
(
range
)
//find filters in this range
{
var
result
=
null
;
var
worksheet
=
this
.
worksheet
;
if
(
worksheet
.
AutoFilter
)
{
if
(
worksheet
.
AutoFilter
.
Ref
.
containsRange
(
range
))
{
result
=
worksheet
.
AutoFilter
;
}
else
if
(
worksheet
.
AutoFilter
.
Ref
.
intersection
(
range
))
{
result
=
false
;
}
}
if
(
worksheet
.
TableParts
&&
null
===
result
)
{
for
(
var
i
=
0
;
i
<
worksheet
.
TableParts
.
length
;
i
++
)
{
if
(
worksheet
.
TableParts
[
i
])
{
if
(
worksheet
.
TableParts
[
i
].
Ref
.
containsRange
(
range
))
{
result
=
worksheet
.
TableParts
[
i
];
break
;
}
}
}
}
return
result
;
},
//TODO пересмотреть!
...
...
cell/view/WorksheetView.js
View file @
8ba0c549
...
...
@@ -70,7 +70,6 @@
var
asc_incDecFonSize
=
asc
.
incDecFonSize
;
var
asc_debug
=
asc
.
outputDebugStr
;
var
asc_Range
=
asc
.
Range
;
var
asc_ActiveRange
=
AscCommonExcel
.
ActiveRange
;
var
asc_CMM
=
AscCommonExcel
.
asc_CMouseMoveData
;
var
asc_VR
=
AscCommonExcel
.
VisibleRange
;
...
...
@@ -6680,7 +6679,7 @@
};
/**
* @param {
Active
Range} [range]
* @param {Range} [range]
* @returns {{deltaX: number, deltaY: number}}
*/
WorksheetView
.
prototype
.
_calcActiveCellOffset
=
function
(
range
)
{
...
...
@@ -7282,23 +7281,21 @@
};
WorksheetView
.
prototype
.
setSelectionUndoRedo
=
function
(
range
,
validRange
)
{
var
ar
=
(
range
instanceof
asc_ActiveRange
)
?
range
.
clone
()
:
new
asc_ActiveRange
(
range
);
// Проверка на валидность range.
if
(
validRange
&&
(
ar
.
c2
>=
this
.
nColsCount
||
ar
.
r2
>=
this
.
nRowsCount
))
{
if
(
ar
.
c2
>=
this
.
nColsCount
)
{
this
.
expandColsOnScroll
(
false
,
true
,
ar
.
c2
+
1
);
if
(
validRange
&&
(
range
.
c2
>=
this
.
nColsCount
||
range
.
r2
>=
this
.
nRowsCount
))
{
if
(
range
.
c2
>=
this
.
nColsCount
)
{
this
.
expandColsOnScroll
(
false
,
true
,
range
.
c2
+
1
);
}
if
(
ar
.
r2
>=
this
.
nRowsCount
)
{
this
.
expandRowsOnScroll
(
false
,
true
,
ar
.
r2
+
1
);
if
(
range
.
r2
>=
this
.
nRowsCount
)
{
this
.
expandRowsOnScroll
(
false
,
true
,
range
.
r2
+
1
);
}
}
var
oRes
=
null
;
var
type
=
ar
.
type
;
var
type
=
range
.
type
;
if
(
type
==
c_oAscSelectionType
.
RangeCells
||
type
==
c_oAscSelectionType
.
RangeCol
||
type
==
c_oAscSelectionType
.
RangeRow
||
type
==
c_oAscSelectionType
.
RangeMax
)
{
this
.
cleanSelection
();
this
.
model
.
selectionRange
.
assign2
(
ar
);
this
.
model
.
selectionRange
.
assign2
(
range
);
this
.
_drawSelection
();
this
.
_updateSelectionNameAndInfo
();
...
...
common/Charts/DrawingObjects.js
View file @
8ba0c549
...
...
@@ -1835,7 +1835,7 @@ function DrawingObjects() {
}
}
}
return
new
Asc
CommonExcel
.
Active
Range
(
cmin
,
rmin
,
cmax
,
rmax
,
true
);
return
new
Asc
.
Range
(
cmin
,
rmin
,
cmax
,
rmax
,
true
);
};
_this
.
recalculate
=
function
(
all
)
...
...
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