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
165597ac
Commit
165597ac
authored
Jun 17, 2016
by
Alexander Trofimov
Committed by
GitHub
Jun 17, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21 from ONLYOFFICE/release/3.8.1
fix bug 32665
parents
696cf608
a69b562c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
40 deletions
+51
-40
cell/api.js
cell/api.js
+7
-4
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+2
-3
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+42
-33
No files found.
cell/api.js
View file @
165597ac
...
...
@@ -1994,12 +1994,15 @@ var editor;
* Делает активной указанную ячейку
* @param {String} reference Ссылка на ячейку вида A1 или R1C1
*/
spreadsheet_api
.
prototype
.
asc_findCell
=
function
(
reference
)
{
if
(
this
.
wb
.
cellEditor
.
isOpened
)
return
;
spreadsheet_api
.
prototype
.
asc_findCell
=
function
(
reference
)
{
if
(
this
.
wb
.
cellEditor
.
isOpened
)
{
return
;
}
var
d
=
this
.
wb
.
findCell
(
reference
);
if
(
!
d
)
{
if
(
!
this
.
isViewMode
)
{
this
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
InvalidReferenceOrName
,
c_oAscError
.
Level
.
NoCritical
);
}
return
;
}
...
...
cell/view/WorkbookView.js
View file @
165597ac
...
...
@@ -2247,14 +2247,13 @@
// Поиск ячейки по ссылке
WorkbookView
.
prototype
.
findCell
=
function
(
reference
)
{
var
ws
=
this
.
getWorksheet
()
,
retRange
;
var
ws
=
this
.
getWorksheet
();
// Останавливаем ввод данных в редакторе ввода
if
(
ws
.
getCellEditMode
())
{
this
.
_onStopCellEditing
();
}
return
ws
.
findCell
(
reference
);
return
ws
.
findCell
(
reference
,
this
.
controller
.
settings
.
isViewerMode
);
};
WorkbookView
.
prototype
.
getDefinedNames
=
function
(
defNameListId
)
{
...
...
cell/view/WorksheetView.js
View file @
165597ac
...
...
@@ -11074,65 +11074,74 @@
return
oneUser
?
onReplaceCallback
(
true
)
:
this
.
_isLockedCells
(
aReplaceCells
[
options
.
indexInArray
],
/*subType*/
null
,
onReplaceCallback
);
};
WorksheetView
.
prototype
.
findCell
=
function
(
reference
)
{
var
range
=
AscCommonExcel
.
g_oRangeCache
.
getRange3D
(
reference
)
||
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
reference
);
if
(
!
range
)
{
/*TODO: сделать поиск по названиям автофигур, должен искать до того как вызвать поиск по именованным диапазонам*/
WorksheetView
.
prototype
.
findCell
=
function
(
reference
,
isViewerMode
)
{
var
range
=
AscCommonExcel
.
g_oRangeCache
.
getRange3D
(
reference
)
||
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
reference
);
if
(
!
range
)
{
if
(
isViewerMode
)
{
return
range
;
}
var
defName
=
this
.
model
.
workbook
.
getDefinesNames
(
reference
,
this
.
model
.
workbook
.
getActiveWs
().
getId
()
),
sheetName
,
ref
;
if
(
!
defName
)
{
if
(
this
.
collaborativeEditing
.
getGlobalLock
()
||
!
this
.
handlers
.
trigger
(
"
getLockDefNameManagerStatus
"
)
)
{
this
.
handlers
.
trigger
(
"
onErrorEvent
"
,
c_oAscError
.
ID
.
LockCreateDefName
,
c_oAscError
.
Level
.
NoCritical
);
/*TODO: сделать поиск по названиям автофигур, должен искать до того как вызвать поиск по именованным диапазонам*/
var
defName
=
this
.
model
.
workbook
.
getDefinesNames
(
reference
,
this
.
model
.
workbook
.
getActiveWs
().
getId
()),
sheetName
,
ref
;
if
(
!
defName
)
{
if
(
this
.
collaborativeEditing
.
getGlobalLock
()
||
!
this
.
handlers
.
trigger
(
"
getLockDefNameManagerStatus
"
))
{
this
.
handlers
.
trigger
(
"
onErrorEvent
"
,
c_oAscError
.
ID
.
LockCreateDefName
,
c_oAscError
.
Level
.
NoCritical
);
this
.
_updateSelectionNameAndInfo
();
return
true
;
}
var
actRange
=
this
.
getActiveRangeObj
(),
ascRange
,
mc
=
this
.
model
.
getMergedByCell
(
actRange
.
startRow
,
actRange
.
startCol
),
c1
=
mc
?
mc
.
c1
:
actRange
.
c1
,
r1
=
mc
?
mc
.
r1
:
actRange
.
r1
,
ar_norm
=
actRange
.
normalize
(),
mc_norm
=
mc
?
mc
.
normalize
()
:
null
,
c2
=
mc_norm
?
(
mc_norm
.
isEqual
(
ar_norm
)
?
mc_norm
.
c1
:
ar_norm
.
c2
)
:
ar_norm
.
c2
,
r2
=
mc_norm
?
(
mc_norm
.
isEqual
(
ar_norm
)
?
mc_norm
.
r1
:
ar_norm
.
r2
)
:
ar_norm
.
r2
;
var
actRange
=
this
.
getActiveRangeObj
(),
ascRange
,
mc
=
this
.
model
.
getMergedByCell
(
actRange
.
startRow
,
actRange
.
startCol
),
c1
=
mc
?
mc
.
c1
:
actRange
.
c1
,
r1
=
mc
?
mc
.
r1
:
actRange
.
r1
,
ar_norm
=
actRange
.
normalize
(),
mc_norm
=
mc
?
mc
.
normalize
()
:
null
,
c2
=
mc_norm
?
(
mc_norm
.
isEqual
(
ar_norm
)
?
mc_norm
.
c1
:
ar_norm
.
c2
)
:
ar_norm
.
c2
,
r2
=
mc_norm
?
(
mc_norm
.
isEqual
(
ar_norm
)
?
mc_norm
.
r1
:
ar_norm
.
r2
)
:
ar_norm
.
r2
;
ascRange
=
new
asc_Range
(
c1
,
r1
,
c2
,
r2
);
defName
=
this
.
model
.
workbook
.
editDefinesNames
(
null
,
new
Asc
.
asc_CDefName
(
reference
,
this
.
model
.
getName
()
+
"
!
"
+
ascRange
.
getAbsName
()
)
);
ascRange
=
new
asc_Range
(
c1
,
r1
,
c2
,
r2
);
defName
=
this
.
model
.
workbook
.
editDefinesNames
(
null
,
new
Asc
.
asc_CDefName
(
reference
,
this
.
model
.
getName
()
+
"
!
"
+
ascRange
.
getAbsName
()));
}
if
(
defName
)
{
if
(
defName
)
{
range
=
true
;
this
.
_isLockedDefNames
(
null
,
defName
.
nodeId
);
this
.
_isLockedDefNames
(
null
,
defName
.
nodeId
);
if
(
defName
.
isTable
)
{
sheetName
=
defName
.
Ref
.
split
(
"
!
"
);
if
(
defName
.
isTable
)
{
sheetName
=
defName
.
Ref
.
split
(
"
!
"
);
ref
=
sheetName
[
1
];
sheetName
=
sheetName
[
0
];
if
(
sheetName
[
0
]
==
"
'
"
&&
sheetName
[
sheetName
.
length
-
1
]
==
"
'
"
)
{
sheetName
=
sheetName
.
substring
(
1
,
sheetName
.
length
-
1
);
if
(
sheetName
[
0
]
==
"
'
"
&&
sheetName
[
sheetName
.
length
-
1
]
==
"
'
"
)
{
sheetName
=
sheetName
.
substring
(
1
,
sheetName
.
length
-
1
);
}
range
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
ref
);
sheetName
=
this
.
model
.
workbook
.
getWorksheetByName
(
sheetName
);
}
else
if
(
defName
.
parsedRef
.
RefPos
.
length
==
1
&&
defName
.
parsedRef
.
outStack
.
length
==
1
)
{
range
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
ref
);
sheetName
=
this
.
model
.
workbook
.
getWorksheetByName
(
sheetName
);
}
else
if
(
defName
.
parsedRef
.
RefPos
.
length
==
1
&&
defName
.
parsedRef
.
outStack
.
length
==
1
)
{
ref
=
defName
.
parsedRef
.
outStack
[
0
];
if
(
ref
.
type
==
AscCommonExcel
.
cElementType
.
cell3D
)
{
range
=
ref
.
range
.
getBBox0
().
clone
(
true
);
if
(
ref
.
type
==
AscCommonExcel
.
cElementType
.
cell3D
)
{
range
=
ref
.
range
.
getBBox0
().
clone
(
true
);
sheetName
=
ref
.
getWS
();
}
else
if
(
ref
.
type
==
AscCommonExcel
.
cElementType
.
cellsRange3D
&&
ref
.
wsFrom
==
ref
.
wsTo
)
{
range
=
ref
.
getRange
()[
0
].
getBBox0
().
clone
(
true
);
sheetName
=
this
.
model
.
workbook
.
getWorksheetById
(
ref
.
wsFrom
);
}
else
if
(
ref
.
type
==
AscCommonExcel
.
cElementType
.
cellsRange3D
&&
ref
.
wsFrom
==
ref
.
wsTo
)
{
range
=
ref
.
getRange
()[
0
].
getBBox0
().
clone
(
true
);
sheetName
=
this
.
model
.
workbook
.
getWorksheetById
(
ref
.
wsFrom
);
}
}
if
(
range
&&
sheetName
)
{
if
(
range
&&
sheetName
)
{
ar_norm
=
range
.
normalize
();
mc
=
sheetName
.
getMergedByCell
(
ar_norm
.
r1
,
ar_norm
.
c1
);
mc
=
sheetName
.
getMergedByCell
(
ar_norm
.
r1
,
ar_norm
.
c1
);
range
=
{
range
:
mc
?
mc
:
range
,
sheet
:
sheetName
.
getName
()};
}
}
}
else
{
var
ar_norm
=
range
.
normalize
(),
mc
=
this
.
model
.
getMergedByCell
(
ar_norm
.
r1
,
ar_norm
.
c1
);
}
else
{
var
ar_norm
=
range
.
normalize
(),
mc
=
this
.
model
.
getMergedByCell
(
ar_norm
.
r1
,
ar_norm
.
c1
);
range
=
{
range
:
mc
?
mc
:
range
,
sheet
:
this
.
model
.
getName
()};
}
return
range
;
// ? this.setSelection(range, true) : null;
return
range
;
};
/* Ищет дополнение для ячейки */
...
...
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