From fc04f76336fdf8c96e35382cdeb497e2f939705c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 28 Sep 2014 15:49:26 +0200 Subject: fdo#82577: Handle Time Put the TOOLS Time class in the tools namespace. Avoids clash with the X11 Time typedef. Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866 Reviewed-on: https://gerrit.libreoffice.org/11684 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- sd/source/filter/html/pubdlg.cxx | 2 +- sd/source/ui/annotations/annotationmanager.cxx | 2 +- sd/source/ui/app/sdmod2.cxx | 2 +- sd/source/ui/app/sdpopup.cxx | 2 +- sd/source/ui/dlg/animobjs.cxx | 24 +++++++++++----------- sd/source/ui/dlg/dlgass.cxx | 4 ++-- sd/source/ui/dlg/headerfooterdlg.cxx | 2 +- sd/source/ui/dlg/present.cxx | 2 +- sd/source/ui/inc/animobjs.hxx | 2 +- sd/source/ui/slideshow/showwin.cxx | 6 +++--- .../ui/slidesorter/view/SlsInsertAnimator.cxx | 2 +- sd/source/ui/tools/TimerBasedTaskExecution.cxx | 4 ++-- sd/source/ui/unoidl/unomodel.cxx | 2 +- sd/source/ui/view/DocumentRenderer.cxx | 2 +- sd/source/ui/view/drviews2.cxx | 2 +- sd/source/ui/view/outlnvs2.cxx | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-) (limited to 'sd/source') diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index e863d906f62a..3383f4c4d498 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -1326,7 +1326,7 @@ void SdPublishingDlg::SetDesign( SdPublishingDesign* pDesign ) pPage2_ChgDefault->Check( !pDesign->m_bAutoSlide ); pPage2_ChgAuto->Check( pDesign->m_bAutoSlide ); - Time aTime( Time::EMPTY ); + tools::Time aTime( tools::Time::EMPTY ); aTime.MakeTimeFromMS( pDesign->m_nSlideDuration * 1000 ); pPage2_Duration->SetTime( aTime ); diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 21c703e7d6a5..e853d6fda758 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -160,7 +160,7 @@ OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotatio else if (aDate.IsValidAndGregorian() ) sRet = rLocalData.getDate(aDate); - Time aTime( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds, aDateTime.NanoSeconds ); + ::tools::Time aTime( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds, aDateTime.NanoSeconds ); if(aTime.GetTime() != 0) sRet = sRet + " " + rLocalData.getTime( aTime,false ); } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index d0ba712f7716..2c83b2d5102e 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -378,7 +378,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) else { Date aDate( Date::SYSTEM ); - Time aTime( Time::SYSTEM ); + tools::Time aTime( tools::Time::SYSTEM ); LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() ); aRepresentation = SvxDateTimeField::GetFormatted( aDate, aTime, (SvxDateFormat)rSettings.meDateTimeFormat, *GetNumberFormatter(), eLang ); } diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index 5f77891592cb..2614ba4f2b95 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -227,7 +227,7 @@ SvxFieldData* SdFieldPopup::GetField() if( (pTimeField->GetType() == SVXTIMETYPE_VAR) && (eType == SVXTIMETYPE_FIX) ) { - Time aTime( Time::SYSTEM ); + tools::Time aTime( tools::Time::SYSTEM ); ( (SvxExtTimeField*) pNewField )->SetFixTime( aTime ); } diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index cb4f70bae1f6..019103ef4efb 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -252,7 +252,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p ) bool bBtnGetOneObjectEnabled = aBtnGetOneObject.IsEnabled(); // calculate overall time - Time aTime( 0 ); + tools::Time aTime( 0 ); long nFullTime; if( aRbtBitmap.IsChecked() ) { @@ -296,7 +296,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p ) if( aRbtBitmap.IsChecked() ) { - Time *const pTime = m_FrameList[i].second; + tools::Time *const pTime = m_FrameList[i].second; assert(pTime); aTimeField.SetTime( *pTime ); @@ -378,7 +378,7 @@ IMPL_LINK( AnimationWindow, ClickRbtHdl, void *, p ) sal_uLong n = static_cast(aNumFldBitmap.GetValue()); if( n > 0 ) { - Time *const pTime = m_FrameList[n - 1].second; + tools::Time *const pTime = m_FrameList[n - 1].second; if( pTime ) aTimeField.SetTime( *pTime ); } @@ -506,7 +506,7 @@ IMPL_LINK_NOARG(AnimationWindow, ModifyTimeHdl) { sal_uLong nPos = static_cast(aNumFldBitmap.GetValue() - 1); - Time *const pTime = m_FrameList[nPos].second; + tools::Time *const pTime = m_FrameList[nPos].second; *pTime = aTimeField.GetTime(); @@ -627,11 +627,11 @@ void AnimationWindow::ResetAttrs() void AnimationWindow::WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime, SfxProgress* pProgress ) const { - clock_t aEnd = Time::GetSystemTicks() + nMilliSeconds; - clock_t aCurrent = Time::GetSystemTicks(); + clock_t aEnd = tools::Time::GetSystemTicks() + nMilliSeconds; + clock_t aCurrent = tools::Time::GetSystemTicks(); while (aCurrent < aEnd) { - aCurrent = Time::GetSystemTicks(); + aCurrent = tools::Time::GetSystemTicks(); if( pProgress ) pProgress->SetState( nTime + nMilliSeconds + aCurrent - aEnd ); @@ -847,7 +847,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) } long nTime = rAnimBmp.nWait; - Time* pTime = new Time( 0, 0, nTime / 100, nTime % 100 ); + ::tools::Time* pTime = new ::tools::Time( 0, 0, nTime / 100, nTime % 100 ); m_FrameList.insert( m_FrameList.begin() + m_nCurrentFrame + 1, ::std::make_pair(pBitmapEx, pTime)); @@ -874,7 +874,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) SdrExchangeView::GetObjGraphic( pSnapShot->GetModel(), pSnapShot).GetBitmapEx() ); - Time* pTime = new Time( aTimeField.GetTime() ); + ::tools::Time* pTime = new ::tools::Time( aTimeField.GetTime() ); m_FrameList.insert( m_FrameList.begin() + m_nCurrentFrame + 1, @@ -895,7 +895,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) BitmapEx *const pBitmapEx = new BitmapEx(rView.GetAllMarkedGraphic().GetBitmapEx()); - Time* pTime = new Time( aTimeField.GetTime() ); + ::tools::Time* pTime = new ::tools::Time( aTimeField.GetTime() ); m_FrameList.insert( m_FrameList.begin() + m_nCurrentFrame + 1, @@ -925,7 +925,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) SdrExchangeView::GetObjGraphic( pObject->GetModel(), pObject).GetBitmapEx() ); - Time* pTime = new Time( aTimeField.GetTime() ); + ::tools::Time* pTime = new ::tools::Time( aTimeField.GetTime() ); m_FrameList.insert( m_FrameList.begin() + m_nCurrentFrame + 1, @@ -1015,7 +1015,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) for (size_t i = 0; i < nCount; ++i) { - Time *const pTime = m_FrameList[i].second; + tools::Time *const pTime = m_FrameList[i].second; long nTime = pTime->GetNanoSec(); nTime += pTime->GetSec() * 100; diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index dfbab91b5147..f822c0960c90 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -521,9 +521,9 @@ AssistentDlgImpl::AssistentDlgImpl( vcl::Window* pWindow, const Link& rFinishLin mpPage3PresTypeLiveRB->SetClickHdl( LINK(this,AssistentDlgImpl, PresTypeHdl )); mpPage3PresTypeKioskRB->SetClickHdl( LINK(this,AssistentDlgImpl, PresTypeHdl )); mpPage3PresTimeTMF->SetFormat( TIMEF_SEC ); - mpPage3PresTimeTMF->SetTime( Time( 0, 0, 10 ) ); + mpPage3PresTimeTMF->SetTime( ::tools::Time( 0, 0, 10 ) ); mpPage3BreakTMF->SetFormat( TIMEF_SEC ); - mpPage3BreakTMF->SetTime( Time( 0, 0, 10 ) ); + mpPage3BreakTMF->SetTime( ::tools::Time( 0, 0, 10 ) ); mpPage3LogoCB->Check(); // set cursor in timefield diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index b3c7a836fe16..4b17fc718543 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -467,7 +467,7 @@ void HeaderFooterTabPage::FillFormatList( int eFormat ) mpCBDateTimeFormat->Clear(); Date aDate( Date::SYSTEM ); - Time aTime( Time::SYSTEM ); + tools::Time aTime( tools::Time::SYSTEM ); int nFormat; for( nFormat = 0; nFormat < nDateTimeFormatsCount; nFormat++ ) diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index a39d7e4a9110..21e1fedf2689 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -127,7 +127,7 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow, const bool bWindow = !( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue(); const long nPause = ( ( const SfxUInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue(); - aTmfPause->SetTime( Time( 0, 0, nPause ) ); + aTmfPause->SetTime( tools::Time( 0, 0, nPause ) ); // set cursor in timefield Edit *pEdit = aTmfPause->GetField(); Selection aSel( pEdit->GetMaxTextLen(), pEdit->GetMaxTextLen() ); diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx index 09d94562604e..9e720ad04260 100644 --- a/sd/source/ui/inc/animobjs.hxx +++ b/sd/source/ui/inc/animobjs.hxx @@ -123,7 +123,7 @@ private: HelpButton aBtnHelp; vcl::Window* pWin; - ::std::vector< ::std::pair > m_FrameList; + ::std::vector< ::std::pair > m_FrameList; static const size_t EMPTY_FRAMELIST = ULONG_MAX; size_t m_nCurrentFrame; SdDrawDocument* pMyDoc; diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index 019d2bb0d0c6..75e6a6cc05eb 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -187,7 +187,7 @@ void ShowWindow::MouseMove(const MouseEvent& /*rMEvt*/) { // if this is not the first mouse move while hidden, see if // enough time has pasted to show mouse pointer again - sal_uLong nTime = Time::GetSystemTicks(); + sal_uLong nTime = ::tools::Time::GetSystemTicks(); if( (nTime - mnFirstMouseMove) >= SHOW_MOUSE_TIMEOUT ) { ShowPointer( true ); @@ -202,7 +202,7 @@ void ShowWindow::MouseMove(const MouseEvent& /*rMEvt*/) // if this is the first mouse move, note current // time and start idle timer to cancel show mouse pointer // again if not enough mouse movement is measured - mnFirstMouseMove = Time::GetSystemTicks(); + mnFirstMouseMove = ::tools::Time::GetSystemTicks(); maMouseTimer.SetTimeout( 2*SHOW_MOUSE_TIMEOUT ); maMouseTimer.Start(); } @@ -516,7 +516,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) const LocaleDataWrapper& aLocaleData = aSysLocale.GetLocaleData(); aText += " ( "; - aText += aLocaleData.getDuration( Time( 0, 0, mnPauseTimeout ) ); + aText += aLocaleData.getDuration( ::tools::Time( 0, 0, mnPauseTimeout ) ); aText += " )"; aVDev.DrawText( Point( aOffset.Width(), 0 ), aText ); DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, aVDev ); diff --git a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx index a873e4e1399e..8b7bd44fad73 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx @@ -82,7 +82,7 @@ public: ::std::vector maStartOffset; /// Target offset of each item in the run at the end of the current animation. ::std::vector maEndOffset; - /// Time at which the current animation started. + /// tools::Time at which the current animation started. double mnStartTime; class Comparator diff --git a/sd/source/ui/tools/TimerBasedTaskExecution.cxx b/sd/source/ui/tools/TimerBasedTaskExecution.cxx index 085cb8e2ecc9..4525b36be635 100644 --- a/sd/source/ui/tools/TimerBasedTaskExecution.cxx +++ b/sd/source/ui/tools/TimerBasedTaskExecution.cxx @@ -115,12 +115,12 @@ IMPL_LINK_NOARG(TimerBasedTaskExecution, TimerCallback) // Execute as many steps as fit into the time span of length // mnMaxTimePerStep. Note that the last step may take longer // than allowed. - sal_uInt32 nStartTime (Time( Time::SYSTEM ).GetMSFromTime()); + sal_uInt32 nStartTime (::tools::Time( ::tools::Time::SYSTEM ).GetMSFromTime()); SAL_INFO("sd.tools", OSL_THIS_FUNC << ": starting TimerBasedTaskExecution at " << nStartTime); do { mpTask->RunNextStep(); - sal_uInt32 nDuration (Time( Time::SYSTEM ).GetMSFromTime()-nStartTime); + sal_uInt32 nDuration (::tools::Time( ::tools::Time::SYSTEM ).GetMSFromTime()-nStartTime); SAL_INFO("sd.tools", OSL_THIS_FUNC << ": executed step in " << nDuration); if (nDuration > mnMaxTimePerStep) break; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 6cf0bcc87ccd..291733159378 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1604,7 +1604,7 @@ void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDF util::DateTime aDateTime( xAnnotation->getDateTime() ); Date aDate( aDateTime.Day, aDateTime.Month, aDateTime.Year ); - Time aTime( Time::EMPTY ); + ::tools::Time aTime( ::tools::Time::EMPTY ); OUString aStr( SvxDateTimeField::GetFormatted( aDate, aTime, SVXDATEFORMAT_B, *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); vcl::PDFNote aNote; diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 2a85683d56da..3e67f53192dd 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1447,7 +1447,7 @@ private: } if (mpOptions->IsTime()) - aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), false, false ); + aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( ::tools::Time( ::tools::Time::SYSTEM ), false, false ); // Draw should use specified paper size when printing, except for booklets if (!mpOptions->IsBooklet() && mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_DRAW) diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index c6e7718021e0..4ac1be5ff2e7 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1893,7 +1893,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_INSERT_FLD_TIME_FIX: pFieldItem.reset(new SvxFieldItem( - SvxExtTimeField( Time( Time::SYSTEM ), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD )); + SvxExtTimeField( ::tools::Time( ::tools::Time::SYSTEM ), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD )); break; case SID_INSERT_FLD_TIME_VAR: diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index ca46d998eaf3..0c8f960749c1 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -503,7 +503,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) case SID_INSERT_FLD_TIME_FIX: pFieldItem.reset(new SvxFieldItem( - SvxExtTimeField( Time( Time::SYSTEM ), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD )); + SvxExtTimeField( ::tools::Time( ::tools::Time::SYSTEM ), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD )); break; case SID_INSERT_FLD_TIME_VAR: -- cgit