summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-03-07 21:53:34 +0200
committerTor Lillqvist <tml@collabora.com>2017-03-08 14:31:15 +0200
commitd94a8044445d57f05f7e927f9046f479d676f4ea (patch)
tree902915d32ad326701c5950d95789cc32b94043a1 /sc
parentb61abf2d3d8638ace8abd08911b06a3ab1478799 (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 (cherry picked from commit 27e34a7dbb9aa2ce52ca529ec835d54c6a5508fc)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xeescher.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 2513fb182408..086b7df40d6b 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1207,7 +1207,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() );