@@ -30,7 +30,7 @@ func (f CellFormatterFunc) FormatCell(ctx context.Context, view View, row, col i
3030type PrintfCellFormatter string
3131
3232func (format PrintfCellFormatter ) FormatCell (ctx context.Context , view View , row , col int ) (str string , raw bool , err error ) {
33- return fmt .Sprintf (string (format ), view .AnyValue (row , col )), false , nil
33+ return fmt .Sprintf (string (format ), view .Cell (row , col )), false , nil
3434}
3535
3636// PrintfRawCellFormatter implements CellFormatter by calling
@@ -39,15 +39,15 @@ func (format PrintfCellFormatter) FormatCell(ctx context.Context, view View, row
3939type PrintfRawCellFormatter string
4040
4141func (format PrintfRawCellFormatter ) FormatCell (ctx context.Context , view View , row , col int ) (str string , raw bool , err error ) {
42- return fmt .Sprintf (string (format ), view .AnyValue (row , col )), true , nil
42+ return fmt .Sprintf (string (format ), view .Cell (row , col )), true , nil
4343}
4444
4545// SprintCellFormatter returns a CellFormatter
4646// that formats a cell's value using fmt.Sprint
4747// and returns the result together with the rawResult argument.
4848func SprintCellFormatter (rawResult bool ) CellFormatter {
4949 return CellFormatterFunc (func (ctx context.Context , view View , row , col int ) (string , bool , error ) {
50- return fmt .Sprint (view .AnyValue (row , col )), rawResult , nil
50+ return fmt .Sprint (view .Cell (row , col )), rawResult , nil
5151 })
5252}
5353
@@ -80,7 +80,7 @@ func TryFormattersOrSprint(formatters ...CellFormatter) CellFormatter {
8080
8181 // Fallback for no formatters passed or when
8282 // all formatters returned errors.ErrUnsupported
83- v := view . ReflectValue (row , col )
83+ v := AsReflectCellView ( view ). ReflectCell (row , col )
8484 if IsNullLike (v ) {
8585 return "" , false , nil
8686 }
@@ -106,9 +106,9 @@ func (rawStr RawCellString) FormatCell(ctx context.Context, view View, row, col
106106type LayoutFormatter string
107107
108108func (f LayoutFormatter ) FormatCell (ctx context.Context , view View , row , col int ) (str string , raw bool , err error ) {
109- formatter , ok := view .AnyValue (row , col ).(interface { Format (string ) string })
109+ formatter , ok := view .Cell (row , col ).(interface { Format (string ) string })
110110 if ! ok {
111- return "" , false , fmt .Errorf ("%T does not implement interface{ Format(string) string }" , view .AnyValue (row , col ))
111+ return "" , false , fmt .Errorf ("%T does not implement interface{ Format(string) string }" , view .Cell (row , col ))
112112 }
113113 return formatter .Format (string (f )), false , nil
114114}
@@ -119,7 +119,7 @@ func (f LayoutFormatter) FormatCell(ctx context.Context, view View, row, col int
119119type StringIfTrue string
120120
121121func (f StringIfTrue ) FormatCell (ctx context.Context , view View , row , col int ) (str string , raw bool , err error ) {
122- if view .ReflectValue (row , col ).Bool ( ) {
122+ if view .Cell (row , col ).( bool ) {
123123 return string (f ), false , nil
124124 }
125125 return "" , false , nil
@@ -131,7 +131,7 @@ func (f StringIfTrue) FormatCell(ctx context.Context, view View, row, col int) (
131131type RawStringIfTrue string
132132
133133func (f RawStringIfTrue ) FormatCell (ctx context.Context , view View , row , col int ) (str string , raw bool , err error ) {
134- if view .ReflectValue (row , col ).Bool ( ) {
134+ if view .Cell (row , col ).( bool ) {
135135 return string (f ), true , nil
136136 }
137137 return "" , true , nil
@@ -203,7 +203,7 @@ func ReflectCellFormatterFunc(function any, rawResult bool) (formatter CellForma
203203 args [ctxIndex ] = reflect .ValueOf (ctx )
204204 }
205205 if valIndex != - 1 {
206- args [valIndex ] = view . ReflectValue (row , col )
206+ args [valIndex ] = AsReflectCellView ( view ). ReflectCell (row , col )
207207 }
208208 res := fv .Call (args )
209209 if errIndex != - 1 && ! res [errIndex ].IsNil () {
0 commit comments