summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-03-07 21:53:34 +0200
committerAndras Timar <andras.timar@collabora.com>2017-03-26 21:34:57 +0200
commitfb4ab759650e08089c2753a80d8e6ba8266d7970 (patch)
treed1a8d756e9731d86e50b5f2030acb1ad81bff032 /sc
parentc44e25d3c0536c7b963e9102941d42abf1e154b6 (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 1681aabdef08..e0eb7775549b 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1203,7 +1203,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() );