From 7f779005fc1e363301b94a49c45ea30d58d688c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 13 Nov 2014 10:32:46 +0000 Subject: [PATCH] fix valgrind warnings in writerperfect_calc test --- ...eturn-of-convertDateTime-before-usin.patch | 42 +++++++++++++++++++ libreoffice.spec | 1 + 2 files changed, 43 insertions(+) create mode 100644 0001-valgrind-check-return-of-convertDateTime-before-usin.patch diff --git a/0001-valgrind-check-return-of-convertDateTime-before-usin.patch b/0001-valgrind-check-return-of-convertDateTime-before-usin.patch new file mode 100644 index 0000000..5acad14 --- /dev/null +++ b/0001-valgrind-check-return-of-convertDateTime-before-usin.patch @@ -0,0 +1,42 @@ +From 4224a7656915b20819d9eb712160565172567a04 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +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 + diff --git a/libreoffice.spec b/libreoffice.spec index 6b28617..65d371d 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -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