svx: Avoid looking up system clock twice for current datetime

Change-Id: I636ddfdaeac211ddc9de6b5dfe36cbdc32c7f7f2
Reviewed-on: https://gerrit.libreoffice.org/54509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
This commit is contained in:
Takeshi Abe
2018-05-18 12:05:54 +09:00
parent 84efa4087b
commit 027b5a1483

View File

@@ -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;
}