diff options
author | Eike Rathke <erack@redhat.com> | 2011-12-01 21:03:42 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-12-01 21:04:29 +0100 |
commit | 86adb5cacb4fe3e7fb869299447da5876f0da30d (patch) | |
tree | f7998dd1a12a82ca53a4fa155cdf5536ac25ef62 /editeng | |
parent | pull in module headers before solver (diff) | |
download | core-86adb5cacb4fe3e7fb869299447da5876f0da30d.tar.gz core-86adb5cacb4fe3e7fb869299447da5876f0da30d.zip |
get rid of class Date and Time default ctor with system time penalty
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/flditem.cxx | 12 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 23 | ||||
-rw-r--r-- | editeng/source/uno/unofield.cxx | 2 |
3 files changed, 22 insertions, 15 deletions
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index eb8b8f5e2205..56b2d71f68fa 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -202,7 +202,7 @@ SV_IMPL_PERSIST1( SvxDateField, SvxFieldData ); SvxDateField::SvxDateField() { - nFixDate = Date().GetDate(); + nFixDate = Date( Date::SYSTEM ).GetDate(); eType = SVXDATETYPE_VAR; eFormat = SVXDATEFORMAT_STDSMALL; } @@ -263,9 +263,11 @@ void SvxDateField::Save( SvPersistStream & rStm ) String SvxDateField::GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLang ) const { - Date aDate; // current date + Date aDate( Date::EMPTY ); if ( eType == SVXDATETYPE_FIX ) aDate.SetDate( nFixDate ); + else + aDate = Date( Date::SYSTEM ); // current date return GetFormatted( aDate, eFormat, rFormatter, eLang ); } @@ -551,7 +553,7 @@ SV_IMPL_PERSIST1( SvxExtTimeField, SvxFieldData ); SvxExtTimeField::SvxExtTimeField() { - nFixTime = Time().GetTime(); + nFixTime = Time( Time::SYSTEM ).GetTime(); eType = SVXTIMETYPE_VAR; eFormat = SVXTIMEFORMAT_STANDARD; } @@ -612,9 +614,11 @@ void SvxExtTimeField::Save( SvPersistStream & rStm ) String SvxExtTimeField::GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLang ) const { - Time aTime; // current time + Time aTime( Time::EMPTY ); if ( eType == SVXTIMETYPE_FIX ) aTime.SetTime( nFixTime ); + else + aTime = Time( Time::SYSTEM ); // current time return GetFormatted( aTime, eFormat, rFormatter, eLang ); } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 1040ba8ed947..f044d6aca16c 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1645,7 +1645,7 @@ sal_Bool SvxAutoCorrect::CreateLanguageFile( LanguageType eLang, sal_Bool bNewFi sShareDirFile( sUserDirFile ); SvxAutoCorrectLanguageListsPtr pLists = 0; - Time nMinTime( 0, 2 ), nAktTime, nLastCheckTime; + Time nMinTime( 0, 2 ), nAktTime( Time::SYSTEM ), nLastCheckTime( Time::EMPTY ); sal_uLong nFndPos; if( TABLE_ENTRY_NOTFOUND != pLastFileTable->SearchKey( sal_uLong( eLang ), &nFndPos ) && @@ -1986,6 +1986,9 @@ SvxAutoCorrectLanguageLists::SvxAutoCorrectLanguageLists( LanguageType eLang) : sShareAutoCorrFile( rShareAutoCorrectFile ), sUserAutoCorrFile( rUserAutoCorrectFile ), + aModifiedDate( Date::EMPTY ), + aModifiedTime( Time::EMPTY ), + aLastCheckTime( Time::EMPTY ), eLanguage(eLang), pCplStt_ExcptLst( 0 ), pWrdStt_ExcptLst( 0 ), @@ -2008,11 +2011,11 @@ sal_Bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp() sal_Bool bRet = sal_False; Time nMinTime( 0, 2 ); - Time nAktTime; + Time nAktTime( Time::SYSTEM ); if( aLastCheckTime > nAktTime || // overflow? ( nAktTime -= aLastCheckTime ) > nMinTime ) // min time past { - Date aTstDate; Time aTstTime; + Date aTstDate( Date::EMPTY ); Time aTstTime( Time::EMPTY ); if( FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aTstDate, &aTstTime ) && ( aModifiedDate != aTstDate || aModifiedTime != aTstTime )) @@ -2027,7 +2030,7 @@ sal_Bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp() delete pAutocorr_List, pAutocorr_List = 0; nFlags &= ~(CplSttLstLoad | WrdSttLstLoad | ChgWordLstLoad ); } - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } return bRet; } @@ -2114,7 +2117,7 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp( // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } } @@ -2230,7 +2233,7 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList() // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); return pAutocorr_List; } @@ -2276,7 +2279,7 @@ sal_Bool SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew) // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } else delete pNew, pNew = 0; @@ -2298,7 +2301,7 @@ sal_Bool SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const String& rNew) // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } else delete pNew, pNew = 0; @@ -2327,7 +2330,7 @@ void SvxAutoCorrectLanguageLists::SaveCplSttExceptList() // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } void SvxAutoCorrectLanguageLists::SetCplSttExceptList( SvStringsISortDtor* pList ) @@ -2364,7 +2367,7 @@ void SvxAutoCorrectLanguageLists::SaveWrdSttExceptList() // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } void SvxAutoCorrectLanguageLists::SetWrdSttExceptList( SvStringsISortDtor* pList ) diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 80b3aa6c2463..1f3cee796ac6 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -339,7 +339,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > xAnchor, co sal_Bool bFixed = ((SvxDateField*)pData)->GetType() == SVXDATETYPE_FIX; mpImpl->maDateTime = getDate( bFixed ? ((SvxDateField*)pData)->GetFixDate() : - Date().GetDate() ); + Date( Date::SYSTEM ).GetDate() ); mpImpl->mnInt32 = ((SvxDateField*)pData)->GetFormat(); mpImpl->mbBoolean1 = bFixed; } |