@@ -61,6 +61,10 @@ DefinedNames.prototype = {
61
61
}
62
62
} ,
63
63
64
+ remove : function ( locStr , name ) {
65
+ var location = colCache . decodeEx ( locStr ) ;
66
+ this . removeEx ( location , name ) ;
67
+ } ,
64
68
removeEx : function ( location , name ) {
65
69
var matrix = this . getMatrix ( name ) ;
66
70
matrix . removeCellEx ( location ) ;
@@ -132,16 +136,13 @@ DefinedNames.prototype = {
132
136
return dimensions ;
133
137
} ,
134
138
135
- get model ( ) {
139
+ getRanges : function ( name , matrix ) {
136
140
var self = this ;
141
+ matrix = matrix || this . matrixMap [ name ] ;
137
142
138
- // Rethink!
139
- // Have cell-matrix per name! Easy to serialise
140
- // To get names per cell - just iterate over all names finding cells if they exist
141
- return _ . map ( this . matrixMap , function ( matrix , name ) {
142
- // mark and sweep!
143
- matrix . forEach ( function ( cell ) { cell . mark = true ; } ) ;
144
- var ranges = matrix . map ( function ( cell ) {
143
+ // mark and sweep!
144
+ matrix . forEach ( function ( cell ) { cell . mark = true ; } ) ;
145
+ var ranges = matrix . map ( function ( cell ) {
145
146
if ( cell . mark ) {
146
147
var dimensions = self . _explore ( matrix , cell ) ;
147
148
var range = cell . sheetName + '!' + ( dimensions . count > 1 ? dimensions . $range : dimensions . $t$l ) ;
@@ -150,9 +151,16 @@ DefinedNames.prototype = {
150
151
} )
151
152
. filter ( function ( range ) { return range ; } ) ;
152
153
153
- return {
154
- name : name , ranges : ranges
155
- } ;
154
+ return {
155
+ name : name , ranges : ranges
156
+ } ;
157
+ } ,
158
+
159
+ get model ( ) {
160
+ var self = this ;
161
+ // To get names per cell - just iterate over all names finding cells if they exist
162
+ return _ . map ( this . matrixMap , function ( matrix , name ) {
163
+ return self . getRanges ( name , matrix ) ;
156
164
} ) ;
157
165
} ,
158
166
set model ( value ) {
0 commit comments