diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-01 08:55:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-01 09:37:34 +0200 |
commit | eed94d15a49ad2038a59a3a1bfaa4a66a27ed540 (patch) | |
tree | 534c1c64866ca88dc9172531fa3b2029d3c316bc | |
parent | 61decd49f6491966ec996cad4e39b08b9bb58d91 (diff) |
convert PresChange to scoped enum
Change-Id: I8184e436ae9c0fd2cb78a94b3146ab1903453f72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91459
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sd/inc/diadef.h | 12 | ||||
-rw-r--r-- | sd/sdi/SlideSorterController.sdi | 6 | ||||
-rw-r--r-- | sd/sdi/sdgslots.sdi | 6 | ||||
-rw-r--r-- | sd/sdi/sdslots.sdi | 6 | ||||
-rw-r--r-- | sd/source/core/EffectMigration.cxx | 6 | ||||
-rw-r--r-- | sd/source/core/sdpage.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/animations/SlideTransitionPane.cxx | 10 |
9 files changed, 27 insertions, 29 deletions
diff --git a/sd/inc/diadef.h b/sd/inc/diadef.h index 0da1bd899d35..e09cab69649d 100644 --- a/sd/inc/diadef.h +++ b/sd/inc/diadef.h @@ -20,16 +20,14 @@ #ifndef INCLUDED_SD_INC_DIADEF_H #define INCLUDED_SD_INC_DIADEF_H -enum PresChange +enum class PresChange { - PRESCHANGE_MANUAL = 0, - PRESCHANGE_AUTO = 1, - PRESCHANGE_SEMIAUTO = 2 + Manual = 0, + Auto = 1, + SemiAuto = 2, + LAST = SemiAuto }; -// has to be adjusted -#define PRESCHANGE_COUNT 3 - #endif // INCLUDED_SD_INC_DIADEF_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/sdi/SlideSorterController.sdi b/sd/sdi/SlideSorterController.sdi index e9d1ae77d7b2..8b4f08c63e1f 100644 --- a/sd/sdi/SlideSorterController.sdi +++ b/sd/sdi/SlideSorterController.sdi @@ -52,9 +52,9 @@ enum FadeSpeed enum PresChange { - PRESCHANGE_MANUAL , - PRESCHANGE_AUTO , - PRESCHANGE_SEMIAUTO + PresChange::Manual , + PresChange::Auto , + PresChange::SemiAuto } ; // Items diff --git a/sd/sdi/sdgslots.sdi b/sd/sdi/sdgslots.sdi index f6731011037d..e7c94ab322cd 100644 --- a/sd/sdi/sdgslots.sdi +++ b/sd/sdi/sdgslots.sdi @@ -62,9 +62,9 @@ module StarDraw enum PresChange { - PRESCHANGE_MANUAL, - PRESCHANGE_AUTO, - PRESCHANGE_SEMIAUTO + PresChange::Manual, + PresChange::Auto, + PresChange::SemiAuto }; // Items diff --git a/sd/sdi/sdslots.sdi b/sd/sdi/sdslots.sdi index 204cbfcafa2f..751c09901fa8 100644 --- a/sd/sdi/sdslots.sdi +++ b/sd/sdi/sdslots.sdi @@ -63,9 +63,9 @@ module StarDraw enum PresChange { - PRESCHANGE_MANUAL, - PRESCHANGE_AUTO, - PRESCHANGE_SEMIAUTO + PresChange::Manual, + PresChange::Auto, + PresChange::SemiAuto }; // Items diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 8a62c180d82f..7ca5fcee2c92 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -509,7 +509,7 @@ void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEff CustomAnimationEffectPtr pEffect = std::make_shared<CustomAnimationEffect>( xNode ); pEffect->setTarget( makeAny( xShape ) ); SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() ); - const bool bManual = (pPage == nullptr) || (pPage->GetPresChange() == PRESCHANGE_MANUAL); + const bool bManual = (pPage == nullptr) || (pPage->GetPresChange() == PresChange::Manual); if( !bManual ) pEffect->setNodeType( EffectNodeType::AFTER_PREVIOUS ); @@ -668,7 +668,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect pMainSequence->append( pShapeEffect ); SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() ); - if( pPage && pPage->GetPresChange() != PRESCHANGE_MANUAL ) + if( pPage && pPage->GetPresChange() != PresChange::Manual ) pShapeEffect->setNodeType( EffectNodeType::AFTER_PREVIOUS ); } } @@ -677,7 +677,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect if( pShapeEffect.get() ) { SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() ); - const bool bManual = (pPage == nullptr) || (pPage->GetPresChange() == PRESCHANGE_MANUAL); + const bool bManual = (pPage == nullptr) || (pPage->GetPresChange() == PresChange::Manual); // now create effects for each paragraph pGroup = diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index fc2fcdafe155..7b50a3a9b0f9 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -108,7 +108,7 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage) , mePageKind(PageKind::Standard) , meAutoLayout(AUTOLAYOUT_NONE) , mbSelected(false) -, mePresChange(PRESCHANGE_MANUAL) +, mePresChange(PresChange::Manual) , mfTime(1.0) , mbSoundOn(false) , mbExcluded(false) diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 7e60955b1c41..a2a12503f2f6 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1587,7 +1587,7 @@ bool HtmlExport::CreateHtmlForPresPages() bool bEndless = false; if( !mbAutoSlide ) { - if( pPage->GetPresChange() != PRESCHANGE_MANUAL ) + if( pPage->GetPresChange() != PresChange::Manual ) { fSecs = pPage->GetTime(); bEndless = mpDoc->getPresentationSettings().mbEndless; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 90c515fb1f85..35faad90da2f 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -165,7 +165,7 @@ ImplSdPPTImport::ImplSdPPTImport( SdDrawDocument* pDocument, SotStorage& rStorag , mbDocumentFound(false) , mnFilterOptions(0) , mpDoc(pDocument) - , mePresChange(PRESCHANGE_MANUAL) + , mePresChange(PresChange::Manual) , mnBackgroundObjectsLayerID(0) { if ( !m_bOk ) @@ -902,7 +902,7 @@ bool ImplSdPPTImport::Import() { for ( sal_uInt16 nPage = 0; nPage < nPageCnt; nPage++ ) { - mePresChange = PRESCHANGE_SEMIAUTO; + mePresChange = PresChange::SemiAuto; SetPageNum( nPage ); SdPage* pPage = static_cast<SdPage*>(MakeBlancPage( false )); PptSlidePersistEntry* pMasterPersist = nullptr; @@ -1779,7 +1779,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations if ( nBuildFlags & 0x400 ) // slidechange by time { // time to show (in Ticks) - pPage->SetPresChange( PRESCHANGE_AUTO ); + pPage->SetPresChange( PresChange::Auto ); pPage->SetTime( nSlideTime / 1000.0 ); } else diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index f40c5ad1f849..d8ab5bbdb5d0 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -97,7 +97,7 @@ struct TransitionEffect { mfDuration = 2.0; mfTime = 0.0; - mePresChange = PRESCHANGE_MANUAL; + mePresChange = PresChange::Manual; mbSoundOn = false; mbLoopSound = false; mbStopSound = false; @@ -646,8 +646,8 @@ void SlideTransitionPane::updateControls() } else { - mxRB_ADVANCE_ON_MOUSE->set_active( aEffect.mePresChange == PRESCHANGE_MANUAL ); - mxRB_ADVANCE_AUTO->set_active( aEffect.mePresChange == PRESCHANGE_AUTO ); + mxRB_ADVANCE_ON_MOUSE->set_active( aEffect.mePresChange == PresChange::Manual ); + mxRB_ADVANCE_AUTO->set_active( aEffect.mePresChange == PresChange::Auto ); mxMF_ADVANCE_AUTO_AFTER->set_value(aEffect.mfTime * 100.0, FieldUnit::SECOND); } @@ -830,10 +830,10 @@ impl::TransitionEffect SlideTransitionPane::getTransitionEffectFromControls() co (mxRB_ADVANCE_ON_MOUSE->get_active() || mxRB_ADVANCE_AUTO->get_active())) { if( mxRB_ADVANCE_ON_MOUSE->get_active()) - aResult.mePresChange = PRESCHANGE_MANUAL; + aResult.mePresChange = PresChange::Manual; else { - aResult.mePresChange = PRESCHANGE_AUTO; + aResult.mePresChange = PresChange::Auto; if( mxMF_ADVANCE_AUTO_AFTER->get_sensitive()) { aResult.mfTime = static_cast<double>(mxMF_ADVANCE_AUTO_AFTER->get_value(FieldUnit::SECOND) ) / 100.0 ; |