2017-09-16 10:25:01 -05:00
|
|
|
// Copyright 2017 Baliance. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by the terms of the Affero GNU General
|
|
|
|
// Public License version 3.0 as published by the Free Software Foundation and
|
|
|
|
// appearing in the file LICENSE included in the packaging of this file. A
|
|
|
|
// commercial license can be purchased by contacting sales@baliance.com.
|
|
|
|
|
|
|
|
package formula
|
|
|
|
|
|
|
|
// InvalidReferenceContext is a Context that can be used when evaluating an
|
|
|
|
// invalid reference (e.g. referencing a non-existent sheet). It implements
|
|
|
|
// Context safely, but returns error results.
|
|
|
|
var InvalidReferenceContext = &ivr{}
|
|
|
|
|
|
|
|
type ivr struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *ivr) Cell(ref string, ev Evaluator) Result {
|
|
|
|
return MakeErrorResult("invalid reference")
|
|
|
|
}
|
|
|
|
|
2017-09-17 12:59:57 -05:00
|
|
|
func (i *ivr) NamedRange(ref string) Reference {
|
|
|
|
return ReferenceInvalid
|
2017-09-16 10:25:01 -05:00
|
|
|
}
|
|
|
|
|
2017-09-17 12:59:57 -05:00
|
|
|
func (i *ivr) Sheet(name string) Context {
|
|
|
|
return i
|
2017-09-16 10:25:01 -05:00
|
|
|
}
|
2017-10-01 19:16:11 -05:00
|
|
|
|
|
|
|
func (i *ivr) SetOffset(col, row uint32) {
|
|
|
|
|
|
|
|
}
|