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

Caolán McNamara caolanm at redhat.com
Thu Nov 13 08:28:17 PST 2014


 sc/source/filter/xml/xmlcelli.cxx |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 14609e342936225ddd1fcbd9874672ca36440bfe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 13 10:22:08 2014 +0000

    valgrind: check return of convertDateTime before using fDate
    
    lots of spew in VALGRIND=memcheck make CppunitTest_writerperfect_calc
    
    Change-Id: I8b95e95218beefe19e881c9d055323d0abec49c7
    (cherry picked from commit 3150ae30415c1253258829dd3d39c015e75c6171)
    Reviewed-on: https://gerrit.libreoffice.org/12403
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index d8d409a..182f751 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -935,14 +935,16 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos)
     if( pNote )
     {
         double fDate;
-        rXMLImport.GetMM100UnitConverter().convertDateTime( fDate, mxAnnotationData->maCreateDate );
-        SvNumberFormatter* pNumForm = pDoc->GetFormatTable();
-        sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM );
-        OUString aDate;
-        Color* pColor = 0;
-        Color** ppColor = &pColor;
-        pNumForm->GetOutputString( fDate, nfIndex, aDate, ppColor );
-        pNote->SetDate( aDate );
+        if (rXMLImport.GetMM100UnitConverter().convertDateTime(fDate, mxAnnotationData->maCreateDate))
+        {
+            SvNumberFormatter* pNumForm = pDoc->GetFormatTable();
+            sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM );
+            OUString aDate;
+            Color* pColor = 0;
+            Color** ppColor = &pColor;
+            pNumForm->GetOutputString( fDate, nfIndex, aDate, ppColor );
+            pNote->SetDate( aDate );
+        }
         pNote->SetAuthor( mxAnnotationData->maAuthor );
     }
 


More information about the Libreoffice-commits mailing list