diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-15 10:40:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-16 14:43:25 +0200 |
commit | 2ba9f793c7e80a3bed9aceb3281d55ddc7957f85 (patch) | |
tree | 239f53bb2234516baf41b482293fca06fceff4e3 | |
parent | 70e552065339f1f7ab14f991f3e840b5461e609e (diff) |
convert SvxTimeType to scoped enum
Change-Id: Ic5ca8c50ccd74837cd0521a13e1f5eaa8e326ff3
Reviewed-on: https://gerrit.libreoffice.org/42344
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | editeng/source/accessibility/AccessibleEditableTextPara.cxx | 4 | ||||
-rw-r--r-- | editeng/source/items/flditem.cxx | 6 | ||||
-rw-r--r-- | editeng/source/uno/unofield.cxx | 4 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 2 | ||||
-rw-r--r-- | include/editeng/flditem.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/app/sdpopup.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgfield.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvs2.cxx | 2 |
10 files changed, 23 insertions, 20 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 073547645c08..7357d0681f5a 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -890,9 +890,9 @@ namespace const SvxExtTimeField* pTimeField = static_cast< const SvxExtTimeField* >(ree.pFieldItem->GetField()); if (pTimeField) { - if (pTimeField->GetType() == SVXTIMETYPE_FIX) + if (pTimeField->GetType() == SvxTimeType::Fix) strFldType = "time (fixed)"; - else if (pTimeField->GetType() == SVXTIMETYPE_VAR) + else if (pTimeField->GetType() == SvxTimeType::Var) strFldType = "time (variable)"; } break; diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index d6d2bda1a29b..dab1ad10c484 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -85,7 +85,7 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe bool bIsFixed = false; xPropSet->getPropertyValue(UNO_TC_PROP_IS_FIXED) >>= bIsFixed; - SvxExtTimeField* pData = new SvxExtTimeField(aTime, bIsFixed ? SVXTIMETYPE_FIX : SVXTIMETYPE_VAR); + SvxExtTimeField* pData = new SvxExtTimeField(aTime, bIsFixed ? SvxTimeType::Fix : SvxTimeType::Var); sal_Int32 nNumFmt = -1; xPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= nNumFmt; @@ -594,7 +594,7 @@ SV_IMPL_PERSIST1( SvxExtTimeField ); SvxExtTimeField::SvxExtTimeField() : m_nFixTime( tools::Time(tools::Time::SYSTEM).GetTime() ) { - eType = SVXTIMETYPE_VAR; + eType = SvxTimeType::Var; eFormat = SVXTIMEFORMAT_STANDARD; } @@ -628,7 +628,7 @@ bool SvxExtTimeField::operator==( const SvxFieldData& rOther ) const OUString SvxExtTimeField::GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLang ) const { tools::Time aTime( tools::Time::EMPTY ); - if ( eType == SVXTIMETYPE_FIX ) + if ( eType == SvxTimeType::Fix ) aTime.SetTime(m_nFixTime); else aTime = tools::Time( tools::Time::SYSTEM ); // current time diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 5642daf850e8..e97c3d3c0e0e 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -333,7 +333,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > const & xAn case text::textfield::Type::EXTENDED_TIME: mpImpl->mbBoolean2 = false; mpImpl->maDateTime = getTime( static_cast<const SvxExtTimeField*>(pData)->GetFixTime() ); - mpImpl->mbBoolean1 = static_cast<const SvxExtTimeField*>(pData)->GetType() == SVXTIMETYPE_FIX; + mpImpl->mbBoolean1 = static_cast<const SvxExtTimeField*>(pData)->GetType() == SvxTimeType::Fix; mpImpl->mnInt32 = static_cast<const SvxExtTimeField*>(pData)->GetFormat(); break; @@ -400,7 +400,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() if( mnServiceId != text::textfield::Type::TIME && mnServiceId != text::textfield::Type::DATE ) { tools::Time aTime( setTime( mpImpl->maDateTime ) ); - pData = new SvxExtTimeField( aTime, mpImpl->mbBoolean1?SVXTIMETYPE_FIX:SVXTIMETYPE_VAR ); + pData = new SvxExtTimeField( aTime, mpImpl->mbBoolean1?SvxTimeType::Fix:SvxTimeType::Var ); if( mpImpl->mnInt32 >= SVXTIMEFORMAT_APPDEFAULT && mpImpl->mnInt32 <= SVXTIMEFORMAT_AM_HMSH ) static_cast<SvxExtTimeField*>(pData)->SetFormat( (SvxTimeFormat)mpImpl->mnInt32 ); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 56f482db00dc..8301c8e9b583 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -6459,7 +6459,7 @@ void PPTFieldEntry::SetDateTime( sal_uInt32 nVal ) xField1.reset(new SvxFieldItem(SvxDateField( Date( Date::SYSTEM ), SvxDateType::Var, eDateFormat ), EE_FEATURE_FIELD)); if ( eTimeFormat != SVXTIMEFORMAT_APPDEFAULT ) { - std::unique_ptr<SvxFieldItem> xFieldItem(new SvxFieldItem(SvxExtTimeField( tools::Time( tools::Time::SYSTEM ), SVXTIMETYPE_VAR, eTimeFormat ), EE_FEATURE_FIELD)); + std::unique_ptr<SvxFieldItem> xFieldItem(new SvxFieldItem(SvxExtTimeField( tools::Time( tools::Time::SYSTEM ), SvxTimeType::Var, eTimeFormat ), EE_FEATURE_FIELD)); if (xField1) xField2 = std::move(xFieldItem); else diff --git a/include/editeng/flditem.hxx b/include/editeng/flditem.hxx index d40f8e30766c..feacfafe25c4 100644 --- a/include/editeng/flditem.hxx +++ b/include/editeng/flditem.hxx @@ -240,7 +240,10 @@ public: }; -enum SvxTimeType { SVXTIMETYPE_FIX, SVXTIMETYPE_VAR }; +enum class SvxTimeType { + Fix, + Var +}; enum SvxTimeFormat { SVXTIMEFORMAT_APPDEFAULT = 0, // Set as in App SVXTIMEFORMAT_SYSTEM, // Set as in System SVXTIMEFORMAT_STANDARD, diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index c0d3868d2d57..f2be21935522 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -874,7 +874,7 @@ void ScEditFieldObj::setPropertyValueDateTime(const OUString& rName, const uno:: } else if (rName == SC_UNONAME_ISFIXED) { - SvxTimeType eType = rVal.get<bool>() ? SVXTIMETYPE_FIX : SVXTIMETYPE_VAR; + SvxTimeType eType = rVal.get<bool>() ? SvxTimeType::Fix : SvxTimeType::Var; p->SetType(eType); } else if (rName == SC_UNONAME_DATETIME) @@ -975,7 +975,7 @@ uno::Any ScEditFieldObj::getPropertyValueDateTime(const OUString& rName) return uno::makeAny(false); if (rName == SC_UNONAME_ISFIXED) - return uno::makeAny<sal_Bool>(p->GetType() == SVXTIMETYPE_FIX); + return uno::makeAny<sal_Bool>(p->GetType() == SvxTimeType::Fix); if (rName == SC_UNONAME_DATETIME) { diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index da39b3c0f688..f984570ceedc 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -92,7 +92,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>( pField ); SvxExtTimeField aTimeField( *pTimeField ); - if( pTimeField->GetType() == SVXTIMETYPE_FIX ) + if( pTimeField->GetType() == SvxTimeType::Fix ) CheckItem( 1 ); else CheckItem( 2 ); @@ -207,9 +207,9 @@ SvxFieldData* SdFieldPopup::GetField() sal_uInt16 i; if( IsItemChecked( 1 ) ) - eType = SVXTIMETYPE_FIX; + eType = SvxTimeType::Fix; else - eType = SVXTIMETYPE_VAR; + eType = SvxTimeType::Var; for( i = 3; i <= nCount; i++ ) { @@ -225,7 +225,7 @@ SvxFieldData* SdFieldPopup::GetField() static_cast<SvxExtTimeField*>( pNewField )->SetType( eType ); static_cast<SvxExtTimeField*>( pNewField )->SetFormat( eFormat ); - if( (pTimeField->GetType() == SVXTIMETYPE_VAR) && (eType == SVXTIMETYPE_FIX) ) + if( (pTimeField->GetType() == SvxTimeType::Var) && (eType == SvxTimeType::Fix) ) { tools::Time aTime( tools::Time::SYSTEM ); static_cast<SvxExtTimeField*>( pNewField )->SetFixTime( aTime ); diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index dc7be8b9312e..f87c4393eb7e 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -104,9 +104,9 @@ SvxFieldData* SdModifyFieldDlg::GetField() SvxTimeFormat eFormat; if( m_pRbtFix->IsChecked() ) - eType = SVXTIMETYPE_FIX; + eType = SvxTimeType::Fix; else - eType = SVXTIMETYPE_VAR; + eType = SvxTimeType::Var; eFormat = (SvxTimeFormat) ( m_pLbFormat->GetSelectEntryPos() + 2 ); @@ -274,7 +274,7 @@ void SdModifyFieldDlg::FillControls() const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>(pField); SvxExtTimeField aTimeField( *pTimeField ); - if( pTimeField->GetType() == SVXTIMETYPE_FIX ) + if( pTimeField->GetType() == SvxTimeType::Fix ) m_pRbtFix->Check(); else m_pRbtVar->Check(); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 3b6c3e2d54f1..9804ef62fc33 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1881,7 +1881,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_INSERT_FLD_TIME_FIX: pFieldItem.reset(new SvxFieldItem( - SvxExtTimeField( ::tools::Time( ::tools::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 471931566585..1509e5822201 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -497,7 +497,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) case SID_INSERT_FLD_TIME_FIX: pFieldItem.reset(new SvxFieldItem( - SvxExtTimeField( ::tools::Time( ::tools::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: |