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 /sc | |
parent | b20ea84970fb8b3068880a361822941c47f50edd (diff) |
get rid of class Date and Time default ctor with system time penalty
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/chgviset.hxx | 4 | ||||
-rw-r--r-- | sc/inc/externalrefmgr.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/attrib.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/postit.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/stlpool.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/chgviset.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/tool/editutil.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/excel/xlpivot.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/xcl97/XclExpChangeTrack.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xcl97/XclImpChangeTrack.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scendlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/externalrefmgr.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/acredlin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/scuitphfedit.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/preview.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun6.cxx | 4 |
20 files changed, 43 insertions, 28 deletions
diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx index 630128a8be94..6d95abc9f1cf 100644 --- a/sc/inc/chgviset.hxx +++ b/sc/inc/chgviset.hxx @@ -68,7 +68,9 @@ private: public: - ScChangeViewSettings() + ScChangeViewSettings() : + aFirstDateTime( DateTime::EMPTY ), + aLastDateTime( DateTime::EMPTY ) { pCommentSearcher=NULL; bIsDate=false; diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index 80dda704870e..e0f31580773e 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -404,6 +404,8 @@ private: { SfxObjectShellRef maShell; Time maLastAccess; + + SrcShell() : maLastAccess( Time::SYSTEM ) {} }; typedef ::boost::unordered_map<sal_uInt16, SrcShell> DocShellMap; diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 54feede763b9..e6596bb0dec5 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -780,7 +780,7 @@ bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands) while ((nPos = aStr.Search(pCommands[2])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[2].Len() ); - rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel ); + rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel ); lcl_SetSpace(aStr, aSel ); bChange = true; } while ((nPos = aStr.Search(pCommands[3])) != STRING_NOTFOUND) diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index d37a536fc22f..a8881c0f15c6 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -540,7 +540,7 @@ ScPostIt* ScPostIt::Clone( const ScAddress& rOwnPos, ScDocument& rDestDoc, const void ScPostIt::AutoStamp() { - maNoteData.maDate = ScGlobal::pLocaleData->getDate( Date() ); + maNoteData.maDate = ScGlobal::pLocaleData->getDate( Date( Date::SYSTEM ) ); maNoteData.maAuthor = SvtUserOptions().GetID(); } diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index fc558dcbec78..30e6926bd8ae 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -462,7 +462,7 @@ void ScStyleSheetPool::CreateStandardStyles() aStr = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(", ")); pEdEngine->SetText( aStr ); pEdEngine->QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD), ESelection(0,2,0,2) ); - pEdEngine->QuickInsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD), + pEdEngine->QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD), ESelection() ); pTxtObj = pEdEngine->CreateTextObject(); pHeaderItem->SetRightArea( *pTxtObj ); diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index b63e5c6a207b..f04777356202 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -75,6 +75,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionLinkEntry, nMemPoolChangeActionLinkEntry ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScRange& rRange ) : aBigRange( rRange ), + aDateTime( DateTime::SYSTEM ), pNext( NULL ), pPrev( NULL ), pLinkAny( NULL ), @@ -115,6 +116,7 @@ ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScBigRange& rRa const sal_uLong nTempAction) : aBigRange( rRange ), + aDateTime( DateTime::SYSTEM ), pNext( NULL ), pPrev( NULL ), pLinkAny( NULL ), @@ -2051,6 +2053,7 @@ SCROW ScChangeTrack::InitContentRowsPerSlot() ScChangeTrack::ScChangeTrack( ScDocument* pDocP ) : + aFixDateTime( DateTime::SYSTEM ), pDoc( pDocP ) { Init(); @@ -2062,6 +2065,7 @@ ScChangeTrack::ScChangeTrack( ScDocument* pDocP ) : ScChangeTrack::ScChangeTrack( ScDocument* pDocP, const ScStrCollection& aTempUserCollection) : aUserCollection(aTempUserCollection), + aFixDateTime( DateTime::SYSTEM ), pDoc( pDocP ) { Init(); diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index d2aa30580349..5d3f823ac21e 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -43,6 +43,9 @@ ScChangeViewSettings::~ScChangeViewSettings() } ScChangeViewSettings::ScChangeViewSettings( const ScChangeViewSettings& r ) + : + aFirstDateTime( DateTime::EMPTY ), + aLastDateTime( DateTime::EMPTY ) { SetTheComment(r.aComment); @@ -155,7 +158,7 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc ) aFirstDateTime.SetDate( 18990101 ); aFirstDateTime.SetTime( 0 ); } - aLastDateTime = Date(); + aLastDateTime = Date( Date::SYSTEM ); aLastDateTime.SetYear( aLastDateTime.GetYear() + 100 ); } break; diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 75d020a68596..b513cb26a14c 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -631,6 +631,9 @@ String lcl_GetNumStr( sal_Int32 nNo, SvxNumType eType ) } ScHeaderFieldData::ScHeaderFieldData() + : + aDate( Date::EMPTY ), + aTime( Time::EMPTY ) { nPageNo = nTotalPages = 0; eNumType = SVX_ARABIC; diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 5859a1a8df95..388c318b575c 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -111,7 +111,7 @@ void ScInterpreter::ScGetActDate() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetActDate" ); nFuncFmtType = NUMBERFORMAT_DATE; - Date aActDate; + Date aActDate( Date::SYSTEM ); long nDiff = aActDate - *(pFormatter->GetNullDate()); PushDouble((double) nDiff); } @@ -120,9 +120,9 @@ void ScInterpreter::ScGetActTime() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetActTime" ); nFuncFmtType = NUMBERFORMAT_DATETIME; - Date aActDate; + Date aActDate( Date::SYSTEM ); long nDiff = aActDate - *(pFormatter->GetNullDate()); - Time aActTime; + Time aActTime( Time::SYSTEM ); double nTime = ((double)aActTime.Get100Sec() / 100 + (double)(aActTime.GetSec() + (aActTime.GetMin() * 60) + diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx index c6b2980a02e1..7c581c38ab70 100644 --- a/sc/source/filter/excel/xlpivot.cxx +++ b/sc/source/filter/excel/xlpivot.cxx @@ -48,7 +48,8 @@ namespace ScDPGroupBy = ::com::sun::star::sheet::DataPilotFieldGroupBy; // ============================================================================ XclPCItem::XclPCItem() : - meType( EXC_PCITEM_INVALID ) + meType( EXC_PCITEM_INVALID ), + maDateTime( DateTime::EMPTY ) { } diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 5f5687b7daf1..8ffc516812a7 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -1476,7 +1476,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : aRecList.push_back( new XclExpChTr0x0194( *pTempChangeTrack ) ); String sLastUsername; - DateTime aLastDateTime; + DateTime aLastDateTime( DateTime::EMPTY ); sal_uInt32 nIndex = 1; sal_Int32 nLogNumber = 1; while( XclExpChTrAction* pAction = aActionStack.Pop() ) diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index c69ef9590fe8..926c537b5aed 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -318,7 +318,7 @@ void XclImpChangeTrack::ReadChTrInfo() pStrm->Seek( 148 ); if( !pStrm->IsValid() ) return; - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); ReadDateTime( aDateTime ); if( pStrm->IsValid() ) pChangeTrack->SetFixDateTimeLocal( aDateTime ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index bf4d6510ffab..570bb7f1b8f2 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2164,7 +2164,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque util::DateTime aDateTime; if (rChangeProps[i].Value >>= aDateTime) { - DateTime aCoreDateTime; + DateTime aCoreDateTime( DateTime::EMPTY ); ScXMLConverter::ConvertAPIToCoreDateTime(aDateTime, aCoreDateTime); pViewSettings->SetTheFirstDateTime(aCoreDateTime); } @@ -2174,7 +2174,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque util::DateTime aDateTime; if (rChangeProps[i].Value >>= aDateTime) { - DateTime aCoreDateTime; + DateTime aCoreDateTime( DateTime::EMPTY ); ScXMLConverter::ConvertAPIToCoreDateTime(aDateTime, aCoreDateTime); pViewSettings->SetTheLastDateTime(aCoreDateTime); } diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index bb364774fb0b..238c202327a2 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -107,9 +107,9 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ", " )); aComment += String( ScResId( STR_ON ) ); aComment += ' '; - aComment += ScGlobal::GetpLocaleData()->getDate( Date() ); + aComment += ScGlobal::GetpLocaleData()->getDate( Date( Date::SYSTEM ) ); aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ", " )); - aComment += ScGlobal::GetpLocaleData()->getTime( Time() ); + aComment += ScGlobal::GetpLocaleData()->getTime( Time( Time::SYSTEM ) ); aEdComment .SetText( aComment ); aEdName .SetText( rName ); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index a9497a239b31..82272c66d10c 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2123,7 +2123,7 @@ const ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId) // document already loaded. SfxObjectShell* p = itr->second.maShell; - itr->second.maLastAccess = Time(); + itr->second.maLastAccess = Time( Time::SYSTEM ); return static_cast<ScDocShell*>(p)->GetDocument(); } @@ -2604,7 +2604,7 @@ void ScExternalRefManager::purgeStaleSrcDocument(sal_Int32 nTimeOut) for (; itr != itrEnd; ++itr) { // in 100th of a second. - sal_Int32 nSinceLastAccess = (Time() - itr->second.maLastAccess).GetTime(); + sal_Int32 nSinceLastAccess = (Time( Time::SYSTEM ) - itr->second.maLastAccess).GetTime(); if (nSinceLastAccess < nTimeOut) aNewDocShells.insert(*itr); else diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 82e73ae1cdb5..31944f3a048f 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -795,7 +795,6 @@ long ScAcceptChgDlg::PreNotify( NotifyEvent& rNEvt ) void ScAcceptChgDlg::UpdateView() { bNeedsUpdate=false; - DateTime aDateTime; SvLBoxEntry* pParent=NULL; ScChangeTrack* pChanges=NULL; const ScChangeAction* pScChangeAction=NULL; @@ -1464,7 +1463,6 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio { if(pChanges!=NULL) { - DateTime aDateTime; SvLBoxEntry* pParent=NULL; const ScChangeAction* pScChangeAction=NULL; bAcceptEnableFlag=true; diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index e6778209fc70..d688d6d1c50c 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -686,7 +686,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) aConfidentialEntry += ' '; aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL ); aWndLeft.GetEditEngine()->SetText(aConfidentialEntry); - aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); aPageEntry += ' '; aWndRight.GetEditEngine()->SetText(aPageEntry); @@ -792,7 +792,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) aPageEntry += ' '; aWndCenter.GetEditEngine()->SetText(aPageEntry); aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); - aWndRight.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + aWndRight.InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); if(!bTravelling) aWndRight.GrabFocus(); } @@ -807,7 +807,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) aCreatedByEntry += ' '; aCreatedByEntry += (String)aUserOpt.GetLastName(); aWndLeft.GetEditEngine()->SetText(aCreatedByEntry); - aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); aPageEntry += ' '; aWndRight.GetEditEngine()->SetText(aPageEntry); @@ -874,7 +874,7 @@ IMPL_LINK( ScHFEditPage, ClickHdl, ImageButton*, pBtn ) else if ( pBtn == &aBtnLastPage ) pActiveEdWnd->InsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD) ); else if ( pBtn == &aBtnDate ) - pActiveEdWnd->InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + pActiveEdWnd->InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); else if ( pBtn == &aBtnTime ) pActiveEdWnd->InsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD) ); else if ( pBtn == &aBtnFile ) diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 186205cd7409..1c0d37a733dd 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -104,6 +104,8 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView nTab( 0 ), nTabStart( 0 ), nDisplayStart( 0 ), + aDate( Date::SYSTEM ), + aTime( Time::SYSTEM ), nTotalPages( 0 ), pLocationData( NULL ), pDrawView( NULL ), @@ -657,8 +659,8 @@ void ScPreview::DataChanged(bool bNewTime) { if (bNewTime) { - aDate = Date(); - aTime = Time(); + aDate = Date( Date::SYSTEM ); + aTime = Time( Time::SYSTEM ); } bValid = false; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index b6af96afcb27..e6484ceec031 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1035,7 +1035,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) else aFieldData.nTotalPages = nTotalPages; - SetDateTime( Date(), Time() ); + SetDateTime( Date( Date::SYSTEM ), Time( Time::SYSTEM ) ); aFieldData.aTitle = pDocShell->GetTitle(); const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject(); diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 1b7eb4c902f9..0f4736e2df8c 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -293,9 +293,9 @@ void ScViewFunc::InsertCurrentTime(short nCellFmt, const OUString& rUndoStr) ScDocument* pDoc = pDocSh->GetDocument(); ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager(); SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); - Date aActDate; + Date aActDate( Date::SYSTEM ); double fDate = aActDate - *pFormatter->GetNullDate(); - Time aActTime; + Time aActTime( Time::SYSTEM ); double fTime = aActTime.Get100Sec() / 100.0 + aActTime.GetSec() + (aActTime.GetMin() * 60.0) + (aActTime.GetHour() * 3600.0); |