@@ -4,7 +4,8 @@ mod validate;
44
55use super :: cell_lexer:: { CellLexer , Token , TokenMatch } ;
66use crate :: cell_options:: {
7- BorderSide , BorderStyle , Fill , HorizontalAlign , NumberFormat , TextFormat , VerticalAlign ,
7+ BorderSide , BorderStyle , Fill , HorizontalAlign , NumberFormat , TextFormat , TextWrap ,
8+ VerticalAlign ,
89} ;
910use crate :: error:: { BadInput , ParseResult , Result } ;
1011use crate :: { deprecated_feature, ArcSourceCode , Cell , Rgb , Row } ;
@@ -220,6 +221,16 @@ where
220221 } )
221222 }
222223
224+ fn wrap_option ( & mut self ) -> ParseResult < ( ) > {
225+ let value = TextWrap :: try_from ( self . lexer . take_option_right_side ( ) ?) ?;
226+ if self . is_row_options {
227+ self . row . text_wrap = value;
228+ } else {
229+ self . cell . text_wrap = value;
230+ }
231+ Ok ( ( ) )
232+ }
233+
223234 fn option ( & mut self ) -> ParseResult < ( ) > {
224235 let option_name = self . lexer . take_token ( Token :: OptionName ) ?;
225236 match option_name. str_match . as_str ( ) {
@@ -239,6 +250,7 @@ where
239250 "t" | "text" => self . text_option ( ) ,
240251 "v" | "var" => self . var_option ( ) ,
241252 "va" | "valign" => self . valign_option ( ) ,
253+ "w" | "wrap" => self . wrap_option ( ) ,
242254 _ => Err ( option_name. into_parse_error ( "Expected a valid cell option" ) ) ,
243255 }
244256 }
0 commit comments