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

Takeshi Abe tabe at fixedpoint.jp
Sun May 20 02:53:47 UTC 2018


 svx/source/dialog/ctredlin.cxx |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 027b5a14830c0013ce79877eab66dcf309366ecc
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Fri May 18 12:05:54 2018 +0900

    svx: Avoid looking up system clock twice for current datetime
    
    Change-Id: I636ddfdaeac211ddc9de6b5dfe36cbdc32c7f7f2
    Reviewed-on: https://gerrit.libreoffice.org/54509
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 4d475541fb98..8de682c4933e 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -582,12 +582,11 @@ SvxTPFilter::SvxTPFilter( vcl::Window * pParent)
     RowEnableHdl(m_pCbAction);
     RowEnableHdl(m_pCbComment);
 
-    Date aDate( Date::SYSTEM );
-    tools::Time aTime( tools::Time::SYSTEM );
-    m_pDfDate->SetDate(aDate);
-    m_pTfDate->SetTime(aTime);
-    m_pDfDate2->SetDate(aDate);
-    m_pTfDate2->SetTime(aTime);
+    DateTime aDateTime( DateTime::SYSTEM );
+    m_pDfDate->SetDate(aDateTime);
+    m_pTfDate->SetTime(aDateTime);
+    m_pDfDate2->SetDate(aDateTime);
+    m_pTfDate2->SetTime(aDateTime);
     HideRange();
     ShowAction();
     bModified=false;
@@ -935,17 +934,16 @@ IMPL_LINK( SvxTPFilter, RowEnableHdl, Button*, pButton, void )
 IMPL_LINK( SvxTPFilter, TimeHdl, Button*, pButton, void )
 {
     ImageButton* pIB = static_cast<ImageButton*>(pButton);
-    Date aDate( Date::SYSTEM );
-    tools::Time aTime( tools::Time::SYSTEM );
+    DateTime aDateTime( DateTime::SYSTEM );
     if (pIB == m_pIbClock)
     {
-        m_pDfDate->SetDate(aDate);
-        m_pTfDate->SetTime(aTime);
+        m_pDfDate->SetDate(aDateTime);
+        m_pTfDate->SetTime(aDateTime);
     }
     else if (pIB == m_pIbClock2)
     {
-        m_pDfDate2->SetDate(aDate);
-        m_pTfDate2->SetTime(aTime);
+        m_pDfDate2->SetDate(aDateTime);
+        m_pTfDate2->SetTime(aDateTime);
     }
     bModified=true;
 }


More information about the Libreoffice-commits mailing list