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
af3ac6e5
Commit
af3ac6e5
authored
Apr 25, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete argument skipNLCheck
parent
1a300e3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
193 additions
and
199 deletions
+193
-199
cell/view/CellEditorView.js
cell/view/CellEditorView.js
+4
-5
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+189
-194
No files found.
cell/view/CellEditorView.js
View file @
af3ac6e5
...
...
@@ -319,9 +319,9 @@
};
CellEditor
.
prototype
.
close
=
function
(
saveValue
)
{
var
opt
=
this
.
options
,
ret
;
var
opt
=
this
.
options
;
if
(
saveValue
&&
"
function
"
===
typeof
opt
.
saveValueCallback
)
{
if
(
saveValue
)
{
var
isFormula
=
this
.
isFormula
();
// Для формул делаем пересчет всегда. Для остального - только если мы изменили что-то. http://bugzilla.onlyoffice.com/show_bug.cgi?id=31889
// Сюда же добавляется и ячейка с wrap-текстом, у которой выключен wrap.
...
...
@@ -336,8 +336,7 @@
this
.
noUpdateMode
=
false
;
}
ret
=
opt
.
saveValueCallback
(
opt
.
fragments
,
this
.
textFlags
,
/*skip NL check*/
ret
);
if
(
!
ret
)
{
if
(
!
opt
.
saveValueCallback
(
opt
.
fragments
,
this
.
textFlags
))
{
// При ошибке нужно выставить флаг, чтобы по стрелкам не закрывался редактор
this
.
handlers
.
trigger
(
'
setStrictClose
'
,
true
);
return
false
;
...
...
@@ -786,7 +785,7 @@
this
.
options
.
fragments
),
t
=
this
,
ret
=
false
,
range
,
wsOPEN
=
this
.
handlers
.
trigger
(
"
getCellFormulaEnterWSOpen
"
),
ws
=
wsOPEN
?
wsOPEN
.
model
:
this
.
handlers
.
trigger
(
"
getActiveWS
"
);
if
(
s
.
length
<
1
||
s
.
charAt
(
0
)
!==
"
=
"
||
this
.
options
.
cellNumFormat
==
Asc
.
c_oAscNumFormatType
.
Text
)
{
if
(
Asc
.
c_oAscNumFormatType
.
Text
===
this
.
options
.
cellNumFormat
||
s
.
length
<
1
||
s
.
charAt
(
0
)
!==
"
=
"
)
{
return
ret
;
}
...
...
cell/view/WorksheetView.js
View file @
af3ac6e5
...
...
@@ -11261,8 +11261,8 @@
newValue
=
[];
newValue
[
0
]
=
new
AscCommonExcel
.
Fragment
({
text
:
cellValue
,
format
:
v
[
0
].
format
.
clone
()});
if
(
!
t
.
_saveCellValueAfterEdit
(
oCellEdit
,
c
,
newValue
,
/*flags*/
undefined
,
/*
skipNLCheck*/
fals
e
,
/*isNotHistory*/
true
,
/*lockDraw*/
true
))
{
if
(
!
t
.
_saveCellValueAfterEdit
(
oCellEdit
,
c
,
newValue
,
/*flags*/
undefined
,
/*
isNotHistory*/
tru
e
,
/*lockDraw*/
true
))
{
options
.
error
=
true
;
t
.
draw
(
lockDraw
);
return
callback
(
options
);
...
...
@@ -11466,19 +11466,17 @@
return
mergedRange
?
mergedRange
:
new
asc_Range
(
col
,
row
,
col
,
row
);
};
WorksheetView
.
prototype
.
_saveCellValueAfterEdit
=
function
(
oCellEdit
,
c
,
val
,
flags
,
skipNLCheck
,
isNotHistory
,
lockDraw
)
{
WorksheetView
.
prototype
.
_saveCellValueAfterEdit
=
function
(
oCellEdit
,
c
,
val
,
flags
,
isNotHistory
,
lockDraw
)
{
var
t
=
this
;
var
oldMode
=
t
.
isFormulaEditMode
;
t
.
isFormulaEditMode
=
false
;
var
oldMode
=
this
.
isFormulaEditMode
;
this
.
isFormulaEditMode
=
false
;
if
(
!
isNotHistory
)
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
}
var
isFormula
=
t
.
_isFormula
(
val
);
var
isFormula
=
this
.
_isFormula
(
val
);
if
(
isFormula
)
{
var
ftext
=
val
.
reduce
(
function
(
pv
,
cv
)
{
return
pv
+
cv
.
text
;
...
...
@@ -11489,21 +11487,19 @@
ret
=
r
;
});
if
(
!
ret
)
{
t
.
isFormulaEditMode
=
oldMode
;
this
.
isFormulaEditMode
=
oldMode
;
History
.
EndTransaction
();
return
false
;
}
isFormula
=
c
.
isFormula
();
t
.
model
.
autoFilters
.
renameTableColumn
(
oCellEdit
);
this
.
model
.
autoFilters
.
renameTableColumn
(
oCellEdit
);
}
else
{
c
.
setValue2
(
val
);
// Вызываем функцию пересчета для заголовков форматированной таблицы
t
.
model
.
autoFilters
.
renameTableColumn
(
oCellEdit
);
this
.
model
.
autoFilters
.
renameTableColumn
(
oCellEdit
);
}
if
(
!
isFormula
)
{
// Нужно ли выставлять WrapText (ищем символ новой строки в тексте)
if
(
!
skipNLCheck
)
{
for
(
var
i
=
0
;
i
<
val
.
length
;
++
i
)
{
if
(
-
1
!==
val
[
i
].
text
.
indexOf
(
kNewLine
))
{
c
.
setWrap
(
true
);
...
...
@@ -11511,9 +11507,8 @@
}
}
}
}
t
.
_updateCellsRange
(
oCellEdit
,
isNotHistory
?
c_oAscCanChangeColWidth
.
none
:
c_oAscCanChangeColWidth
.
numbers
,
this
.
_updateCellsRange
(
oCellEdit
,
isNotHistory
?
c_oAscCanChangeColWidth
.
none
:
c_oAscCanChangeColWidth
.
numbers
,
lockDraw
);
if
(
!
isNotHistory
)
{
...
...
@@ -11612,15 +11607,15 @@
isClearCell
:
isClearCell
,
isHideCursor
:
isHideCursor
,
isQuickInput
:
isQuickInput
,
isAddPersentFormat
:
isQuickInput
&&
Asc
.
c_oAscNumFormatType
.
Percent
===
c
.
getNumFormat
().
ge
tType
(),
isAddPersentFormat
:
isQuickInput
&&
Asc
.
c_oAscNumFormatType
.
Percent
===
c
.
getNumForma
tType
(),
autoComplete
:
arrAutoComplete
,
autoCompleteLC
:
arrAutoCompleteLC
,
cellName
:
c
.
getName
(),
cellNumFormat
:
c
.
getNumFormatType
(),
saveValueCallback
:
function
(
val
,
flags
,
skipNLCheck
)
{
saveValueCallback
:
function
(
val
,
flags
)
{
var
oCellEdit
=
isMerged
?
new
asc_Range
(
mc
.
c1
,
mc
.
r1
,
mc
.
c1
,
mc
.
r1
)
:
new
asc_Range
(
col
,
row
,
col
,
row
);
return
t
.
_saveCellValueAfterEdit
(
oCellEdit
,
c
,
val
,
flags
,
skipNLCheck
,
/*isNotHistory*/
false
,
return
t
.
_saveCellValueAfterEdit
(
oCellEdit
,
c
,
val
,
flags
,
/*isNotHistory*/
false
,
/*lockDraw*/
false
);
},
getSides
:
function
()
{
...
...
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