summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-11 13:35:38 +0200
committerEike Rathke <erack@redhat.com>2015-01-13 15:24:04 +0000
commitc32a5a3b8e2e3a49ac9f1fd3f2872b00612676b7 (patch)
treecb2de3eab8dbbcff359d367177d91b67725e1b69 /sw/source/filter/ww8
parent86db1702d72a103ffeafc69dcaa63318539c147a (diff)
simplify Date/Time/DateTime conversion code
add constructors to Date/DateTime/Time, that take the css::util counterparts, to simplify code converting between these type Change-Id: I4b03da02c63f65b6ec18cb4d6ecc3859bdef1ff7 Reviewed-on: https://gerrit.libreoffice.org/13855 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par.cxx5
2 files changed, 4 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index b724c243da0c..ba34ffe59959 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -394,17 +394,11 @@ static void WriteDop( WW8Export& rWrt )
else
{
::util::DateTime uDT = xDocProps->getCreationDate();
- Date aD(uDT.Day, uDT.Month, uDT.Year);
- tools::Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
- rDop.dttmCreated = sw::ms::DateTime2DTTM(DateTime(aD,aT));
+ rDop.dttmCreated = sw::ms::DateTime2DTTM(DateTime(uDT));
uDT = xDocProps->getModificationDate();
- Date aD2(uDT.Day, uDT.Month, uDT.Year);
- tools::Time aT2(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
- rDop.dttmRevised = sw::ms::DateTime2DTTM(DateTime(aD2,aT2));
+ rDop.dttmRevised = sw::ms::DateTime2DTTM(DateTime(uDT));
uDT = xDocProps->getPrintDate();
- Date aD3(uDT.Day, uDT.Month, uDT.Year);
- tools::Time aT3(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
- rDop.dttmLastPrint = sw::ms::DateTime2DTTM(DateTime(aD3,aT3));
+ rDop.dttmLastPrint = sw::ms::DateTime2DTTM(DateTime(uDT));
}
// Also, the DocStat fields in headers, footers are not calculated correctly.
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d8421d271d20..f3c771fa7c88 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1859,10 +1859,7 @@ void SwWW8ImplReader::ImportDop()
{
DateTime aLastPrinted(
msfilter::util::DTTM2DateTime(pWDop->dttmLastPrint));
- ::util::DateTime uDT(aLastPrinted.GetNanoSec(),
- aLastPrinted.GetSec(), aLastPrinted.GetMin(),
- aLastPrinted.GetHour(), aLastPrinted.GetDay(),
- aLastPrinted.GetMonth(), aLastPrinted.GetYear(), false);
+ ::util::DateTime uDT = aLastPrinted.GetUNODateTime();
xDocuProps->setPrintDate(uDT);
}