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 /sw | |
parent | b20ea84970fb8b3068880a361822941c47f50edd (diff) |
get rid of class Date and Time default ctor with system time penalty
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/doccomp.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docglbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/fields/flddat.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/swg/swblocks.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/inc/fltshell.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/xml/XMLRedlineImportHelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/docvw/SidebarWin.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/docvw/srcedtw.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldmgr.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/inc/gloslst.hxx | 2 |
18 files changed, 54 insertions, 34 deletions
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 41052a68eca0..8f4f56d59ff2 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1399,7 +1399,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo ) // get the Author / TimeStamp from the "other" document info sal_uInt16 nAuthor = rDoc.GetRedlineAuthor(); - DateTime aTimeStamp; + DateTime aTimeStamp( DateTime::SYSTEM ); SwDocShell *pDocShell(rDoc.GetDocShell()); OSL_ENSURE(pDocShell, "no SwDocShell"); if (pDocShell) { diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 91268acd3023..019e1606022e 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1996,8 +1996,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) } else { - nDate = Date().GetDate(); - nTime = Time().GetTime(); + nDate = Date( Date::SYSTEM ).GetDate(); + nTime = Time( Time::SYSTEM ).GetTime(); } sal_uInt16 aTypes[5] = { diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 531efd7b94f1..1be1ccfb3fb1 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -244,7 +244,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, c utl::TempFile aTemp(sLeading,&sExt,&sPath ); aTemp.EnableKillingFile(); - DateTime aTmplDate; + DateTime aTmplDate( DateTime::SYSTEM ); { Time a2Min( 0 ); a2Min.SetMin( 2 ); aTmplDate += a2Min; diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 4eff3d9f2211..d5a609a99977 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2225,8 +2225,8 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) c String aName; if( bAutoNum ) { - long n = Time().GetTime(); - n += Date().GetDate(); + long n = Time( Time::SYSTEM ).GetTime(); + n += Date( Date::SYSTEM ).GetDate(); aName = String::CreateFromInt32( n ); if( pChkStr && !pChkStr->Len() ) pChkStr = 0; @@ -2611,8 +2611,8 @@ namespace listfunc { // #i92478# String aNewListId = String::CreateFromAscii( "list" ); - sal_Int64 n = Time().GetTime(); - n += Date().GetDate(); + sal_Int64 n = Time( Time::SYSTEM ).GetTime(); + n += Date( Date::SYSTEM ).GetDate(); n += rand(); // #i92478# aNewListId += String::CreateFromInt64( n ); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index ff4299500e14..a17510483cd5 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -2987,7 +2987,9 @@ int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) co } SwRedlineData::SwRedlineData( RedlineType_t eT, sal_uInt16 nAut ) - : pNext( 0 ), pExtraData( 0 ), eType( eT ), nAuthor( nAut ), nSeqNo( 0 ) + : pNext( 0 ), pExtraData( 0 ), + aStamp( DateTime::SYSTEM ), + eType( eT ), nAuthor( nAut ), nSeqNo( 0 ) { aStamp.SetSec( 0 ); aStamp.Set100Sec( 0 ); diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx index 86923a9acfb1..22cd105022f1 100644 --- a/sw/source/core/fields/flddat.cxx +++ b/sw/source/core/fields/flddat.cxx @@ -69,7 +69,7 @@ SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub } if (IsFixed()) { - DateTime aDateTime; + DateTime aDateTime( DateTime::SYSTEM ); SetDateTime(aDateTime); } } @@ -80,7 +80,7 @@ String SwDateTimeField::Expand() const if (!(IsFixed())) { - DateTime aDateTime; + DateTime aDateTime( DateTime::SYSTEM ); fVal = GetDateTime(GetDoc(), aDateTime); } else @@ -148,7 +148,7 @@ double SwDateTimeField::GetValue() const if (IsFixed()) return SwValueField::GetValue(); else - return GetDateTime(GetDoc(), DateTime()); + return GetDateTime(GetDoc(), DateTime( DateTime::SYSTEM )); } Date SwDateTimeField::GetDate(sal_Bool bUseOffset) const @@ -248,7 +248,7 @@ bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId ) util::DateTime aDateTimeValue; if(!(rVal >>= aDateTimeValue)) return sal_False; - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); aDateTime.Set100Sec(aDateTimeValue.HundredthSeconds); aDateTime.SetSec(aDateTimeValue.Seconds); aDateTime.SetMin(aDateTimeValue.Minutes); diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index 95a45a14a289..de04be42e9e5 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -101,7 +101,10 @@ short SwImpBlocks::GetFileType( const String& rFile ) SwImpBlocks::SwImpBlocks( const String& rFile, sal_Bool ) - : aFile( rFile ), pDoc( 0 ), nCur( (sal_uInt16)-1 ), + : aFile( rFile ), + aDateModified( Date::EMPTY ), + aTimeModified( Time::EMPTY ), + pDoc( 0 ), nCur( (sal_uInt16)-1 ), bReadOnly( sal_True ), bInPutMuchBlocks( sal_False ) { FStatHelper::GetModifiedDateTimeOfFile( rFile, diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 92c7e1c3f7ea..6b0ddc7ccbe9 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1049,6 +1049,7 @@ struct SwFieldProperties_Impl sal_Bool bBool4; SwFieldProperties_Impl(): + aDate( Date::EMPTY ), fDouble(0.), pDateTime(0), nSubType(0), @@ -1231,7 +1232,7 @@ void SwXTextField::attachToRange( { SwFieldType* pFldType = pDoc->GetSysFldType(RES_POSTITFLD); - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); if (m_pProps->pDateTime) { aDateTime.SetYear(m_pProps->pDateTime->Year); @@ -2233,7 +2234,7 @@ void SwXTextField::update( ) throw (uno::RuntimeException) switch(pFld->Which()) { case RES_DATETIMEFLD: - ((SwDateTimeField*)pFld)->SetDateTime( ::DateTime() ); + ((SwDateTimeField*)pFld)->SetDateTime( ::DateTime( ::DateTime::SYSTEM ) ); break; case RES_EXTUSERFLD: diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 5afbe92a538b..dc5c8a7d9ab6 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -441,7 +441,11 @@ SwReader::SwReader( const uno::Reference < embed::XStorage > &rStg, const String } Reader::Reader() - : pTemplate(0), pStrm(0), pMedium(0), bInsertMode(0), + : pTemplate(0), + aDStamp( Date::EMPTY ), + aTStamp( Time::EMPTY ), + aChkDateTime( DateTime::EMPTY ), + pStrm(0), pMedium(0), bInsertMode(0), bTmplBrowseMode(0), bReadUTF8(0), bBlockMode(0), bOrganizerMode(0), bHasAskTemplateName(0), bIgnoreHTMLComments(0) { @@ -473,15 +477,15 @@ SwDoc* Reader::GetTemplateDoc() INetURLObject aTDir( aTemplateNm ); String aFileName = aTDir.GetMainURL( INetURLObject::NO_DECODE ); OSL_ENSURE( !aTDir.HasError(), "No absolute path for template name!" ); - DateTime aCurrDateTime; + DateTime aCurrDateTime( DateTime::SYSTEM ); sal_Bool bLoad = sal_False; // Wenn das Template schon mal geladen wurde, nur einmal pro // Minute nachschauen, ob es geaendert wurde. if( !pTemplate || aCurrDateTime >= aChkDateTime ) { - Date aTstDate; - Time aTstTime; + Date aTstDate( Date::EMPTY ); + Time aTstTime( Time::EMPTY ); if( FStatHelper::GetModifiedDateTimeOfFile( aTDir.GetMainURL( INetURLObject::NO_DECODE ), &aTstDate, &aTstTime ) && diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 71de0feb0dfd..1c28e7daf65e 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -339,7 +339,7 @@ void SwHTMLParser::NewField() case RES_TIMEFLD: { sal_uLong nNumFmt = 0; - sal_uLong nTime = Time().GetTime(), nDate = Date().GetDate(); + sal_uLong nTime = Time( Time::SYSTEM ).GetTime(), nDate = Date( Date::SYSTEM ).GetDate(); sal_uInt16 nSub = 0; sal_Bool bValidFmt = sal_False; HTMLNumFmtTblEntry * pFmtTbl; @@ -659,7 +659,7 @@ void SwHTMLParser::InsertComment( const String& rComment, const sal_Char *pTag ) SwPostItField aPostItFld( (SwPostItFieldType*)pDoc->GetSysFldType( RES_POSTITFLD ), - aEmptyStr, aComment, DateTime() ); + aEmptyStr, aComment, DateTime( DateTime::SYSTEM ) ); InsertAttr( SwFmtFld( aPostItFld ) ); if( bMoveFwd ) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index b8ddf9d7abb3..3dc5337b49ab 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -5382,7 +5382,7 @@ void SwHTMLParser::ParseMoreMetaOptions() SwPostItField aPostItFld( (SwPostItFieldType*)pDoc->GetSysFldType( RES_POSTITFLD ), - aEmptyStr, sText, DateTime() ); + aEmptyStr, sText, DateTime( DateTime::SYSTEM ) ); SwFmtFld aFmtFld( aPostItFld ); InsertAttr( aFmtFld ); } diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 909900edd948..0533799c410d 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -232,7 +232,9 @@ public: RedlineType_t eTypePrev_ = nsRedlineType_t::REDLINE_INSERT, sal_uInt16 nAutorNoPrev_ = USHRT_MAX, const DateTime* pStampPrev_ = 0) - : SfxPoolItem(RES_FLTR_REDLINE), aStamp(rStamp_), eType(eType_), + : SfxPoolItem(RES_FLTR_REDLINE), aStamp(rStamp_), + aStampPrev( DateTime::EMPTY ), + eType(eType_), eTypePrev(eTypePrev_), nAutorNo(nAutorNo_), nAutorNoPrev(nAutorNoPrev_) { if( pStampPrev_ ) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 1841e719ffd0..2207f37431b5 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1909,6 +1909,8 @@ void WW8_WrPlcFtnEdn::Append( WW8_CP nCp, const SwFmtFtn& rFtn ) } WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) + : + maDateTime( DateTime::EMPTY ) { mpRichText = pPostIt->GetTextObject(); if (!mpRichText) @@ -1917,7 +1919,10 @@ WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) maDateTime = DateTime(pPostIt->GetDate(), pPostIt->GetTime()); } -WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) : mpRichText(0) +WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) + : + mpRichText(0), + maDateTime( DateTime::EMPTY ) { msSimpleText = pRedline->GetComment(); msOwner = SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()); diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 4745b00fae32..49a3110ce462 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -728,7 +728,7 @@ SwRedlineData* XMLRedlineImportHelper::ConvertRedline( pDoc->InsertRedlineAuthor( pRedlineInfo->sAuthor ); // 2) util::DateTime -> DateTime - DateTime aDT; + DateTime aDT( DateTime::EMPTY ); aDT.SetYear( pRedlineInfo->aDateTime.Year ); aDT.SetMonth( pRedlineInfo->aDateTime.Month ); aDT.SetDay( pRedlineInfo->aDateTime.Day ); diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index 311e5bdd1dab..da0f8884c9cd 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -406,12 +406,13 @@ void SwSidebarWin::CheckMetaText() mpMetadataAuthor->SetText(sMeta); } + Date aSysDate( Date::SYSTEM ); Date aDate = GetDate(); - if (aDate==Date()) + if (aDate==aSysDate) { sMeta = String(SW_RES(STR_POSTIT_TODAY)); } - else if (aDate == Date(Date()-1)) + else if (aDate == Date(aSysDate-1)) { sMeta = String(SW_RES(STR_POSTIT_YESTERDAY)); } diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 7b42514b3c68..ec30d62e1ce6 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -538,7 +538,7 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll) IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) { - Time aSyntaxCheckStart; + Time aSyntaxCheckStart( Time::SYSTEM ); SAL_WARN_IF(pTextView == 0, "sw", "No View yet, but syntax highlighting?!"); bHighlighting = sal_True; @@ -562,7 +562,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) nCount++; if(!aSyntaxLineTable.Count()) break; - if((Time().GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) + if((Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) { pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; @@ -580,7 +580,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) p = aSyntaxLineTable.Next(); aSyntaxLineTable.Remove(nCurKey); nCount ++; - if(Time().GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) + if(Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) { pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 750b2c03e158..e67d170870be 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -869,7 +869,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) case TYP_POSTITFLD: { SwPostItFieldType* pType = (SwPostItFieldType*)pCurShell->GetFldType(0, RES_POSTITFLD); - pFld = new SwPostItField(pType, rData.sPar1, rData.sPar2, DateTime()); + pFld = new SwPostItField(pType, rData.sPar1, rData.sPar2, DateTime( DateTime::SYSTEM )); break; } case TYP_SCRIPTFLD: @@ -1716,12 +1716,12 @@ sal_uLong SwFldMgr::GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNum case TYP_TIMEFLD: case TYP_DATEFLD: { - Date aDate; + Date aDate( Date::SYSTEM ); Date* pNullDate = pFormatter->GetNullDate(); fValue = aDate - *pNullDate; - Time aTime; + Time aTime( Time::SYSTEM ); sal_uLong nNumFmtTime = (sal_uLong)aTime.GetSec() + (sal_uLong)aTime.GetMin() * 60L + (sal_uLong)aTime.GetHour() * 3600L; diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx index 84d9c839cfd4..727191d1b068 100644 --- a/sw/source/ui/inc/gloslst.hxx +++ b/sw/source/ui/inc/gloslst.hxx @@ -46,6 +46,8 @@ struct AutoTextGroup String sLongNames; // by 0x0A seperated long names String sShortNames; // by 0x0A seperated short names DateTime aDateModified; + + AutoTextGroup() : aDateModified( DateTime::EMPTY ) {} }; |