Kaydet (Commit) 1de2b14b authored tarafından Takeshi Abe's avatar Takeshi Abe

sd: Avoid looking up system clock twice for current datetime

Change-Id: I777210723f4c41ee27e2d6497aa466640924d8b5
Reviewed-on: https://gerrit.libreoffice.org/54348Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTakeshi Abe <tabe@fixedpoint.jp>
üst 717af251
......@@ -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 );
}
}
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment