diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-03-07 21:53:34 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-03-08 00:44:01 +0200 |
commit | 27e34a7dbb9aa2ce52ca529ec835d54c6a5508fc (patch) | |
tree | 78ace2e757c1bed7509dd6c6ee14938ff9093307 /sc/source | |
parent | 20a7d4b16d600101f4073ad4ce669a7566bf14c1 (diff) |
Make sure that the 'stAuthor' field of a 'NoteSh' structure filfills the spec
Its length must be greater than or equal to 1 and less than or equal
to 54, so if the author is empty, use a single space, and otherwise
truncate to max 54 characters.
See https://msdn.microsoft.com/en-us/library/dd945371
Change-Id: I7604ae9e1d8eea336b42116ea7d305e183e6ca51
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 3447acb01cb0..6571adc7ba15 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1210,7 +1210,13 @@ XclExpNote::XclExpNote(const XclExpRoot& rRoot, const ScAddress& rScPos, mbRowHidden = (rRoot.GetDoc().RowHidden(maScPos.Row(),maScPos.Tab())); mbColHidden = (rRoot.GetDoc().ColHidden(maScPos.Col(),maScPos.Tab())); } - maAuthor = XclExpString( pScNote->GetAuthor() ); + // stAuthor (variable): An XLUnicodeString that specifies the name of the comment + // author. String length MUST be greater than or equal to 1 and less than or equal + // to 54. + if( pScNote->GetAuthor().isEmpty() ) + maAuthor = XclExpString( " " ); + else + maAuthor = XclExpString( pScNote->GetAuthor(), EXC_STR_DEFAULT, 54 ); } SetRecSize( 9 + maAuthor.GetSize() ); |