From 88db4aaf0636eb7569272fcccce0fde78cef9873 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Jun 2021 15:47:59 +0200 Subject: avoid maybe-uninitialized in PowerPointShapeExport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /home/noel/libo3/sd/source/filter/eppt/pptx-epptooxml.cxx: In member function ‘oox::drawingml::ShapeExport& oox::core::PowerPointShapeExport::WritePlaceholderReferenceTextBody(oox::core::PlaceholderType, PageType, com::sun::star::uno::Reference)’: /home/noel/libo3/sd/source/filter/eppt/pptx-epptooxml.cxx:1715:31: error: ‘nDateTimeFormat’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1715 | SvxTimeFormat eTime = static_cast(nDateTimeFormat >> 4); | ^~~~~ /home/noel/libo3/sd/source/filter/eppt/pptx-epptooxml.cxx:1707:36: error: ‘bIsDateTimeFixed’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1707 | if(ePageType != LAYOUT && !bIsDateTimeFixed) | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ Change-Id: I7f622321680705fb0b0fa42630949c8d6af8488e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117398 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 3c24e7ed972ae2fc431365e4884e27c0b243c905) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117643 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski --- sd/source/filter/eppt/pptx-epptooxml.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 9299dad777df..31f3710817aa 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1622,12 +1622,12 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody( case DateAndTime: { OUString aDateTimeType = "datetime1"; - bool bIsDateTimeFixed; + bool bIsDateTimeFixed = false; xPagePropSet->getPropertyValue("IsDateTimeFixed") >>= bIsDateTimeFixed; if(ePageType != LAYOUT && !bIsDateTimeFixed) { - sal_Int32 nDateTimeFormat; + sal_Int32 nDateTimeFormat = 0; xPagePropSet->getPropertyValue("DateTimeFormat") >>= nDateTimeFormat; // 4 LSBs represent the date -- cgit v1.2.3