[Libreoffice-commits] core.git: sd/source

Takeshi Abe tabe at fixedpoint.jp
Sun May 20 02:43:25 UTC 2018


 sd/source/ui/app/sdmod2.cxx          |    5 ++---
 sd/source/ui/dlg/headerfooterdlg.cxx |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 1de2b14b3f736c7a81c68aced6dcdef45b62d4b8
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue May 15 12:31:35 2018 +0900

    sd: Avoid looking up system clock twice for current datetime
    
    Change-Id: I777210723f4c41ee27e2d6497aa466640924d8b5
    Reviewed-on: https://gerrit.libreoffice.org/54348
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 5429a9b69e1a..926bca3600f0 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -407,10 +407,9 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
                     }
                     else
                     {
-                        Date aDate( Date::SYSTEM );
-                        tools::Time aTime( tools::Time::SYSTEM );
+                        DateTime aDateTime( DateTime::SYSTEM );
                         LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
-                        aRepresentation = SvxDateTimeField::GetFormatted( aDate, aTime,
+                        aRepresentation = SvxDateTimeField::GetFormatted( aDateTime, aDateTime,
                                               rSettings.meDateFormat, rSettings.meTimeFormat, *GetNumberFormatter(), eLang );
                     }
                 }
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index 97c343c12375..c12440065220 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -481,13 +481,12 @@ void HeaderFooterTabPage::FillFormatList( sal_Int32 nSelectedPos )
 
     mpCBDateTimeFormat->Clear();
 
-    Date aDate( Date::SYSTEM );
-    tools::Time aTime( tools::Time::SYSTEM );
+    DateTime aDateTime( DateTime::SYSTEM );
 
     for( int nFormat = 0; nFormat < nDateTimeFormatsCount; nFormat++ )
     {
         OUString aStr( SvxDateTimeField::GetFormatted(
-                aDate, aTime,
+                aDateTime, aDateTime,
                 nDateTimeFormats[nFormat].meDateFormat, nDateTimeFormats[nFormat].meTimeFormat,
                 *(SD_MOD()->GetNumberFormatter()), eLanguage ) );
         const sal_Int32 nEntry = mpCBDateTimeFormat->InsertEntry( aStr );


More information about the Libreoffice-commits mailing list