[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Tue Feb 18 09:29:31 CET 2014


 sc/source/filter/excel/xeescher.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 0d70adef01e50f2b1b27faa8f18294e72406b84d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon Feb 17 05:39:07 2014 +0100

    fix invalid string access, related #i83611#
    
    Change-Id: I5954f78e10d99a064f83e96282c28c086c7f07f1
    Reviewed-on: https://gerrit.libreoffice.org/8096
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index b72b5ed..241182c 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -690,7 +690,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 );
     }
 


More information about the Libreoffice-commits mailing list