diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-17 05:39:07 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-17 16:44:12 +0100 |
commit | cd03b4ac54076b5471bfdddd8b3154ecb6b4e7cc (patch) | |
tree | 04ed777fedb9e4cd456a63d21d86e67d442786e1 /sc/source/filter/excel/xeescher.cxx | |
parent | 8a5c8c251fe42f639b029f72244326cdc1b3bb7b (diff) |
fix invalid string access, related #i83611#
Change-Id: I5954f78e10d99a064f83e96282c28c086c7f07f1
Diffstat (limited to 'sc/source/filter/excel/xeescher.cxx')
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 4a9fb82b199a..67ac32542453 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -691,7 +691,10 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< //Export description as alt text if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) ) { - OUString aAltTxt = pSdrObj->GetDescription().copy( 0, MSPROP_DESCRIPTION_MAX_LEN ); + OUString aAltTxt; + OUString aDescrText = pSdrObj->GetDescription(); + if(!aDescrText.isEmpty()) + aAltTxt = aDescrText.copy( 0, std::min<sal_Int32>(MSPROP_DESCRIPTION_MAX_LEN, aDescrText.getLength()) ); aPropOpt.AddOpt( ESCHER_Prop_wzDescription, aAltTxt ); } |