Kaydet (Commit) a04b4588 authored tarafından Rishabh's avatar Rishabh Kaydeden (comit) Katarina Behrens

tdf#87813: Reduce duplicate code

Change-Id: Ib546849de5101d7e9ebdf20f98f080575ce5f9cc
Reviewed-on: https://gerrit.libreoffice.org/22192Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 0c517ab1
...@@ -2125,39 +2125,7 @@ IMPL_LINK_NOARG_TYPED(CustomAnimationPane, implPropertyHdl, LinkParamNone*, void ...@@ -2125,39 +2125,7 @@ IMPL_LINK_NOARG_TYPED(CustomAnimationPane, implPropertyHdl, LinkParamNone*, void
IMPL_LINK_NOARG_TYPED(CustomAnimationPane, AnimationSelectHdl, ListBox&, void) IMPL_LINK_NOARG_TYPED(CustomAnimationPane, AnimationSelectHdl, ListBox&, void)
{ {
CustomAnimationPresetPtr* pPreset = static_cast< CustomAnimationPresetPtr* >(mpLBAnimation->GetSelectEntryData()); animationChange();
const double fDuration = (*pPreset)->getDuration();
sal_uInt32 nPos = LISTBOX_ENTRY_NOTFOUND;
if( fDuration == 5.0 )
nPos = 0;
else if( fDuration == 3.0 )
nPos = 1;
else if( fDuration == 2.0 )
nPos = 2;
else if( fDuration == 1.0 )
nPos = 3;
else if( fDuration == 0.5 )
nPos = 4;
mpCBSpeed->SelectEntryPos( nPos );
bool bHasSpeed = (*pPreset)->getDuration() > 0.001;
mpCBSpeed->Enable( bHasSpeed );
mpFTSpeed->Enable( bHasSpeed );
MainSequenceRebuildGuard aGuard( mpMainSequence );
// get selected effect
EffectSequence::iterator aIter( maListSelection.begin() );
const EffectSequence::iterator aEnd( maListSelection.end() );
while( aIter != aEnd )
{
CustomAnimationEffectPtr pEffect = (*aIter++);
EffectSequenceHelper* pEffectSequence = pEffect->getEffectSequence();
if( !pEffectSequence )
pEffectSequence = mpMainSequence.get();
pEffectSequence->replace( pEffect, *pPreset, fDuration );
}
onPreview(true);
} }
IMPL_LINK_NOARG_TYPED(CustomAnimationPane, UpdateAnimationLB, ListBox&, void) IMPL_LINK_NOARG_TYPED(CustomAnimationPane, UpdateAnimationLB, ListBox&, void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment