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 /sfx2 | |
parent | b20ea84970fb8b3068880a361822941c47f50edd (diff) |
get rid of class Date and Time default ctor with system time penalty
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/sfxpicklist.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/helper.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/versdlg.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 2 |
11 files changed, 17 insertions, 15 deletions
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 98ac2d66e065..b0169a5a13a5 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -332,7 +332,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) pDocSh->getDocProperties()); if (xDocProps.is()) { xDocProps->setAuthor( SvtUserOptions().GetFullName() ); - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setCreationDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index a76c0fb95513..2e1d79c1ea4a 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -76,7 +76,7 @@ typedef vector< OUString* > StringList_Impl; void AppendDateTime_Impl( const util::DateTime rDT, String& rRow, const LocaleDataWrapper& rWrapper ) { - DateTime aDT; + DateTime aDT( DateTime::EMPTY ); CONVERT_DATETIME( rDT, aDT ); String aDateStr = rWrapper.getDate( aDT ); aDateStr += String::CreateFromAscii( ", " ); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ca68dcf35b34..ac3858cac3ae 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -377,7 +377,7 @@ int SfxDocumentInfoItem::operator==( const SfxPoolItem& rItem) const void SfxDocumentInfoItem::resetUserData(const ::rtl::OUString & i_rAuthor) { setAuthor(i_rAuthor); - DateTime now; + DateTime now( DateTime::SYSTEM ); setCreationDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear() ) ); @@ -884,7 +884,7 @@ IMPL_LINK( SfxDocumentPage, DeleteHdl, PushButton*, EMPTYARG ) if ( bEnableUseUserData && aUseUserDataCB.IsChecked() ) aName = SvtUserOptions().GetFullName(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - DateTime now; + DateTime now( DateTime::SYSTEM ); util::DateTime uDT( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear() ); diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 88c4fa6b6d96..8c5d14ddf686 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -66,6 +66,7 @@ struct SfxVersionInfo SfxVersionInfo(); SfxVersionInfo( const SfxVersionInfo& rInfo ) + : aCreationDate( DateTime::EMPTY ) { *this = rInfo; } SfxVersionInfo& operator=( const SfxVersionInfo &rInfo ) @@ -142,6 +143,7 @@ SfxVersionTableDtor& SfxVersionTableDtor::operator=( const SfxVersionTableDtor& //---------------------------------------------------------------- SfxVersionInfo::SfxVersionInfo() + : aCreationDate( DateTime::EMPTY ) { } @@ -325,7 +327,7 @@ void SfxVersionDialog::Open_Impl() void SfxVersionDialog::RecalcDateColumn() { // recalculate the datetime column width - DateTime aNow; + DateTime aNow( DateTime::SYSTEM ); mpLocaleWrapper = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); String sDateTime = ConvertDateTime_Impl( aNow, *mpLocaleWrapper ); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index cbe1ec9a3865..a46318d36672 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1883,7 +1883,7 @@ SfxDocumentMetaData::resetUserData(const ::rtl::OUString & the_value) bool bModified( false ); bModified |= setMetaText("meta:initial-creator", the_value); - ::DateTime now = DateTime(); + ::DateTime now( ::DateTime::SYSTEM ); css::util::DateTime uDT(now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear()); bModified |= setMetaText("meta:creation-date", dateTimeToText(uDT)); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 097eba93135e..fd2fb1ecfbc7 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -340,7 +340,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) pAntiImpl( pAntiImplP ), nFileVersion( 0 ), pOrigFilter( 0 ), - aExpireTime( Date() + 10, Time() ), + aExpireTime( Date( Date::SYSTEM ) + 10, Time( Time::SYSTEM ) ), pTempFile( NULL ), nLastStorageError( 0 ), m_bRemoveBackup( sal_False ), @@ -2969,7 +2969,7 @@ void SfxMedium::SetExpired_Impl( const DateTime& rDateTime ) sal_Bool SfxMedium::IsExpired() const { - return pImp->aExpireTime.IsValidAndGregorian() && pImp->aExpireTime < DateTime(); + return pImp->aExpireTime.IsValidAndGregorian() && pImp->aExpireTime < DateTime( DateTime::SYSTEM ); } //---------------------------------------------------------------- diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 7c061a76ffd3..9e3a1378de3e 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -206,7 +206,7 @@ void SfxObjectShell::UpdateDocInfoForSave() else { // update ModificationAuthor, revision and editing time - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setModificationDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), @@ -241,7 +241,7 @@ void SfxObjectShell::UpdateTime_Impl( secs/3600, (secs%3600)/60, secs%60, 0); // Initialize some local member! Its neccessary for wollow operations! - DateTime aNow ; // Date and time at current moment + DateTime aNow( DateTime::SYSTEM ); // Date and time at current moment Time n24Time (24,0,0,0) ; // Time-value for 24 hours - see follow calculation sal_uIntPtr nDays = 0 ; // Count of days between now and last editing Time nAddTime (0) ; // Value to add on aOldTime @@ -1009,7 +1009,7 @@ void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const Strin xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) ); xDocProps->setTemplateName( rTemplateName ); - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setTemplateDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 5827defcae7f..a84206d26d52 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1673,7 +1673,7 @@ void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV ) } else if( rKV.GetKey().CompareIgnoreCaseToAscii( "expires" ) == COMPARE_EQUAL ) { - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); if( INetRFC822Message::ParseDateField( rKV.GetValue(), aDateTime ) ) { aDateTime.ConvertToLocalTime(); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index cbaf44347723..db5682fa9d00 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1490,7 +1490,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // if not transferred as a parameter, get it from user settings aInfo.Author = SvtUserOptions().GetFullName(); - DateTime aTime; + DateTime aTime( DateTime::SYSTEM ); aInfo.TimeStamp.Day = aTime.GetDay(); aInfo.TimeStamp.Month = aTime.GetMonth(); aInfo.TimeStamp.Year = aTime.GetYear(); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 1aab3b0f02a0..d4e8b5643304 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -222,7 +222,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,rDocShell( _rDocShell ) ,aMacroMode( *this ) ,pProgress( 0) - ,nTime() + ,nTime( DateTime::EMPTY ) ,nVisualDocumentNumber( USHRT_MAX) ,nDocumentSignatureState( SIGNATURESTATE_UNKNOWN ) ,nScriptingSignatureState( SIGNATURESTATE_UNKNOWN ) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index fd8d3f6c9e14..eec04ce016d3 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -320,7 +320,7 @@ void SfxPrinterController::jobStarted() xDocProps->setPrintedBy( mpObjectShell->IsUseUserData() ? ::rtl::OUString( SvtUserOptions().GetFullName() ) : ::rtl::OUString() ); - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setPrintDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), |