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
2161baeb
Commit
2161baeb
authored
Mar 23, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 33457
parent
e560abee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
94 deletions
+110
-94
cell/api.js
cell/api.js
+83
-66
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+3
-3
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+24
-25
No files found.
cell/api.js
View file @
2161baeb
...
...
@@ -1355,84 +1355,101 @@ var editor;
this
.
collaborativeEditing
.
endCollaborationEditing
();
};
// End Load document
spreadsheet_api
.
prototype
.
_openDocumentEndCallback
=
function
()
{
// Не инициализируем дважды
if
(
this
.
DocumentLoadComplete
)
{
return
;
}
// End Load document
spreadsheet_api
.
prototype
.
_openDocumentEndCallback
=
function
()
{
// Не инициализируем дважды
if
(
this
.
DocumentLoadComplete
)
{
return
;
}
this
.
wb
=
new
AscCommonExcel
.
WorkbookView
(
this
.
wbModel
,
this
.
controller
,
this
.
handlers
,
this
.
HtmlElement
,
this
.
topLineEditorElement
,
this
,
this
.
collaborativeEditing
,
this
.
fontRenderingMode
);
this
.
wb
=
new
AscCommonExcel
.
WorkbookView
(
this
.
wbModel
,
this
.
controller
,
this
.
handlers
,
this
.
HtmlElement
,
this
.
topLineEditorElement
,
this
,
this
.
collaborativeEditing
,
this
.
fontRenderingMode
);
if
(
this
.
isMobileVersion
)
{
this
.
wb
.
defaults
.
worksheetView
.
halfSelection
=
true
;
this
.
wb
.
defaults
.
worksheetView
.
activeCellBorderColor
=
new
CColor
(
79
,
158
,
79
);
var
_container
=
document
.
getElementById
(
this
.
HtmlElementName
);
if
(
_container
)
_container
.
style
.
overflow
=
"
hidden
"
;
this
.
wb
.
MobileTouchManager
=
new
AscCommonExcel
.
CMobileTouchManager
({
eventsElement
:
"
cell_mobile_element
"
});
this
.
wb
.
MobileTouchManager
.
Init
(
this
);
if
(
this
.
isMobileVersion
)
{
this
.
wb
.
defaults
.
worksheetView
.
halfSelection
=
true
;
this
.
wb
.
defaults
.
worksheetView
.
activeCellBorderColor
=
new
CColor
(
79
,
158
,
79
);
var
_container
=
document
.
getElementById
(
this
.
HtmlElementName
);
if
(
_container
)
{
_container
.
style
.
overflow
=
"
hidden
"
;
}
this
.
wb
.
MobileTouchManager
=
new
AscCommonExcel
.
CMobileTouchManager
({
eventsElement
:
"
cell_mobile_element
"
});
this
.
wb
.
MobileTouchManager
.
Init
(
this
);
// input context must be created!!!
var
_areaId
=
AscCommon
.
g_inputContext
.
HtmlArea
.
id
;
var
_element
=
document
.
getElementById
(
_areaId
);
_element
.
parentNode
.
parentNode
.
style
.
zIndex
=
10
;
// input context must be created!!!
var
_areaId
=
AscCommon
.
g_inputContext
.
HtmlArea
.
id
;
var
_element
=
document
.
getElementById
(
_areaId
);
_element
.
parentNode
.
parentNode
.
style
.
zIndex
=
10
;
this
.
wb
.
MobileTouchManager
.
initEvents
(
AscCommon
.
g_inputContext
.
HtmlArea
.
id
);
}
this
.
wb
.
MobileTouchManager
.
initEvents
(
AscCommon
.
g_inputContext
.
HtmlArea
.
id
);
}
this
.
DocumentLoadComplete
=
true
;
this
.
DocumentLoadComplete
=
true
;
this
.
asc_CheckGuiControlColors
();
this
.
sendColorThemes
(
this
.
wbModel
.
theme
);
this
.
asc_ApplyColorScheme
(
false
);
this
.
asc_CheckGuiControlColors
();
this
.
sendColorThemes
(
this
.
wbModel
.
theme
);
this
.
asc_ApplyColorScheme
(
false
);
this
.
sendStandartTextures
();
this
.
sendMathToMenu
();
this
.
sendStandartTextures
();
this
.
sendMathToMenu
();
// Применяем пришедшие при открытии изменения
this
.
_applyFirstLoadChanges
();
// Применяем все lock-и (ToDo возможно стоит пересмотреть вообще Lock-и)
for
(
var
i
=
0
;
i
<
this
.
arrPreOpenLocksObjects
.
length
;
++
i
)
{
this
.
arrPreOpenLocksObjects
[
i
]();
}
this
.
arrPreOpenLocksObjects
=
[];
// Применяем пришедшие при открытии изменения
this
.
_applyFirstLoadChanges
();
// Применяем все lock-и (ToDo возможно стоит пересмотреть вообще Lock-и)
for
(
var
i
=
0
;
i
<
this
.
arrPreOpenLocksObjects
.
length
;
++
i
)
{
this
.
arrPreOpenLocksObjects
[
i
]();
}
this
.
arrPreOpenLocksObjects
=
[];
// Меняем тип состояния (на никакое)
this
.
advancedOptionsAction
=
c_oAscAdvancedOptionsAction
.
None
;
// Меняем тип состояния (на никакое)
this
.
advancedOptionsAction
=
c_oAscAdvancedOptionsAction
.
None
;
// Были ошибки при открытии, посылаем предупреждение
if
(
0
<
this
.
wbModel
.
openErrors
.
length
)
{
this
.
sendEvent
(
'
asc_onError
'
,
c_oAscError
.
ID
.
OpenWarning
,
c_oAscError
.
Level
.
NoCritical
);
}
// Были ошибки при открытии, посылаем предупреждение
if
(
0
<
this
.
wbModel
.
openErrors
.
length
)
{
this
.
sendEvent
(
'
asc_onError
'
,
c_oAscError
.
ID
.
OpenWarning
,
c_oAscError
.
Level
.
NoCritical
);
}
//this.asc_Resize(); // Убрал, т.к. сверху приходит resize (http://bugzilla.onlyoffice.com/show_bug.cgi?id=14680)
};
//this.asc_Resize(); // Убрал, т.к. сверху приходит resize (http://bugzilla.onlyoffice.com/show_bug.cgi?id=14680)
};
// Переход на диапазон в листе
spreadsheet_api
.
prototype
.
_asc_setWorksheetRange
=
function
(
val
)
{
// Получаем sheet по имени
var
ws
=
this
.
wbModel
.
getWorksheetByName
(
val
.
asc_getSheet
());
if
(
!
ws
)
{
this
.
handlers
.
trigger
(
"
asc_onHyperlinkClick
"
,
null
);
return
;
}
else
if
(
ws
.
getHidden
())
{
return
;
}
// Индекс листа
var
sheetIndex
=
ws
.
getIndex
();
// Если не совпали индекс листа и индекс текущего, то нужно сменить
if
(
this
.
asc_getActiveWorksheetIndex
()
!==
sheetIndex
)
{
// Меняем активный лист
this
.
asc_showWorksheet
(
sheetIndex
);
// Посылаем эвент о смене активного листа
this
.
handlers
.
trigger
(
"
asc_onActiveSheetChanged
"
,
sheetIndex
);
}
var
range
=
ws
.
getRange2
(
val
.
asc_getRange
());
if
(
null
!==
range
)
{
this
.
wb
.
_onSetSelection
(
range
.
getBBox0
(),
/*validRange*/
true
);
}
};
// Переход на диапазон в листе
spreadsheet_api
.
prototype
.
_asc_setWorksheetRange
=
function
(
val
)
{
// Получаем sheet по имени
var
ranges
=
null
,
ws
;
var
sheet
=
val
.
asc_getSheet
();
if
(
!
sheet
)
{
ranges
=
AscCommonExcel
.
getRangeByRef
(
val
.
asc_getLocation
(),
this
.
wbModel
.
getActiveWs
(),
true
);
if
(
ranges
=
ranges
[
0
])
{
ws
=
ranges
.
worksheet
;
}
}
else
{
ws
=
this
.
wbModel
.
getWorksheetByName
(
sheet
);
}
if
(
!
ws
)
{
this
.
handlers
.
trigger
(
"
asc_onHyperlinkClick
"
,
null
);
return
;
}
else
if
(
ws
.
getHidden
())
{
return
;
}
// Индекс листа
var
sheetIndex
=
ws
.
getIndex
();
// Если не совпали индекс листа и индекс текущего, то нужно сменить
if
(
this
.
asc_getActiveWorksheetIndex
()
!==
sheetIndex
)
{
// Меняем активный лист
this
.
asc_showWorksheet
(
sheetIndex
);
// Посылаем эвент о смене активного листа
this
.
handlers
.
trigger
(
"
asc_onActiveSheetChanged
"
,
sheetIndex
);
}
var
range
;
if
(
ranges
)
{
range
=
ranges
.
bbox
;
}
else
{
range
=
ws
.
getRange2
(
val
.
asc_getRange
());
if
(
range
)
{
range
=
range
.
getBBox0
();
}
}
this
.
wb
.
_onSetSelection
(
range
,
/*validRange*/
true
);
};
spreadsheet_api
.
prototype
.
onSaveCallback
=
function
(
e
)
{
var
t
=
this
;
...
...
cell/model/WorkbookElems.js
View file @
2161baeb
...
...
@@ -2356,7 +2356,7 @@ Hyperlink.prototype = {
this
.
Location
=
Location
;
this
.
LocationSheet
=
this
.
LocationRange
=
null
;
if
(
null
!=
this
.
Location
)
{
if
(
null
!=
=
this
.
Location
)
{
var
result
=
parserHelp
.
parse3DRef
(
this
.
Location
);
if
(
null
!==
result
)
{
this
.
LocationSheet
=
result
.
sheet
;
...
...
@@ -3885,7 +3885,7 @@ function IntervalTreeRBNode(low, high, storedValue){
this
.
maxHigh
=
this
.
high
;
this
.
minLow
=
this
.
key
;
}
IntervalTreeRBNode
.
prototype
=
Object
.
create
(
TreeRBNode
.
prototype
);
IntervalTreeRBNode
.
prototype
=
Object
.
create
(
TreeRBNode
.
prototype
);
IntervalTreeRBNode
.
prototype
.
constructor
=
IntervalTreeRBNode
;
IntervalTreeRBNode
.
prototype
.
isEqual
=
function
(
x
)
{
return
this
.
key
==
x
.
key
&&
this
.
high
==
x
.
high
;
...
...
@@ -4184,7 +4184,7 @@ TreeRB.prototype = {
function
IntervalTreeRB
(){
TreeRB
.
call
(
this
);
}
IntervalTreeRB
.
prototype
=
Object
.
create
(
TreeRB
.
prototype
);
IntervalTreeRB
.
prototype
=
Object
.
create
(
TreeRB
.
prototype
);
IntervalTreeRB
.
prototype
.
constructor
=
IntervalTreeRB
;
IntervalTreeRB
.
prototype
.
_init
=
function
(
x
)
{
this
.
nil
=
new
IntervalTreeRBNode
();
...
...
cell/view/WorksheetView.js
View file @
2161baeb
...
...
@@ -7296,8 +7296,8 @@
}
var
oRes
=
null
;
var
type
=
range
.
type
;
if
(
type
==
c_oAscSelectionType
.
RangeCells
||
type
==
c_oAscSelectionType
.
RangeCol
||
type
==
c_oAscSelectionType
.
RangeRow
||
type
==
c_oAscSelectionType
.
RangeMax
)
{
if
(
type
==
=
c_oAscSelectionType
.
RangeCells
||
type
=
==
c_oAscSelectionType
.
RangeCol
||
type
==
=
c_oAscSelectionType
.
RangeRow
||
type
=
==
c_oAscSelectionType
.
RangeMax
)
{
this
.
cleanSelection
();
this
.
model
.
selectionRange
.
assign2
(
range
);
this
.
_fixSelectionOfMergedCells
();
...
...
@@ -11236,33 +11236,32 @@
this
.
_isLockedCells
(
aReplaceCells
[
options
.
indexInArray
],
/*subType*/
null
,
onReplaceCallback
);
};
WorksheetView
.
prototype
.
findCell
=
function
(
reference
,
isViewMode
)
{
var
mc
,
ranges
=
AscCommonExcel
.
getRangeByRef
(
reference
,
this
.
model
,
true
);
WorksheetView
.
prototype
.
findCell
=
function
(
reference
,
isViewMode
)
{
var
mc
,
ranges
=
AscCommonExcel
.
getRangeByRef
(
reference
,
this
.
model
,
true
);
if
(
0
===
ranges
.
length
&&
!
isViewMode
)
{
if
(
0
===
ranges
.
length
&&
!
isViewMode
)
{
/*TODO: сделать поиск по названиям автофигур, должен искать до того как вызвать поиск по именованным диапазонам*/
if
(
this
.
collaborativeEditing
.
getGlobalLock
()
||
!
this
.
handlers
.
trigger
(
"
getLockDefNameManagerStatus
"
))
{
this
.
handlers
.
trigger
(
"
onErrorEvent
"
,
c_oAscError
.
ID
.
LockCreateDefName
,
c_oAscError
.
Level
.
NoCritical
);
this
.
_updateSelectionNameAndInfo
();
return
true
;
}
if
(
this
.
collaborativeEditing
.
getGlobalLock
()
||
!
this
.
handlers
.
trigger
(
"
getLockDefNameManagerStatus
"
))
{
this
.
handlers
.
trigger
(
"
onErrorEvent
"
,
c_oAscError
.
ID
.
LockCreateDefName
,
c_oAscError
.
Level
.
NoCritical
);
this
.
_updateSelectionNameAndInfo
();
return
true
;
}
// ToDo multiselect defined names
var
selectionLast
=
this
.
model
.
selectionRange
.
getLast
();
mc
=
selectionLast
.
isOneCell
()
?
this
.
model
.
getMergedByCell
(
selectionLast
.
r1
,
selectionLast
.
c1
)
:
null
;
var
defName
=
this
.
model
.
workbook
.
editDefinesNames
(
null
,
new
Asc
.
asc_CDefName
(
reference
,
parserHelp
.
get3DRef
(
this
.
model
.
getName
(),
(
mc
||
selectionLast
).
getAbsName
())));
// ToDo multiselect defined names
var
selectionLast
=
this
.
model
.
selectionRange
.
getLast
();
mc
=
selectionLast
.
isOneCell
()
?
this
.
model
.
getMergedByCell
(
selectionLast
.
r1
,
selectionLast
.
c1
)
:
null
;
var
defName
=
this
.
model
.
workbook
.
editDefinesNames
(
null
,
new
Asc
.
asc_CDefName
(
reference
,
parserHelp
.
get3DRef
(
this
.
model
.
getName
(),
(
mc
||
selectionLast
).
getAbsName
())));
if
(
defName
)
{
this
.
_isLockedDefNames
(
null
,
defName
.
getNodeId
());
}
else
{
this
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
InvalidReferenceOrName
,
c_oAscError
.
Level
.
NoCritical
);
}
}
return
ranges
;
};
if
(
defName
)
{
this
.
_isLockedDefNames
(
null
,
defName
.
getNodeId
());
}
else
{
this
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
InvalidReferenceOrName
,
c_oAscError
.
Level
.
NoCritical
);
}
}
return
ranges
;
};
/* Ищет дополнение для ячейки */
WorksheetView
.
prototype
.
getCellAutoCompleteValues
=
function
(
cell
,
maxCount
)
{
...
...
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