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
cd93bfe2
Commit
cd93bfe2
authored
Apr 04, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change functions af_deleteCellsInTable and af_insertCellsInTable
parent
6c12b72e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
25 deletions
+72
-25
cell/model/autofilters.js
cell/model/autofilters.js
+3
-3
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+69
-22
No files found.
cell/model/autofilters.js
View file @
cd93bfe2
...
...
@@ -2178,7 +2178,7 @@
}
else
{
worksheet
.
getRange3
(
tablePart
.
Ref
.
r2
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
,
tablePart
.
Ref
.
c2
).
addCellsShiftBottom
();
worksheet
.
getRange3
(
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
).
addCellsShiftBottom
();
worksheet
.
_moveRange
(
tablePart
.
Ref
,
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
+
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
));
tablePart
.
changeRef
(
null
,
-
1
,
true
);
...
...
@@ -2203,7 +2203,7 @@
//History.TurnOn();
this
.
_addHistoryObj
({
oldFilter
:
oldFilter
,
newFilterRef
:
tablePart
.
Ref
.
clone
()},
historyitem_AutoFilter_ChangeTableInfo
,
{
activeCells
:
null
,
type
:
optionType
,
val
:
val
,
displayName
:
tableName
});
{
activeCells
:
tablePart
.
Ref
.
clone
()
,
type
:
optionType
,
val
:
val
,
displayName
:
tableName
});
this
.
_cleanStyleTable
(
tablePart
.
Ref
);
this
.
_setColorStyleTable
(
tablePart
.
Ref
,
tablePart
,
null
,
isSetValue
);
...
...
@@ -2348,7 +2348,7 @@
if
(
redoObject
)
{
oHistoryObject
.
activeCells
=
redoObject
.
activeCells
?
redoObject
.
activeCells
.
clone
()
:
null
;
// ToDo Слишком много клонирования, это долгая операция
oHistoryObject
.
activeCells
=
redoObject
.
activeCells
.
clone
()
;
// ToDo Слишком много клонирования, это долгая операция
oHistoryObject
.
styleName
=
redoObject
.
styleName
;
oHistoryObject
.
type
=
redoObject
.
type
;
oHistoryObject
.
cellId
=
redoObject
.
cellId
;
...
...
cell/view/WorksheetView.js
View file @
cd93bfe2
...
...
@@ -8749,7 +8749,7 @@
this
.
handlers
.
trigger
(
"
onErrorEvent
"
,
c_oAscError
.
ID
.
CannotMoveRange
,
c_oAscError
.
Level
.
NoCritical
);
this
.
_cleanSelectionMoveRange
();
}
else
if
(
resmove
===
-
1
)
{
else
if
(
resmove
===
-
1
&&
this
.
af_isCheckMoveRange
(
arnFrom
,
arnTo
)
)
{
var
t
=
this
;
this
.
model
.
workbook
.
handlers
.
trigger
(
"
asc_onConfirmAction
"
,
Asc
.
c_oAscConfirm
.
ConfirmReplaceRange
,
function
(
can
)
{
if
(
can
)
{
...
...
@@ -12861,21 +12861,50 @@
return
false
;
}
var
insertCellsAndShiftDownRight
=
function
(
arn
,
displayName
,
type
)
{
var
range
=
t
.
model
.
getRange3
(
arn
.
r1
,
arn
.
c1
,
arn
.
r2
,
arn
.
c2
);
var
isCheckChangeAutoFilter
=
t
.
af_checkInsDelCells
(
arn
,
type
,
"
insCell
"
);
if
(
isCheckChangeAutoFilter
===
false
)
{
return
;
}
var
callback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
}
History
.
Create_NewPoint
();
History
.
StartTransaction
();
var
shiftCells
=
type
===
c_oAscInsertOptions
.
InsertCellsAndShiftRight
?
range
.
addCellsShiftRight
(
displayName
)
:
range
.
addCellsShiftBottom
(
displayName
);
if
(
shiftCells
)
{
t
.
cellCommentator
.
updateCommentsDependencies
(
true
,
type
,
arn
);
t
.
objectRender
.
updateDrawingObject
(
true
,
type
,
arn
);
t
.
_onUpdateFormatTable
(
range
,
false
,
true
);
}
History
.
EndTransaction
();
};
var
changedRange
=
new
asc_Range
(
arn
.
c1
,
arn
.
r1
,
arn
.
c2
,
gc_nMaxRow0
);
t
.
_isLockedCells
(
changedRange
,
null
,
callback
);
};
var
startCol
=
this
.
activeRange
.
c1
;
var
endCol
=
this
.
activeRange
.
c2
;
var
startRow
=
this
.
activeRange
.
r1
;
var
endRow
=
this
.
activeRange
.
r2
;
var
newActiveRange
=
this
.
activeRange
.
clone
();
var
val
=
null
;
var
displayName
=
null
;
var
type
=
null
;
switch
(
optionType
)
{
case
c_oAscInsertOptions
.
InsertTableRowAbove
:
{
newActiveRange
.
c1
=
tablePart
.
Ref
.
c1
;
newActiveRange
.
c2
=
tablePart
.
Ref
.
c2
;
type
=
c_oAscInsertOptions
.
InsertCellsAndShiftDown
;
val
=
c_oAscInsertOptions
.
InsertCellsAndShiftDown
;
break
;
}
case
c_oAscInsertOptions
.
InsertTableRowBelow
:
...
...
@@ -12884,16 +12913,17 @@
newActiveRange
.
c2
=
tablePart
.
Ref
.
c2
;
newActiveRange
.
r1
=
tablePart
.
Ref
.
r2
+
1
;
newActiveRange
.
r2
=
tablePart
.
Ref
.
r2
+
1
;
displayName
=
tableName
;
type
=
c_oAscInsertOptions
.
InsertCellsAndShiftDown
;
val
=
c_oAscInsertOptions
.
InsertCellsAndShiftDown
;
break
;
}
case
c_oAscInsertOptions
.
InsertTableColLeft
:
{
newActiveRange
.
r1
=
tablePart
.
Ref
.
r1
;
newActiveRange
.
r2
=
tablePart
.
Ref
.
r2
;
type
=
c_oAscInsertOptions
.
InsertCellsAndShiftRight
;
val
=
c_oAscInsertOptions
.
InsertCellsAndShiftRight
;
break
;
}
case
c_oAscInsertOptions
.
InsertTableColRight
:
...
...
@@ -12902,25 +12932,14 @@
newActiveRange
.
c2
=
tablePart
.
Ref
.
c2
+
1
;
newActiveRange
.
r1
=
tablePart
.
Ref
.
r1
;
newActiveRange
.
r2
=
tablePart
.
Ref
.
r2
;
displayName
=
tableName
;
type
=
c_oAscInsertOptions
.
InsertCellsAndShiftRight
;
val
=
c_oAscInsertOptions
.
InsertCellsAndShiftRight
;
break
;
}
}
if
(
val
!==
null
)
{
t
.
activeRange
=
newActiveRange
;
if
(
optionType
===
c_oAscInsertOptions
.
InsertTableColRight
||
optionType
===
c_oAscInsertOptions
.
InsertTableRowBelow
)
{
t
.
changeWorksheet
(
"
insCell
"
,
val
,
tableName
);
}
else
{
t
.
changeWorksheet
(
"
insCell
"
,
val
);
}
t
.
activeRange
=
activeRange
;
}
insertCellsAndShiftDownRight
(
newActiveRange
,
displayName
,
type
)
};
WorksheetView
.
prototype
.
af_deleteCellsInTable
=
function
(
tableName
,
optionType
)
...
...
@@ -12936,6 +12955,36 @@
return
false
;
}
var
deleteCellsAndShiftLeftTop
=
function
(
arn
,
type
)
{
var
range
=
t
.
model
.
getRange3
(
arn
.
r1
,
arn
.
c1
,
arn
.
r2
,
arn
.
c2
);
var
isCheckChangeAutoFilter
=
t
.
af_checkInsDelCells
(
arn
,
type
,
"
delCell
"
);
if
(
isCheckChangeAutoFilter
===
false
)
{
return
;
}
var
callback
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
if
(
isCheckChangeAutoFilter
===
true
)
{
t
.
model
.
autoFilters
.
isEmptyAutoFilters
(
arn
,
type
);
}
var
deleteCells
=
type
===
c_oAscInsertOptions
.
InsertCellsAndShiftRight
?
range
.
deleteCellsShiftLeft
()
:
range
.
deleteCellsShiftUp
();
if
(
deleteCells
)
{
t
.
cellCommentator
.
updateCommentsDependencies
(
true
,
type
,
arn
);
t
.
objectRender
.
updateDrawingObject
(
true
,
type
,
arn
);
t
.
_onUpdateFormatTable
(
range
,
false
,
true
);
}
History
.
EndTransaction
();
};
var
changedRange
=
new
asc_Range
(
arn
.
c1
,
arn
.
r1
,
gc_nMaxCol0
,
arn
.
r2
);
t
.
_isLockedCells
(
changedRange
,
null
,
callback
);
};
var
startCol
=
this
.
activeRange
.
c1
;
var
endCol
=
this
.
activeRange
.
c2
;
var
startRow
=
this
.
activeRange
.
r1
;
...
...
@@ -12970,9 +13019,7 @@
if
(
val
!==
null
)
{
t
.
activeRange
=
newActiveRange
;
t
.
changeWorksheet
(
"
delCell
"
,
val
);
t
.
activeRange
=
acitveRange
;
deleteCellsAndShiftLeftTop
(
newActiveRange
,
val
);
}
};
...
...
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