sw/source/core/fields/flddat.cxx |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

New commits:
commit 1c49b677313b94efe17bf8bf8f2952416c2453cc
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Fri Apr 8 21:56:54 2022 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Sat Apr 9 00:56:04 2022 +0200

    Use DateTime(css::util::DateTime&) ctor
    
    Individual fragments set in the given order even raised SAL_WARN
    about non-existing year 0 ...
    
    Change-Id: Iadfc648423b9fc7ec1a9ebfbc05a1ea814078ac2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132742
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index 99d1ca45e728..51246f6eea0e 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -213,14 +213,7 @@ bool SwDateTimeField::PutValue( const uno::Any& rVal, 
sal_uInt16 nWhichId )
             util::DateTime aDateTimeValue;
             if(!(rVal >>= aDateTimeValue))
                 return false;
-            DateTime aDateTime( DateTime::EMPTY );
-            aDateTime.SetNanoSec(aDateTimeValue.NanoSeconds);
-            aDateTime.SetSec(aDateTimeValue.Seconds);
-            aDateTime.SetMin(aDateTimeValue.Minutes);
-            aDateTime.SetHour(aDateTimeValue.Hours);
-            aDateTime.SetDay(aDateTimeValue.Day);
-            aDateTime.SetMonth(aDateTimeValue.Month);
-            aDateTime.SetYear(aDateTimeValue.Year);
+            DateTime aDateTime(aDateTimeValue);
             SetDateTime(aDateTime);
         }
         break;

Reply via email to