From 13a1a7e1f2851e465898631fc7cc567624cd7dcf Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 23 Jan 2018 11:09:51 +0100 Subject: Avoid upcoming GCC 8 -Werror=class-memaccess on css::util::DateTime ...whose ctor already zero-initializes all members, so the first two memsets are unnecessary. And spell the third memset as explicit assignments. Change-Id: Ie5079711b152bac7f0a8d52d7889879157a35b5d Reviewed-on: https://gerrit.libreoffice.org/48390 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- editeng/source/uno/unofield.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'editeng') diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 7cac637b05f5..29b84fd2833b 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -192,7 +192,6 @@ static SvxFileFormat setFileNameDisplayFormat( sal_Int16 nFormat ) static util::DateTime getDate( sal_Int32 nDate ) { util::DateTime aDate; - memset( &aDate, 0, sizeof( util::DateTime ) ); Date aTempDate( nDate ); @@ -211,7 +210,6 @@ inline Date setDate( util::DateTime const & rDate ) static util::DateTime getTime(sal_Int64 const nTime) { util::DateTime aTime; - memset( &aTime, 0, sizeof( util::DateTime ) ); tools::Time aTempTime( nTime ); @@ -259,7 +257,14 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw() { mpPropSet = ImplGetFieldItemPropertySet(mnServiceId); - memset( &(mpImpl->maDateTime), 0, sizeof( util::DateTime ) ); + mpImpl->maDateTime.NanoSeconds = 0; + mpImpl->maDateTime.Seconds = 0; + mpImpl->maDateTime.Minutes = 0; + mpImpl->maDateTime.Hours = 0; + mpImpl->maDateTime.Day = 0; + mpImpl->maDateTime.Month = 0; + mpImpl->maDateTime.Year = 0; + mpImpl->maDateTime.IsUTC = false; switch( nServiceId ) { -- cgit