[Libreoffice-commits] core.git: editeng/source
Stephan Bergmann
sbergman at redhat.com
Wed Jan 24 08:23:14 UTC 2018
editeng/source/uno/unofield.cxx | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 13a1a7e1f2851e465898631fc7cc567624cd7dcf
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Jan 23 11:09:51 2018 +0100
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 <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
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 )
{
More information about the Libreoffice-commits
mailing list