summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-05-09 00:14:32 +0200
committerThorsten Behrens <tbehrens@suse.com>2012-05-09 00:15:25 +0200
commit5c2c03e9062d0c86d385a56c3ce1f536944927a2 (patch)
tree226c15b7c6dbe70c2c1c9d386229dfa93bd5e476
parent7f3f6e4709c13b15fd122d9c2bd5e474c26ca4fb (diff)
Fix fdo#43619 Animating only 2nd level paragraphs hides 1st level
-rw-r--r--sd/inc/CustomAnimationEffect.hxx4
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx17
2 files changed, 13 insertions, 8 deletions
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