diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-23 11:09:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-24 09:22:52 +0100 |
commit | 13a1a7e1f2851e465898631fc7cc567624cd7dcf (patch) | |
tree | 0df59e4283bb5b29bf64836c8bdd328b41434726 /editeng | |
parent | 025c58f7ea613c2271e43e6639d734e4d478621d (diff) |
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@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/uno/unofield.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
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 ) { |