From 5c2c03e9062d0c86d385a56c3ce1f536944927a2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 9 May 2012 00:14:32 +0200 Subject: Fix fdo#43619 Animating only 2nd level paragraphs hides 1st level --- sd/inc/CustomAnimationEffect.hxx | 4 +++- sd/source/core/CustomAnimationEffect.cxx | 17 ++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'sd') diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx index 5d0c5e54c5a1..860db64d4632 100644 --- a/sd/inc/CustomAnimationEffect.hxx +++ b/sd/inc/CustomAnimationEffect.hxx @@ -271,12 +271,14 @@ private: EffectSequence maEffects; ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > maTarget; + enum { PARA_LEVELS = 5 }; + sal_Int32 mnTextGrouping; sal_Bool mbAnimateForm; sal_Bool mbTextReverse; double mfGroupingAuto; sal_Int32 mnLastPara; - sal_Int8 mnDepthFlags[5]; + sal_Int8 mnDepthFlags[PARA_LEVELS]; sal_Int32 mnGroupId; }; diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index fe4ebdf77d28..ab20da49e456 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -2461,8 +2461,10 @@ void CustomAnimationTextGroup::reset() mfGroupingAuto = -1.0; mnLastPara = -1; // used to check for TextReverse - int i = 5; - while( i-- ) mnDepthFlags[i] = 0; + for (int i = 0; i < PARA_LEVELS; ++i) + { + mnDepthFlags[i] = 0; + } maEffects.clear(); } @@ -2487,8 +2489,8 @@ void CustomAnimationTextGroup::addEffect( CustomAnimationEffectPtr& pEffect ) const sal_Int32 nParaDepth = pEffect->getParaDepth(); - // only look at the first 5 levels - if( nParaDepth < 5 ) + // only look at the first PARA_LEVELS levels + if( nParaDepth < PARA_LEVELS ) { // our first paragraph with this level? if( mnDepthFlags[nParaDepth] == 0 ) @@ -2504,9 +2506,10 @@ void CustomAnimationTextGroup::addEffect( CustomAnimationEffectPtr& pEffect ) if( pEffect->getNodeType() == EffectNodeType::AFTER_PREVIOUS ) mfGroupingAuto = pEffect->getBegin(); - mnTextGrouping = 0; - while( (mnTextGrouping < 5) && (mnDepthFlags[mnTextGrouping] > 0) ) - mnTextGrouping++; + mnTextGrouping = PARA_LEVELS; + while( (mnTextGrouping > 0) + && (mnDepthFlags[mnTextGrouping - 1] <= 0) ) + --mnTextGrouping; } } else -- cgit