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
e9fd2a15
Commit
e9fd2a15
authored
Feb 15, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add half selection
parent
6988f6fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
230 additions
and
231 deletions
+230
-231
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+2
-0
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+228
-231
No files found.
cell/view/WorkbookView.js
View file @
e9fd2a15
...
@@ -120,6 +120,8 @@
...
@@ -120,6 +120,8 @@
ctx
.
fillRect
(
1
,
1
,
1
,
1
);
ctx
.
fillRect
(
1
,
1
,
1
,
1
);
this
.
ptrnLineDotted1
=
ctx
.
createPattern
(
cnv
,
"
repeat
"
);
this
.
ptrnLineDotted1
=
ctx
.
createPattern
(
cnv
,
"
repeat
"
);
this
.
halfSelection
=
false
;
return
this
;
return
this
;
}
}
...
...
cell/view/WorksheetView.js
View file @
e9fd2a15
...
@@ -5804,133 +5804,139 @@
...
@@ -5804,133 +5804,139 @@
return
result
;
return
result
;
};
};
// dX = true - считать с половиной следующей ячейки
/**
WorksheetView
.
prototype
.
_findColUnderCursor
=
function
(
x
,
canReturnNull
,
dX
)
{
*
var
c
=
this
.
visibleRange
.
c1
,
offset
=
this
.
cols
[
c
].
left
-
this
.
cellsLeft
,
c2
,
x1
,
x2
,
cFrozen
,
widthDiff
=
0
;
* @param x
if
(
x
>=
this
.
cellsLeft
)
{
* @param canReturnNull
if
(
this
.
topLeftFrozenCell
)
{
* @param half - считать с половиной следующей ячейки
cFrozen
=
this
.
topLeftFrozenCell
.
getCol0
();
* @returns {*}
widthDiff
=
this
.
cols
[
cFrozen
].
left
-
this
.
cols
[
0
].
left
;
* @private
if
(
x
<
this
.
cellsLeft
+
widthDiff
&&
0
!==
widthDiff
)
{
*/
c
=
0
;
WorksheetView
.
prototype
.
_findColUnderCursor
=
function
(
x
,
canReturnNull
,
half
)
{
widthDiff
=
0
;
var
activeCellCol
=
this
.
_getSelection
().
activeCell
.
col
;
}
var
dx
=
0
;
}
var
c
=
this
.
visibleRange
.
c1
;
for
(
x1
=
this
.
cellsLeft
+
widthDiff
,
c2
=
this
.
cols
.
length
-
1
;
c
<=
c2
;
++
c
,
x1
=
x2
)
{
var
offset
=
this
.
cols
[
c
].
left
-
this
.
cellsLeft
;
x2
=
x1
+
this
.
cols
[
c
].
width
;
var
c2
,
x1
,
x2
,
cFrozen
,
widthDiff
=
0
;
if
(
x1
<=
x
&&
x
<
x2
)
{
if
(
x
>=
this
.
cellsLeft
)
{
if
(
dX
)
{
if
(
this
.
topLeftFrozenCell
)
{
// Учитываем половину ячейки
cFrozen
=
this
.
topLeftFrozenCell
.
getCol0
();
if
(
x1
<=
x
&&
x
<
x1
+
this
.
cols
[
c
].
width
/
2.0
)
{
widthDiff
=
this
.
cols
[
cFrozen
].
left
-
this
.
cols
[
0
].
left
;
// Это предыдущая ячейка
if
(
x
<
this
.
cellsLeft
+
widthDiff
&&
0
!==
widthDiff
)
{
--
c
;
c
=
0
;
// Можем вернуть и -1 (но это только для fillHandle)
widthDiff
=
0
;
}
}
}
}
return
{
col
:
c
,
left
:
x1
,
right
:
x2
};
for
(
x1
=
this
.
cellsLeft
+
widthDiff
,
c2
=
this
.
cols
.
length
-
1
;
c
<=
c2
;
++
c
,
x1
=
x2
)
{
}
x2
=
x1
+
this
.
cols
[
c
].
width
;
}
dx
=
half
?
this
.
cols
[
c
].
width
/
2.0
*
Math
.
sign
(
c
-
activeCellCol
)
:
0
;
if
(
!
canReturnNull
)
{
if
(
x1
+
dx
>
x
)
{
return
{
col
:
c2
,
left
:
this
.
cols
[
c2
].
left
-
offset
,
right
:
x2
};
if
(
c
!==
this
.
visibleRange
.
c1
)
{
}
if
(
dx
)
{
}
else
{
c
-=
1
;
if
(
this
.
topLeftFrozenCell
)
{
x2
=
x1
;
cFrozen
=
this
.
topLeftFrozenCell
.
getCol0
();
x1
-=
this
.
cols
[
c
].
width
;
if
(
0
!==
cFrozen
)
{
}
c
=
0
;
return
{
col
:
c
,
left
:
x1
,
right
:
x2
};
offset
=
this
.
cols
[
c
].
left
-
this
.
cellsLeft
;
}
else
{
}
c
=
c2
;
}
break
;
for
(
x2
=
this
.
cellsLeft
+
this
.
cols
[
c
].
width
,
c2
=
0
;
c
>=
c2
;
--
c
,
x2
=
x1
)
{
}
x1
=
this
.
cols
[
c
].
left
-
offset
;
}
else
if
(
x
<=
x2
+
dx
)
{
if
(
x1
<=
x
&&
x
<
x2
)
{
return
{
col
:
c
,
left
:
x1
,
right
:
x2
};
if
(
dX
)
{
}
// Учитываем половину ячейки
}
if
(
x1
<=
x
&&
x
<
x1
+
this
.
cols
[
c
].
width
/
2.0
)
{
if
(
!
canReturnNull
)
{
// Это предыдущая ячейка
x1
=
this
.
cols
[
c2
].
left
-
offset
;
--
c
;
return
{
col
:
c2
,
left
:
x1
,
right
:
x1
+
this
.
cols
[
c2
].
width
};
// Можем вернуть и -1 (но это только для fillHandle)
}
}
}
else
{
}
if
(
this
.
topLeftFrozenCell
)
{
return
{
col
:
c
,
left
:
x1
,
right
:
x2
};
cFrozen
=
this
.
topLeftFrozenCell
.
getCol0
();
}
if
(
0
!==
cFrozen
)
{
}
c
=
0
;
if
(
!
canReturnNull
)
{
offset
=
this
.
cols
[
c
].
left
-
this
.
cellsLeft
;
if
(
dX
)
{
}
// Это предыдущая ячейка
}
--
c2
;
for
(
x2
=
this
.
cellsLeft
+
this
.
cols
[
c
].
width
,
c2
=
0
;
c
>=
c2
;
--
c
,
x2
=
x1
)
{
// Можем вернуть и -1 (но это только для fillHandle)
x1
=
this
.
cols
[
c
].
left
-
offset
;
return
{
col
:
c2
};
if
(
x1
<=
x
&&
x
<
x2
)
{
}
return
{
col
:
c
,
left
:
x1
,
right
:
x2
};
return
{
col
:
c2
,
left
:
x1
,
right
:
x1
+
this
.
cols
[
c2
].
width
};
}
}
}
}
if
(
!
canReturnNull
)
{
return
null
;
return
{
col
:
c2
,
left
:
x1
,
right
:
x1
+
this
.
cols
[
c2
].
width
};
};
}
}
return
null
;
};
// dY = true - считать с половиной следующей ячейки
/**
WorksheetView
.
prototype
.
_findRowUnderCursor
=
function
(
y
,
canReturnNull
,
dY
)
{
*
var
r
=
this
.
visibleRange
.
r1
,
offset
=
this
.
rows
[
r
].
top
-
this
.
cellsTop
,
r2
,
y1
,
y2
,
rFrozen
,
heightDiff
=
0
;
* @param y
if
(
y
>=
this
.
cellsTop
)
{
* @param canReturnNull
if
(
this
.
topLeftFrozenCell
)
{
* @param half - считать с половиной следующей ячейки
rFrozen
=
this
.
topLeftFrozenCell
.
getRow0
();
* @returns {*}
heightDiff
=
this
.
rows
[
rFrozen
].
top
-
this
.
rows
[
0
].
top
;
* @private
if
(
y
<
this
.
cellsTop
+
heightDiff
&&
0
!==
heightDiff
)
{
*/
r
=
0
;
WorksheetView
.
prototype
.
_findRowUnderCursor
=
function
(
y
,
canReturnNull
,
half
)
{
heightDiff
=
0
;
var
activeCellRow
=
this
.
_getSelection
().
activeCell
.
row
;
}
var
dy
=
0
;
}
var
r
=
this
.
visibleRange
.
r1
;
for
(
y1
=
this
.
cellsTop
+
heightDiff
,
r2
=
this
.
rows
.
length
-
1
;
r
<=
r2
;
++
r
,
y1
=
y2
)
{
var
offset
=
this
.
rows
[
r
].
top
-
this
.
cellsTop
;
y2
=
y1
+
this
.
rows
[
r
].
height
;
var
r2
,
y1
,
y2
,
rFrozen
,
heightDiff
=
0
;
if
(
y1
<=
y
&&
y
<
y2
)
{
if
(
y
>=
this
.
cellsTop
)
{
if
(
dY
)
{
if
(
this
.
topLeftFrozenCell
)
{
// Учитываем половину ячейки
rFrozen
=
this
.
topLeftFrozenCell
.
getRow0
();
if
(
y1
<=
y
&&
y
<
y1
+
this
.
rows
[
r
].
height
/
2.0
)
{
heightDiff
=
this
.
rows
[
rFrozen
].
top
-
this
.
rows
[
0
].
top
;
// Это предыдущая ячейка
if
(
y
<
this
.
cellsTop
+
heightDiff
&&
0
!==
heightDiff
)
{
--
r
;
r
=
0
;
// Можем вернуть и -1 (но это только для fillHandle)
heightDiff
=
0
;
}
}
}
}
return
{
row
:
r
,
top
:
y1
,
bottom
:
y2
};
for
(
y1
=
this
.
cellsTop
+
heightDiff
,
r2
=
this
.
rows
.
length
-
1
;
r
<=
r2
;
++
r
,
y1
=
y2
)
{
}
y2
=
y1
+
this
.
rows
[
r
].
height
;
}
dy
=
half
?
this
.
rows
[
r
].
height
/
2.0
*
Math
.
sign
(
r
-
activeCellRow
)
:
0
;
if
(
!
canReturnNull
)
{
if
(
y1
+
dy
>
y
)
{
return
{
row
:
r2
,
top
:
this
.
rows
[
r2
].
top
-
offset
,
bottom
:
y2
};
if
(
r
!==
this
.
visibleRange
.
r1
)
{
}
if
(
dy
)
{
}
else
{
r
-=
1
;
if
(
this
.
topLeftFrozenCell
)
{
y2
=
y1
;
rFrozen
=
this
.
topLeftFrozenCell
.
getRow0
();
y1
-=
this
.
rows
[
r
].
height
;
if
(
0
!==
rFrozen
)
{
}
r
=
0
;
return
{
row
:
r
,
top
:
y1
,
bottom
:
y2
};
offset
=
this
.
rows
[
r
].
top
-
this
.
cellsTop
;
}
else
{
}
r
=
r2
;
}
break
;
for
(
y2
=
this
.
cellsTop
+
this
.
rows
[
r
].
height
,
r2
=
0
;
r
>=
r2
;
--
r
,
y2
=
y1
)
{
}
y1
=
this
.
rows
[
r
].
top
-
offset
;
}
else
if
(
y
<=
y2
+
dy
)
{
if
(
y1
<=
y
&&
y
<
y2
)
{
return
{
row
:
r
,
top
:
y1
,
bottom
:
y2
};
if
(
dY
)
{
}
// Учитываем половину ячейки
}
if
(
y1
<=
y
&&
y
<
y1
+
this
.
rows
[
r
].
height
/
2.0
)
{
if
(
!
canReturnNull
)
{
// Это предыдущая ячейка
y1
=
this
.
rows
[
r2
].
top
-
offset
;
--
r
;
return
{
row
:
r2
,
top
:
y1
,
bottom
:
y1
+
this
.
rows
[
r2
].
height
};
// Можем вернуть и -1 (но это только для fillHandle)
}
}
}
else
{
}
if
(
this
.
topLeftFrozenCell
)
{
return
{
row
:
r
,
top
:
y1
,
bottom
:
y2
};
rFrozen
=
this
.
topLeftFrozenCell
.
getRow0
();
}
if
(
0
!==
rFrozen
)
{
}
r
=
0
;
if
(
!
canReturnNull
)
{
offset
=
this
.
rows
[
r
].
top
-
this
.
cellsTop
;
if
(
dY
)
{
}
// Это предыдущая ячейка
}
--
r2
;
for
(
y2
=
this
.
cellsTop
+
this
.
rows
[
r
].
height
,
r2
=
0
;
r
>=
r2
;
--
r
,
y2
=
y1
)
{
// Можем вернуть и -1 (но это только для fillHandle)
y1
=
this
.
rows
[
r
].
top
-
offset
;
return
{
row
:
r2
};
if
(
y1
<=
y
&&
y
<
y2
)
{
}
return
{
row
:
r
,
top
:
y1
,
bottom
:
y2
};
return
{
row
:
r2
,
top
:
y1
,
bottom
:
y1
+
this
.
rows
[
r2
].
height
};
}
}
}
}
if
(
!
canReturnNull
)
{
return
null
;
return
{
row
:
r2
,
top
:
y1
,
bottom
:
y1
+
this
.
rows
[
r2
].
height
};
};
}
}
return
null
;
};
WorksheetView
.
prototype
.
_hitResizeCorner
=
function
(
x1
,
y1
,
x2
,
y2
)
{
WorksheetView
.
prototype
.
_hitResizeCorner
=
function
(
x1
,
y1
,
x2
,
y2
)
{
var
wEps
=
this
.
width_1px
*
AscCommon
.
global_mouseEvent
.
KoefPixToMM
,
hEps
=
this
.
height_1px
*
AscCommon
.
global_mouseEvent
.
KoefPixToMM
;
var
wEps
=
this
.
width_1px
*
AscCommon
.
global_mouseEvent
.
KoefPixToMM
,
hEps
=
this
.
height_1px
*
AscCommon
.
global_mouseEvent
.
KoefPixToMM
;
...
@@ -6508,19 +6514,20 @@
...
@@ -6508,19 +6514,20 @@
});
});
};
};
WorksheetView
.
prototype
.
_calcSelectionEndPointByXY
=
function
(
x
,
y
)
{
WorksheetView
.
prototype
.
_calcSelectionEndPointByXY
=
function
(
x
,
y
)
{
var
tmpSelection
=
this
.
_getSelection
();
var
tmpSelection
=
this
.
_getSelection
();
var
ar
=
tmpSelection
.
getLast
();
var
ar
=
tmpSelection
.
getLast
();
x
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIX
());
x
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIX
());
y
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIY
());
y
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIY
());
var
res
=
new
asc_Range
(
tmpSelection
.
activeCell
.
col
,
tmpSelection
.
activeCell
.
row
,
this
.
_findColUnderCursor
(
var
res
=
new
asc_Range
(
tmpSelection
.
activeCell
.
col
,
tmpSelection
.
activeCell
.
row
,
this
.
_findColUnderCursor
(
x
,
x
).
col
,
this
.
_findRowUnderCursor
(
y
).
row
,
true
);
false
,
this
.
settings
.
halfSelection
).
col
,
this
.
_findRowUnderCursor
(
y
,
false
,
if
(
ar
.
type
===
c_oAscSelectionType
.
RangeCells
)
{
this
.
settings
.
halfSelection
).
row
,
true
);
this
.
_fixSelectionOfMergedCells
(
res
);
if
(
ar
.
type
===
c_oAscSelectionType
.
RangeCells
)
{
}
this
.
_fixSelectionOfMergedCells
(
res
);
return
res
;
}
};
return
res
;
};
WorksheetView
.
prototype
.
_calcSelectionEndPointByOffset
=
function
(
dc
,
dr
)
{
WorksheetView
.
prototype
.
_calcSelectionEndPointByOffset
=
function
(
dc
,
dr
)
{
var
tmpSelection
=
this
.
_getSelection
();
var
tmpSelection
=
this
.
_getSelection
();
...
@@ -6752,15 +6759,15 @@
...
@@ -6752,15 +6759,15 @@
return
false
;
return
false
;
};
};
//нужно ли спрашивать пользователя о расширении диапазона
//нужно ли спрашивать пользователя о расширении диапазона
WorksheetView
.
prototype
.
getSelectionSortInfo
=
function
()
{
WorksheetView
.
prototype
.
getSelectionSortInfo
=
function
()
{
//в случае попытки сортировать мультиселект, необходимо выдавать ошибку
//в случае попытки сортировать мультиселект, необходимо выдавать ошибку
var
arn
=
this
.
model
.
selectionRange
.
getLast
().
clone
(
true
);
var
arn
=
this
.
model
.
selectionRange
.
getLast
().
clone
(
true
);
//null - не выдавать сообщение и не расширять, false - не выдавать сообщение и расширЯть, true - выдавать сообщение
//null - не выдавать сообщение и не расширять, false - не выдавать сообщение и расширЯть, true - выдавать сообщение
var
bResult
=
false
;
var
bResult
=
false
;
//если внутри форматированной таблиц, никогда не выдаем сообщение
//если внутри форматированной таблиц, никогда не выдаем сообщение
if
(
this
.
model
.
autoFilters
.
_isTablePartsContainsRange
(
arn
))
if
(
this
.
model
.
autoFilters
.
_isTablePartsContainsRange
(
arn
))
{
{
...
@@ -6781,7 +6788,7 @@
...
@@ -6781,7 +6788,7 @@
var
activeCell
=
this
.
model
.
selectionRange
.
activeCell
;
var
activeCell
=
this
.
model
.
selectionRange
.
activeCell
;
var
activeCellRange
=
new
Asc
.
Range
(
activeCell
.
col
,
activeCell
.
row
,
activeCell
.
col
,
activeCell
.
row
);
var
activeCellRange
=
new
Asc
.
Range
(
activeCell
.
col
,
activeCell
.
row
,
activeCell
.
col
,
activeCell
.
row
);
var
expandRange
=
this
.
model
.
autoFilters
.
_getAdjacentCellsAF
(
activeCellRange
);
var
expandRange
=
this
.
model
.
autoFilters
.
_getAdjacentCellsAF
(
activeCellRange
);
//если диапазон не расширяется за счет близлежащих ячеек - не выдаем сообщение и не расширяем
//если диапазон не расширяется за счет близлежащих ячеек - не выдаем сообщение и не расширяем
if
(
arn
.
isEqual
(
expandRange
)
||
activeCellRange
.
isEqual
(
expandRange
))
if
(
arn
.
isEqual
(
expandRange
)
||
activeCellRange
.
isEqual
(
expandRange
))
{
{
...
@@ -6793,10 +6800,10 @@
...
@@ -6793,10 +6800,10 @@
}
}
}
}
}
}
return
bResult
;
return
bResult
;
};
};
WorksheetView
.
prototype
.
getSelectionMathInfo
=
function
()
{
WorksheetView
.
prototype
.
getSelectionMathInfo
=
function
()
{
var
oSelectionMathInfo
=
new
asc_CSelectionMathInfo
();
var
oSelectionMathInfo
=
new
asc_CSelectionMathInfo
();
var
sum
=
0
;
var
sum
=
0
;
...
@@ -6966,7 +6973,7 @@
...
@@ -6966,7 +6973,7 @@
cell_info
.
formatTableInfo
.
firstRow
=
curTablePart
.
HeaderRowCount
===
null
;
cell_info
.
formatTableInfo
.
firstRow
=
curTablePart
.
HeaderRowCount
===
null
;
cell_info
.
formatTableInfo
.
tableRange
=
curTablePart
.
Ref
.
getAbsName
();
cell_info
.
formatTableInfo
.
tableRange
=
curTablePart
.
Ref
.
getAbsName
();
cell_info
.
formatTableInfo
.
filterButton
=
curTablePart
.
isShowButton
();
cell_info
.
formatTableInfo
.
filterButton
=
curTablePart
.
isShowButton
();
cell_info
.
formatTableInfo
.
altText
=
curTablePart
.
altText
;
cell_info
.
formatTableInfo
.
altText
=
curTablePart
.
altText
;
cell_info
.
formatTableInfo
.
altTextSummary
=
curTablePart
.
altTextSummary
;
cell_info
.
formatTableInfo
.
altTextSummary
=
curTablePart
.
altTextSummary
;
...
@@ -6992,7 +6999,7 @@
...
@@ -6992,7 +6999,7 @@
cell_info
.
font
.
bold
=
font
.
getBold
();
cell_info
.
font
.
bold
=
font
.
getBold
();
cell_info
.
font
.
italic
=
font
.
getItalic
();
cell_info
.
font
.
italic
=
font
.
getItalic
();
// ToDo убрать, когда будет реализовано двойное подчеркивание
// ToDo убрать, когда будет реализовано двойное подчеркивание
cell_info
.
font
.
underline
=
(
Asc
.
EUnderline
.
underlineNone
!==
font
.
getUnderline
());
cell_info
.
font
.
underline
=
(
Asc
.
EUnderline
.
underlineNone
!==
font
.
getUnderline
());
cell_info
.
font
.
strikeout
=
font
.
getStrikeout
();
cell_info
.
font
.
strikeout
=
font
.
getStrikeout
();
cell_info
.
font
.
subscript
=
fa
===
AscCommon
.
vertalign_SubScript
;
cell_info
.
font
.
subscript
=
fa
===
AscCommon
.
vertalign_SubScript
;
cell_info
.
font
.
superscript
=
fa
===
AscCommon
.
vertalign_SuperScript
;
cell_info
.
font
.
superscript
=
fa
===
AscCommon
.
vertalign_SuperScript
;
...
@@ -7568,11 +7575,11 @@
...
@@ -7568,11 +7575,11 @@
var
activeFillHandleCopy
;
var
activeFillHandleCopy
;
// Колонка по X и строка по Y
// Колонка по X и строка по Y
var
colByX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
/*dX*/
true
).
col
;
var
colByX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
true
).
col
;
var
rowByY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
/*dX*/
true
).
row
;
var
rowByY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
true
).
row
;
// Колонка по X и строка по Y (без половинчатого счета). Для сдвига видимой области
// Колонка по X и строка по Y (без половинчатого счета). Для сдвига видимой области
var
colByXNoDX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
/*dX*/
false
).
col
;
var
colByXNoDX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
false
).
col
;
var
rowByYNoDY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
/*dX*/
false
).
row
;
var
rowByYNoDY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
false
).
row
;
// Сдвиг в столбцах и строках от крайней точки
// Сдвиг в столбцах и строках от крайней точки
var
dCol
;
var
dCol
;
var
dRow
;
var
dRow
;
...
@@ -7765,8 +7772,6 @@
...
@@ -7765,8 +7772,6 @@
this
.
activeFillHandle
.
r2
=
ar
.
r1
;
this
.
activeFillHandle
.
r2
=
ar
.
r1
;
// Когда идем назад, должна быть колонка на 1 больше
this
.
activeFillHandle
.
c2
+=
1
;
// Случай, если мы еще не вышли из внутренней области
// Случай, если мы еще не вышли из внутренней области
if
(
this
.
activeFillHandle
.
c2
==
ar
.
c1
)
{
if
(
this
.
activeFillHandle
.
c2
==
ar
.
c1
)
{
this
.
fillHandleArea
=
2
;
this
.
fillHandleArea
=
2
;
...
@@ -7779,9 +7784,6 @@
...
@@ -7779,9 +7784,6 @@
this
.
activeFillHandle
.
r2
=
ar
.
r1
;
this
.
activeFillHandle
.
r2
=
ar
.
r1
;
// Когда идем назад, должна быть колонка на 1 больше
this
.
activeFillHandle
.
c2
+=
1
;
if
(
this
.
activeFillHandle
.
c2
>
this
.
activeFillHandle
.
c1
)
{
if
(
this
.
activeFillHandle
.
c2
>
this
.
activeFillHandle
.
c1
)
{
// Ситуация половинки последнего столбца
// Ситуация половинки последнего столбца
this
.
activeFillHandle
.
c1
=
ar
.
c1
;
this
.
activeFillHandle
.
c1
=
ar
.
c1
;
...
@@ -7841,8 +7843,6 @@
...
@@ -7841,8 +7843,6 @@
this
.
activeFillHandle
.
c2
=
ar
.
c1
;
this
.
activeFillHandle
.
c2
=
ar
.
c1
;
// Когда идем назад, должна быть строка на 1 больше
this
.
activeFillHandle
.
r2
+=
1
;
// Случай, если мы еще не вышли из внутренней области
// Случай, если мы еще не вышли из внутренней области
if
(
this
.
activeFillHandle
.
r2
==
ar
.
r1
)
{
if
(
this
.
activeFillHandle
.
r2
==
ar
.
r1
)
{
this
.
fillHandleArea
=
2
;
this
.
fillHandleArea
=
2
;
...
@@ -7855,9 +7855,6 @@
...
@@ -7855,9 +7855,6 @@
this
.
activeFillHandle
.
c2
=
ar
.
c1
;
this
.
activeFillHandle
.
c2
=
ar
.
c1
;
// Когда идем назад, должна быть строка на 1 больше
this
.
activeFillHandle
.
r2
+=
1
;
if
(
this
.
activeFillHandle
.
r2
>
this
.
activeFillHandle
.
r1
)
{
if
(
this
.
activeFillHandle
.
r2
>
this
.
activeFillHandle
.
r1
)
{
// Ситуация половинки последней строки
// Ситуация половинки последней строки
this
.
activeFillHandle
.
c1
=
ar
.
c1
;
this
.
activeFillHandle
.
c1
=
ar
.
c1
;
...
@@ -8053,8 +8050,8 @@
...
@@ -8053,8 +8050,8 @@
}
}
// Колонка по X и строка по Y
// Колонка по X и строка по Y
var
colByX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
/*dX*/
false
).
col
;
var
colByX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
false
).
col
;
var
rowByY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
/*dY*/
false
).
row
;
var
rowByY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
false
).
row
;
if
(
selectionRange
.
type
==
c_oAscSelectionType
.
RangeRow
)
{
if
(
selectionRange
.
type
==
c_oAscSelectionType
.
RangeRow
)
{
colByX
=
0
;
colByX
=
0
;
...
@@ -8179,8 +8176,8 @@
...
@@ -8179,8 +8176,8 @@
this
.
arrActiveChartRanges
[
indexFormulaRange
]).
getLast
().
clone
();
this
.
arrActiveChartRanges
[
indexFormulaRange
]).
getLast
().
clone
();
// Колонка по X и строка по Y
// Колонка по X и строка по Y
var
colByX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
/*dX*/
false
).
col
;
var
colByX
=
this
.
_findColUnderCursor
(
x
,
/*canReturnNull*/
false
,
false
).
col
;
var
rowByY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
/*dY*/
false
).
row
;
var
rowByY
=
this
.
_findRowUnderCursor
(
y
,
/*canReturnNull*/
false
,
false
).
row
;
// Если мы только первый раз попали сюда, то копируем выделенную область
// Если мы только первый раз попали сюда, то копируем выделенную область
if
(
null
===
this
.
startCellMoveResizeRange
)
{
if
(
null
===
this
.
startCellMoveResizeRange
)
{
...
@@ -8766,7 +8763,7 @@
...
@@ -8766,7 +8763,7 @@
callTrigger
=
true
;
callTrigger
=
true
;
t
.
handlers
.
trigger
(
"
slowOperation
"
,
true
);
t
.
handlers
.
trigger
(
"
slowOperation
"
,
true
);
}
}
//добавляем форматированные таблицы
//добавляем форматированные таблицы
var
arnToRange
=
t
.
model
.
selectionRange
.
getLast
();
var
arnToRange
=
t
.
model
.
selectionRange
.
getLast
();
var
tablesMap
=
null
;
var
tablesMap
=
null
;
...
@@ -8816,7 +8813,7 @@
...
@@ -8816,7 +8813,7 @@
tablesMap
[
curTable
.
DisplayName
]
=
newDisplayName
;
tablesMap
[
curTable
.
DisplayName
]
=
newDisplayName
;
}
}
if
(
bIsAddTable
)
if
(
bIsAddTable
)
{
{
t
.
_isLockedDefNames
(
null
,
null
);
t
.
_isLockedDefNames
(
null
,
null
);
...
@@ -8896,16 +8893,16 @@
...
@@ -8896,16 +8893,16 @@
var
api
=
asc
[
"
editor
"
];
var
api
=
asc
[
"
editor
"
];
var
isEndTransaction
=
false
;
var
isEndTransaction
=
false
;
if
(
pasteContent
.
props
.
addImagesFromWord
&&
pasteContent
.
props
.
addImagesFromWord
.
length
!=
0
&&
!
(
window
[
"
Asc
"
][
"
editor
"
]
&&
window
[
"
Asc
"
][
"
editor
"
].
isChartEditor
)
)
if
(
pasteContent
.
props
.
addImagesFromWord
&&
pasteContent
.
props
.
addImagesFromWord
.
length
!=
0
&&
!
(
window
[
"
Asc
"
][
"
editor
"
]
&&
window
[
"
Asc
"
][
"
editor
"
].
isChartEditor
)
)
{
{
var
oObjectsForDownload
=
AscCommon
.
GetObjectsForImageDownload
(
pasteContent
.
props
.
_aPastedImages
);
var
oObjectsForDownload
=
AscCommon
.
GetObjectsForImageDownload
(
pasteContent
.
props
.
_aPastedImages
);
//if already load images on server
//if already load images on server
if
(
api
.
wb
.
clipboard
.
pasteProcessor
.
alreadyLoadImagesOnServer
===
true
)
if
(
api
.
wb
.
clipboard
.
pasteProcessor
.
alreadyLoadImagesOnServer
===
true
)
{
{
var
oImageMap
=
{};
var
oImageMap
=
{};
for
(
var
i
=
0
,
length
=
oObjectsForDownload
.
aBuilderImagesByUrl
.
length
;
i
<
length
;
++
i
)
for
(
var
i
=
0
,
length
=
oObjectsForDownload
.
aBuilderImagesByUrl
.
length
;
i
<
length
;
++
i
)
{
{
var
url
=
oObjectsForDownload
.
aUrls
[
i
];
var
url
=
oObjectsForDownload
.
aUrls
[
i
];
...
@@ -8928,26 +8925,26 @@
...
@@ -8928,26 +8925,26 @@
}
}
}
}
if
(
pasteContent
.
props
.
onlyImages
!==
true
)
if
(
pasteContent
.
props
.
onlyImages
!==
true
)
{
{
t
.
_pasteData
(
isLargeRange
,
fromBinary
,
pasteContent
,
bIsUpdate
,
canChangeColWidth
);
t
.
_pasteData
(
isLargeRange
,
fromBinary
,
pasteContent
,
bIsUpdate
,
canChangeColWidth
);
}
}
api
.
wb
.
clipboard
.
pasteProcessor
.
_insertImagesFromBinaryWord
(
t
,
pasteContent
,
oImageMap
);
api
.
wb
.
clipboard
.
pasteProcessor
.
_insertImagesFromBinaryWord
(
t
,
pasteContent
,
oImageMap
);
isEndTransaction
=
true
;
isEndTransaction
=
true
;
}
}
else
else
{
{
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
])
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
])
{
{
var
oImageMap
=
{};
var
oImageMap
=
{};
AscCommon
.
ResetNewUrls
(
data
,
oObjectsForDownload
.
aUrls
,
oObjectsForDownload
.
aBuilderImagesByUrl
,
oImageMap
);
AscCommon
.
ResetNewUrls
(
data
,
oObjectsForDownload
.
aUrls
,
oObjectsForDownload
.
aBuilderImagesByUrl
,
oImageMap
);
if
(
pasteContent
.
props
.
onlyImages
!==
true
)
if
(
pasteContent
.
props
.
onlyImages
!==
true
)
{
{
t
.
_pasteData
(
isLargeRange
,
fromBinary
,
pasteContent
,
bIsUpdate
,
canChangeColWidth
);
t
.
_pasteData
(
isLargeRange
,
fromBinary
,
pasteContent
,
bIsUpdate
,
canChangeColWidth
);
}
}
api
.
wb
.
clipboard
.
pasteProcessor
.
_insertImagesFromBinaryWord
(
t
,
pasteContent
,
oImageMap
);
api
.
wb
.
clipboard
.
pasteProcessor
.
_insertImagesFromBinaryWord
(
t
,
pasteContent
,
oImageMap
);
isEndTransaction
=
true
;
isEndTransaction
=
true
;
}
}
else
else
...
@@ -8964,17 +8961,17 @@
...
@@ -8964,17 +8961,17 @@
History
.
EndTransaction
();
History
.
EndTransaction
();
},
true
);
},
true
);
}
}
}
}
}
}
else
if
(
pasteContent
.
props
.
onlyImages
!==
true
)
else
if
(
pasteContent
.
props
.
onlyImages
!==
true
)
{
{
t
.
_pasteData
(
isLargeRange
,
fromBinary
,
pasteContent
,
bIsUpdate
,
canChangeColWidth
);
t
.
_pasteData
(
isLargeRange
,
fromBinary
,
pasteContent
,
bIsUpdate
,
canChangeColWidth
);
isEndTransaction
=
true
;
isEndTransaction
=
true
;
}
}
//закрываем транзакцию, поскольку в setSelectionInfo она не закроется
//закрываем транзакцию, поскольку в setSelectionInfo она не закроется
if
(
isEndTransaction
)
if
(
isEndTransaction
)
{
{
History
.
EndTransaction
();
History
.
EndTransaction
();
}
}
...
@@ -11365,8 +11362,8 @@
...
@@ -11365,8 +11362,8 @@
t
.
handlers
.
trigger
(
"
selectionChanged
"
);
t
.
handlers
.
trigger
(
"
selectionChanged
"
);
return
;
return
;
}
}
var
addNameColumn
,
filterRange
;
var
addNameColumn
,
filterRange
;
if
(
addFormatTableOptionsObj
&&
isChangeAutoFilterToTablePart
(
addFormatTableOptionsObj
)
===
true
)
//CHANGE FILTER TO TABLEPART
if
(
addFormatTableOptionsObj
&&
isChangeAutoFilterToTablePart
(
addFormatTableOptionsObj
)
===
true
)
//CHANGE FILTER TO TABLEPART
{
{
filterRange
=
t
.
model
.
AutoFilter
.
Ref
.
clone
();
filterRange
=
t
.
model
.
AutoFilter
.
Ref
.
clone
();
...
@@ -11748,10 +11745,10 @@
...
@@ -11748,10 +11745,10 @@
t
.
_onUpdateFormatTable
(
sortProps
.
sortRange
.
bbox
,
false
);
t
.
_onUpdateFormatTable
(
sortProps
.
sortRange
.
bbox
,
false
);
History
.
EndTransaction
();
History
.
EndTransaction
();
};
};
if
(
null
===
sortProps
)
{
if
(
null
===
sortProps
)
{
var
rgbColor
=
color
?
new
AscCommonExcel
.
RgbColor
((
color
.
asc_getR
()
<<
16
)
+
(
color
.
asc_getG
()
<<
8
)
+
color
.
asc_getB
())
:
null
;
var
rgbColor
=
color
?
new
AscCommonExcel
.
RgbColor
((
color
.
asc_getR
()
<<
16
)
+
(
color
.
asc_getG
()
<<
8
)
+
color
.
asc_getB
())
:
null
;
//expand selectionRange
//expand selectionRange
if
(
bIsExpandRange
)
if
(
bIsExpandRange
)
{
{
...
@@ -11759,15 +11756,15 @@
...
@@ -11759,15 +11756,15 @@
var
activeCell
=
selectionRange
.
activeCell
;
var
activeCell
=
selectionRange
.
activeCell
;
var
activeCellRange
=
new
Asc
.
Range
(
activeCell
.
col
,
activeCell
.
row
,
activeCell
.
col
,
activeCell
.
row
);
var
activeCellRange
=
new
Asc
.
Range
(
activeCell
.
col
,
activeCell
.
row
,
activeCell
.
col
,
activeCell
.
row
);
var
expandRange
=
t
.
model
.
autoFilters
.
_getAdjacentCellsAF
(
activeCellRange
,
true
);
var
expandRange
=
t
.
model
.
autoFilters
.
_getAdjacentCellsAF
(
activeCellRange
,
true
);
//change selection
//change selection
t
.
setSelection
(
expandRange
);
t
.
setSelection
(
expandRange
);
}
}
//sort
//sort
t
.
setSelectionInfo
(
"
sort
"
,
type
,
null
,
null
,
rgbColor
);
t
.
setSelectionInfo
(
"
sort
"
,
type
,
null
,
null
,
rgbColor
);
//TODO возможно стоит возвратить selection обратно
//TODO возможно стоит возвратить selection обратно
}
else
if
(
false
!==
sortProps
)
{
}
else
if
(
false
!==
sortProps
)
{
t
.
_isLockedCells
(
sortProps
.
sortRange
.
bbox
,
/*subType*/
null
,
onSortAutoFilterCallBack
);
t
.
_isLockedCells
(
sortProps
.
sortRange
.
bbox
,
/*subType*/
null
,
onSortAutoFilterCallBack
);
}
}
...
@@ -11946,10 +11943,10 @@
...
@@ -11946,10 +11943,10 @@
var
drawCurrentFilterButtons
=
function
(
filter
)
{
var
drawCurrentFilterButtons
=
function
(
filter
)
{
var
autoFilter
=
filter
.
isAutoFilter
()
?
filter
:
filter
.
AutoFilter
;
var
autoFilter
=
filter
.
isAutoFilter
()
?
filter
:
filter
.
AutoFilter
;
var
range
=
new
Asc
.
Range
(
filter
.
Ref
.
c1
,
filter
.
Ref
.
r1
,
filter
.
Ref
.
c2
,
filter
.
Ref
.
r1
);
var
range
=
new
Asc
.
Range
(
filter
.
Ref
.
c1
,
filter
.
Ref
.
r1
,
filter
.
Ref
.
c2
,
filter
.
Ref
.
r1
);
if
(
range
.
isIntersect
(
updatedRange
))
{
if
(
range
.
isIntersect
(
updatedRange
))
{
var
row
=
range
.
r1
;
var
row
=
range
.
r1
;
var
sortCondition
=
filter
.
isApplySortConditions
()
?
filter
.
SortState
.
SortConditions
[
0
]
:
null
;
var
sortCondition
=
filter
.
isApplySortConditions
()
?
filter
.
SortState
.
SortConditions
[
0
]
:
null
;
for
(
var
col
=
range
.
c1
;
col
<=
range
.
c2
;
col
++
)
{
for
(
var
col
=
range
.
c1
;
col
<=
range
.
c2
;
col
++
)
{
if
(
col
>=
updatedRange
.
c1
&&
col
<=
updatedRange
.
c2
)
{
if
(
col
>=
updatedRange
.
c1
&&
col
<=
updatedRange
.
c2
)
{
...
@@ -11983,7 +11980,7 @@
...
@@ -11983,7 +11980,7 @@
}
}
}
}
if
(
sortCondition
&&
sortCondition
.
Ref
)
if
(
sortCondition
&&
sortCondition
.
Ref
)
{
{
if
(
colId
===
sortCondition
.
Ref
.
c1
-
range
.
c1
)
if
(
colId
===
sortCondition
.
Ref
.
c1
-
range
.
c1
)
...
@@ -11991,7 +11988,7 @@
...
@@ -11991,7 +11988,7 @@
isSortState
=
sortCondition
.
ConditionDescending
;
isSortState
=
sortCondition
.
ConditionDescending
;
}
}
}
}
if
(
isShowButton
===
false
)
{
if
(
isShowButton
===
false
)
{
continue
;
continue
;
}
}
...
@@ -12026,26 +12023,26 @@
...
@@ -12026,26 +12023,26 @@
return
true
;
return
true
;
};
};
WorksheetView
.
prototype
.
af_drawCurrentButton
=
function
(
x1
,
y1
,
props
)
{
WorksheetView
.
prototype
.
af_drawCurrentButton
=
function
(
x1
,
y1
,
props
)
{
var
isApplyAutoFilter
=
props
.
isSetFilter
;
var
isApplyAutoFilter
=
props
.
isSetFilter
;
var
isApplySortState
=
props
.
isSortState
;
var
isApplySortState
=
props
.
isSortState
;
var
ws
=
this
;
var
ws
=
this
;
var
aWs
=
this
.
model
;
var
aWs
=
this
.
model
;
var
t
=
this
;
var
t
=
this
;
var
width_1px
=
t
.
width_1px
;
var
width_1px
=
t
.
width_1px
;
var
height_1px
=
t
.
height_1px
;
var
height_1px
=
t
.
height_1px
;
var
height
=
15
*
width_1px
;
var
height
=
15
*
width_1px
;
var
width
=
15
*
height_1px
;
var
width
=
15
*
height_1px
;
var
m_oColor
=
new
CColor
(
120
,
120
,
120
);
var
m_oColor
=
new
CColor
(
120
,
120
,
120
);
var
rowHeight
=
ws
.
rows
[
props
.
row
].
height
;
var
rowHeight
=
ws
.
rows
[
props
.
row
].
height
;
var
colWidth
=
ws
.
cols
[
props
.
col
].
width
;
var
colWidth
=
ws
.
cols
[
props
.
col
].
width
;
var
scaleIndex
=
1
;
var
scaleIndex
=
1
;
var
_drawButtonBorder
=
function
(
startX
,
startY
,
width
,
height
)
var
_drawButtonBorder
=
function
(
startX
,
startY
,
width
,
height
)
{
{
ws
.
drawingCtx
ws
.
drawingCtx
...
@@ -12055,20 +12052,20 @@
...
@@ -12055,20 +12052,20 @@
.
fillRect
(
startX
,
startY
,
width
,
height
)
.
fillRect
(
startX
,
startY
,
width
,
height
)
.
strokeRect
(
startX
,
startY
,
width
,
height
);
.
strokeRect
(
startX
,
startY
,
width
,
height
);
};
};
var
_drawSortArrow
=
function
(
startX
,
startY
,
isDescending
,
heightArrow
)
var
_drawSortArrow
=
function
(
startX
,
startY
,
isDescending
,
heightArrow
)
{
{
heightArrow
=
heightArrow
*
height_1px
*
scaleIndex
;
heightArrow
=
heightArrow
*
height_1px
*
scaleIndex
;
var
widthArrow
=
3
*
width_1px
*
scaleIndex
;
var
widthArrow
=
3
*
width_1px
*
scaleIndex
;
var
widthLine
=
1
*
width_1px
*
scaleIndex
;
var
widthLine
=
1
*
width_1px
*
scaleIndex
;
var
heightEndArrow
=
3
*
height_1px
*
scaleIndex
;
var
heightEndArrow
=
3
*
height_1px
*
scaleIndex
;
//isDescending = true - стрелочка смотрит вниз
//isDescending = true - стрелочка смотрит вниз
//рисуем сверху вниз
//рисуем сверху вниз
var
ctx
=
ws
.
drawingCtx
;
var
ctx
=
ws
.
drawingCtx
;
ctx
.
beginPath
();
ctx
.
beginPath
();
ctx
.
lineVer
(
startX
,
startY
,
startY
+
heightArrow
);
ctx
.
lineVer
(
startX
,
startY
,
startY
+
heightArrow
);
if
(
isDescending
)
if
(
isDescending
)
{
{
ctx
.
moveTo
(
startX
,
startY
+
heightArrow
);
ctx
.
moveTo
(
startX
,
startY
+
heightArrow
);
...
@@ -12085,13 +12082,13 @@
...
@@ -12085,13 +12082,13 @@
ctx
.
lineTo
(
startX
,
startY
);
ctx
.
lineTo
(
startX
,
startY
);
//ctx.lineHor(startX - widthLine, startY + 1 * height_1px * scaleIndex, startX - widthLine + widthArrow);
//ctx.lineHor(startX - widthLine, startY + 1 * height_1px * scaleIndex, startX - widthLine + widthArrow);
}
}
ctx
.
setLineWidth
(
t
.
width_1px
);
ctx
.
setLineWidth
(
t
.
width_1px
);
ctx
.
setStrokeStyle
(
m_oColor
);
ctx
.
setStrokeStyle
(
m_oColor
);
ctx
.
stroke
();
ctx
.
stroke
();
};
};
var
_drawFilterMark
=
function
(
x
,
y
,
height
)
var
_drawFilterMark
=
function
(
x
,
y
,
height
)
{
{
var
size
=
5.25
*
scaleIndex
;
var
size
=
5.25
*
scaleIndex
;
var
halfSize
=
Math
.
round
((
size
/
2
)
/
height_1px
)
*
height_1px
;
var
halfSize
=
Math
.
round
((
size
/
2
)
/
height_1px
)
*
height_1px
;
...
@@ -12119,7 +12116,7 @@
...
@@ -12119,7 +12116,7 @@
.
fill
();
.
fill
();
};
};
var
_drawFilterDreieck
=
function
(
x
,
y
,
index
)
var
_drawFilterDreieck
=
function
(
x
,
y
,
index
)
{
{
var
size
=
5.25
*
index
;
var
size
=
5.25
*
index
;
//сюда приходят координаты центра кнопки
//сюда приходят координаты центра кнопки
...
@@ -12141,56 +12138,56 @@
...
@@ -12141,56 +12138,56 @@
.
setFillStyle
(
m_oColor
)
.
setFillStyle
(
m_oColor
)
.
fill
();
.
fill
();
};
};
//TODO пересмотреть отрисовку кнопок + отрисовку при масштабировании
//TODO пересмотреть отрисовку кнопок + отрисовку при масштабировании
var
_drawButton
=
function
(
upLeftXButton
,
upLeftYButton
)
var
_drawButton
=
function
(
upLeftXButton
,
upLeftYButton
)
{
{
//квадрат кнопки рисуем
//квадрат кнопки рисуем
_drawButtonBorder
(
upLeftXButton
,
upLeftYButton
,
width
,
height
);
_drawButtonBorder
(
upLeftXButton
,
upLeftYButton
,
width
,
height
);
//координаты центра
//координаты центра
var
centerX
=
upLeftXButton
+
(
width
/
2
);
var
centerX
=
upLeftXButton
+
(
width
/
2
);
var
centerY
=
upLeftYButton
+
(
height
/
2
);
var
centerY
=
upLeftYButton
+
(
height
/
2
);
if
(
null
!==
isApplySortState
&&
isApplyAutoFilter
)
if
(
null
!==
isApplySortState
&&
isApplyAutoFilter
)
{
{
var
heigthObj
=
Math
.
ceil
((
height
/
2
)
/
height_1px
)
*
height_1px
+
1
*
height_1px
;
var
heigthObj
=
Math
.
ceil
((
height
/
2
)
/
height_1px
)
*
height_1px
+
1
*
height_1px
;
var
marginTop
=
Math
.
floor
(((
height
-
heigthObj
)
/
2
)
/
height_1px
)
*
height_1px
;
var
marginTop
=
Math
.
floor
(((
height
-
heigthObj
)
/
2
)
/
height_1px
)
*
height_1px
;
centerY
=
upLeftYButton
+
heigthObj
+
marginTop
;
centerY
=
upLeftYButton
+
heigthObj
+
marginTop
;
_drawSortArrow
(
upLeftXButton
+
4
*
width_1px
*
scaleIndex
,
upLeftYButton
+
5
*
height_1px
*
scaleIndex
,
isApplySortState
,
8
);
_drawSortArrow
(
upLeftXButton
+
4
*
width_1px
*
scaleIndex
,
upLeftYButton
+
5
*
height_1px
*
scaleIndex
,
isApplySortState
,
8
);
_drawFilterMark
(
centerX
+
2
*
width_1px
,
centerY
,
heigthObj
);
_drawFilterMark
(
centerX
+
2
*
width_1px
,
centerY
,
heigthObj
);
}
}
else
if
(
null
!==
isApplySortState
)
else
if
(
null
!==
isApplySortState
)
{
{
_drawSortArrow
(
upLeftXButton
+
width
-
5
*
width_1px
*
scaleIndex
,
upLeftYButton
+
3
*
height_1px
*
scaleIndex
,
isApplySortState
,
10
);
_drawSortArrow
(
upLeftXButton
+
width
-
5
*
width_1px
*
scaleIndex
,
upLeftYButton
+
3
*
height_1px
*
scaleIndex
,
isApplySortState
,
10
);
_drawFilterDreieck
(
centerX
-
3
*
width_1px
,
centerY
+
2
*
height_1px
,
scaleIndex
*
0.75
);
_drawFilterDreieck
(
centerX
-
3
*
width_1px
,
centerY
+
2
*
height_1px
,
scaleIndex
*
0.75
);
}
}
else
if
(
isApplyAutoFilter
)
else
if
(
isApplyAutoFilter
)
{
{
var
heigthObj
=
Math
.
ceil
((
height
/
2
)
/
height_1px
)
*
height_1px
+
1
*
height_1px
;
var
heigthObj
=
Math
.
ceil
((
height
/
2
)
/
height_1px
)
*
height_1px
+
1
*
height_1px
;
var
marginTop
=
Math
.
floor
(((
height
-
heigthObj
)
/
2
)
/
height_1px
)
*
height_1px
;
var
marginTop
=
Math
.
floor
(((
height
-
heigthObj
)
/
2
)
/
height_1px
)
*
height_1px
;
centerY
=
upLeftYButton
+
heigthObj
+
marginTop
;
centerY
=
upLeftYButton
+
heigthObj
+
marginTop
;
_drawFilterMark
(
centerX
,
centerY
,
heigthObj
);
_drawFilterMark
(
centerX
,
centerY
,
heigthObj
);
}
}
else
else
{
{
_drawFilterDreieck
(
centerX
,
centerY
,
scaleIndex
);
_drawFilterDreieck
(
centerX
,
centerY
,
scaleIndex
);
}
}
};
};
var
diffX
=
0
;
var
diffX
=
0
;
var
diffY
=
0
;
var
diffY
=
0
;
if
((
colWidth
-
2
)
<
width
&&
rowHeight
<
(
height
+
2
))
if
((
colWidth
-
2
)
<
width
&&
rowHeight
<
(
height
+
2
))
{
{
if
(
rowHeight
<
colWidth
)
if
(
rowHeight
<
colWidth
)
{
{
scaleIndex
=
rowHeight
/
height
;
scaleIndex
=
rowHeight
/
height
;
width
=
width
*
scaleIndex
;
width
=
width
*
scaleIndex
;
height
=
rowHeight
;
height
=
rowHeight
;
}
}
else
else
{
{
scaleIndex
=
colWidth
/
width
;
scaleIndex
=
colWidth
/
width
;
diffY
=
width
-
colWidth
;
diffY
=
width
-
colWidth
;
...
@@ -12199,7 +12196,7 @@
...
@@ -12199,7 +12196,7 @@
height
=
height
*
scaleIndex
;
height
=
height
*
scaleIndex
;
}
}
}
}
else
if
((
colWidth
-
2
)
<
width
)
else
if
((
colWidth
-
2
)
<
width
)
{
{
scaleIndex
=
colWidth
/
width
;
scaleIndex
=
colWidth
/
width
;
//смещения по x и y
//смещения по x и y
...
@@ -12207,17 +12204,17 @@
...
@@ -12207,17 +12204,17 @@
diffX
=
width
-
colWidth
+
2
;
diffX
=
width
-
colWidth
+
2
;
width
=
colWidth
;
width
=
colWidth
;
height
=
height
*
scaleIndex
;
height
=
height
*
scaleIndex
;
}
}
else
if
(
rowHeight
<
height
)
else
if
(
rowHeight
<
height
)
{
{
scaleIndex
=
rowHeight
/
height
;
scaleIndex
=
rowHeight
/
height
;
width
=
width
*
scaleIndex
;
width
=
width
*
scaleIndex
;
height
=
rowHeight
;
height
=
rowHeight
;
}
}
_drawButton
(
x1
+
diffX
,
y1
+
diffY
);
_drawButton
(
x1
+
diffX
,
y1
+
diffY
);
};
};
WorksheetView
.
prototype
.
af_checkCursor
=
function
(
x
,
y
,
offsetX
,
offsetY
,
frozenObj
,
r
,
c
)
{
WorksheetView
.
prototype
.
af_checkCursor
=
function
(
x
,
y
,
offsetX
,
offsetY
,
frozenObj
,
r
,
c
)
{
var
ws
=
this
;
var
ws
=
this
;
var
aWs
=
this
.
model
;
var
aWs
=
this
.
model
;
...
@@ -12821,7 +12818,7 @@
...
@@ -12821,7 +12818,7 @@
//add total row
//add total row
rangeUpTable
=
rangeUpTable
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
);
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
);
//add total table if down another format table
//add total table if down another format table
if
(
ws
.
autoFilters
.
_isPartTablePartsUnderRange
(
tablePart
.
Ref
)){
if
(
ws
.
autoFilters
.
_isPartTablePartsUnderRange
(
tablePart
.
Ref
)){
ws
.
workbook
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
AutoFilterChangeFormatTableError
,
ws
.
workbook
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
AutoFilterChangeFormatTableError
,
...
@@ -12858,7 +12855,7 @@
...
@@ -12858,7 +12855,7 @@
if
(
val
===
false
)
{
if
(
val
===
false
)
{
res
=
tablePart
.
Ref
;
res
=
tablePart
.
Ref
;
}
else
{
}
else
{
var
rangeUpTable
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
);
var
rangeUpTable
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
);
if
(
this
.
model
.
autoFilters
.
_isEmptyRange
(
rangeUpTable
,
0
)
&&
this
.
model
.
autoFilters
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
){
if
(
this
.
model
.
autoFilters
.
_isEmptyRange
(
rangeUpTable
,
0
)
&&
this
.
model
.
autoFilters
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
){
res
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
);
res
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
);
}
}
...
@@ -12873,7 +12870,7 @@
...
@@ -12873,7 +12870,7 @@
if
(
val
===
false
)
{
if
(
val
===
false
)
{
res
=
tablePart
.
Ref
;
res
=
tablePart
.
Ref
;
}
else
{
}
else
{
var
rangeUpTable
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
-
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r1
-
1
);
var
rangeUpTable
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
-
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r1
-
1
);
if
(
this
.
model
.
autoFilters
.
_isEmptyRange
(
rangeUpTable
,
0
)
&&
this
.
model
.
autoFilters
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
){
if
(
this
.
model
.
autoFilters
.
_isEmptyRange
(
rangeUpTable
,
0
)
&&
this
.
model
.
autoFilters
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
){
res
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
-
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
);
res
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
-
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
);
}
}
...
@@ -13245,10 +13242,10 @@
...
@@ -13245,10 +13242,10 @@
formatTableInfo
.
isDeleteColumn
=
true
;
formatTableInfo
.
isDeleteColumn
=
true
;
formatTableInfo
.
isDeleteTable
=
true
;
formatTableInfo
.
isDeleteTable
=
true
;
};
};
WorksheetView
.
prototype
.
af_convertTableToRange
=
function
(
tableName
)
{
WorksheetView
.
prototype
.
af_convertTableToRange
=
function
(
tableName
)
{
var
t
=
this
;
var
t
=
this
;
var
callback
=
function
(
isSuccess
)
{
var
callback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
return
;
...
@@ -13256,17 +13253,17 @@
...
@@ -13256,17 +13253,17 @@
History
.
Create_NewPoint
();
History
.
Create_NewPoint
();
History
.
StartTransaction
();
History
.
StartTransaction
();
t
.
model
.
workbook
.
dependencyFormulas
.
lockRecal
();
t
.
model
.
workbook
.
dependencyFormulas
.
lockRecal
();
t
.
model
.
autoFilters
.
convertTableToRange
(
tableName
);
t
.
model
.
autoFilters
.
convertTableToRange
(
tableName
);
t
.
_onUpdateFormatTable
(
tableRange
,
false
,
true
);
t
.
_onUpdateFormatTable
(
tableRange
,
false
,
true
);
t
.
model
.
workbook
.
dependencyFormulas
.
unlockRecal
();
t
.
model
.
workbook
.
dependencyFormulas
.
unlockRecal
();
History
.
EndTransaction
();
History
.
EndTransaction
();
};
};
var
table
=
t
.
model
.
autoFilters
.
_getFilterByDisplayName
(
tableName
);
var
table
=
t
.
model
.
autoFilters
.
_getFilterByDisplayName
(
tableName
);
var
tableRange
=
null
!==
table
?
table
.
Ref
:
null
;
var
tableRange
=
null
!==
table
?
table
.
Ref
:
null
;
...
@@ -13285,7 +13282,7 @@
...
@@ -13285,7 +13282,7 @@
t
.
_isLockedDefNames
(
callBackLockedDefNames
,
defNameId
);
t
.
_isLockedDefNames
(
callBackLockedDefNames
,
defNameId
);
};
};
WorksheetView
.
prototype
.
af_changeTableRange
=
function
(
tableName
,
range
)
{
WorksheetView
.
prototype
.
af_changeTableRange
=
function
(
tableName
,
range
)
{
var
t
=
this
;
var
t
=
this
;
range
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
range
);
range
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
range
);
...
@@ -13415,7 +13412,7 @@
...
@@ -13415,7 +13412,7 @@
yL
*=
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
yL
*=
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
return
{
X
:
xL
,
Y
:
yL
};
return
{
X
:
xL
,
Y
:
yL
};
};
};
//------------------------------------------------------------export---------------------------------------------------
//------------------------------------------------------------export---------------------------------------------------
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
window
[
"
AscCommonExcel
"
].
WorksheetView
=
WorksheetView
;
window
[
"
AscCommonExcel
"
].
WorksheetView
=
WorksheetView
;
...
...
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