When trimming spaces, skip read-only attributes.
Check for read-only object as well. Thanks, Johann!
Merge pull request #495 from fbarthez/DontTrimReadOnly

When trimming spaces, skip read-only attributes.