summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2018-05-21 19:01:02 +0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-21 20:42:55 +0200
commit338d5f14ba3e77286c3447fb0bcbf46b0627a35f (patch)
treedcc4fd334bff139e0506b7d0f2ae1fab5b0e8abb /sw
parentaa8ea7d8c29a92b7b866eeb47317f79416db8eb8 (diff)
sw: Ask current datetime only once
Change-Id: I99bed9a09ed1701ce441ddb0a19b5259ab37f135 Reviewed-on: https://gerrit.libreoffice.org/54621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx5
-rw-r--r--sw/source/filter/html/htmlfld.cxx5
2 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index b4b3c0b32d80..9d56929ff792 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -1336,8 +1336,9 @@ void DocumentFieldsManager::SetFixFields( const DateTime* pNewDateTime )
}
else
{
- nDate = Date( Date::SYSTEM ).GetDate();
- nTime = tools::Time( tools::Time::SYSTEM ).GetTime();
+ DateTime aDateTime( DateTime::SYSTEM );
+ nDate = aDateTime.GetDate();
+ nTime = aDateTime.GetTime();
}
SwFieldIds const aTypes[] {
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index 568f36576a84..53a7b1b435ab 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -320,8 +320,9 @@ void SwHTMLParser::NewField()
case SwFieldIds::Time:
{
sal_uInt32 nNumFormat = 0;
- sal_Int64 nTime = tools::Time( tools::Time::SYSTEM ).GetTime();
- sal_Int32 nDate = Date( Date::SYSTEM ).GetDate();
+ DateTime aDateTime( DateTime::SYSTEM );
+ sal_Int64 nTime = aDateTime.GetTime();
+ sal_Int32 nDate = aDateTime.GetDate();
sal_uInt16 nSub = 0;
bool bValidFormat = false;
HTMLNumFormatTableEntry * pFormatTable;