fix valgrind warnings in writerperfect_calc test

f41
Caolán McNamara 10 years ago
parent 16164b63f3
commit 7f779005fc

@ -0,0 +1,42 @@
From 4224a7656915b20819d9eb712160565172567a04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 13 Nov 2014 10:22:08 +0000
Subject: [PATCH] valgrind: check return of convertDateTime before using fDate
Change-Id: I8b95e95218beefe19e881c9d055323d0abec49c7
---
sc/source/filter/xml/xmlcelli.cxx | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 7c2c190..68fb1fe 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 );
}
--
1.9.3

@ -340,6 +340,7 @@ Patch42: 0001-Resolves-rhbz-1161238-sync-PRESOBJ_OUTLINE-para-dept.patch
Patch43: 0001-strip-off-hard-coded-numbering-from-outliner-preview.patch
Patch44: 0001-have-a-stab-at-improving-impossible-question.patch
Patch45: 0001-just-use-ANSI-C-declarations.patch
Patch46: 0001-valgrind-check-return-of-convertDateTime-before-usin.patch
%define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice

Loading…
Cancel
Save