divsbhalala / php-spreadsheetreader

Automatically exported from code.google.com/p/php-spreadsheetreader
Other
0 stars 0 forks source link

trim() is applied indiscriminately to column values #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a value to a cell with a space before or after the value.
2. Process the spreadsheet
3. Observe the output

What is the expected output? What do you see instead?
The expected output is the exact contents of the cell. Actual output is the 
contents of the cell run through the trim() function on line 28 of 
SpreadsheetReader.php:
        return trim((string)$col);

What version of the product are you using? On what operating system?
r27 via anon checkout

Please provide any additional information below.
I understand why this is being done, and although I do not see an immediately 
valid reason for there to be a space padded value in a cell, I would prefer to 
have to strip those on my end which is how I discovered your function in place. 
I am tracking "corrections" which need to be applied to a spreadsheet during 
processing. When adding spaces I noticed that no corrections were being applied 
and thus found that you were doing this already yourself internally.
Because a space in a cell is not an invalid concept, I think they should be 
left for the user of the library to strip if desired, or perhaps have a 
variable that would be set to determine whether the library handled this or not.
As an aside, I have switched from PHPExcel to your library and am very happy to 
have made the change! php-spreadsheetreader is brilliant, thank you!

Original issue reported on code.google.com by g.duerrm...@gmail.com on 22 Nov 2010 at 4:41