View | Details | Raw Unified | Return to issue 119988
Collapse All | Expand All

(-)main/sd/source/ui/animations/CustomAnimationPane.cxx (-6 / +66 lines)
Lines 1697-1702 Link Here
1697
				bChanged = true;
1697
				bChanged = true;
1698
			}
1698
			}
1699
1699
1700
			//#Bug 119988#
1701
			/************************************************************************/
1702
			/* 
1703
			Note, the setAnimateForm means set the animation from TextGroup to Object's Shape
1704
			And on the UI in means "Animate attached shape" in "Effect Option" dialog
1705
			The setTextGrouping means set animation to Object's Text, 
1706
			the nTextGrouping is Text Animation Type
1707
			nTextGrouping = -1 is "As one Object", means no text animation.
1708
1709
			The previous call order first do the setTextGrouping and then do the setAnimateForm,
1710
			that will cause such defect: in the setTextGrouping, the effect has been removed, 
1711
			but in setAnimateForm still need this effect, then a NULL pointer of that effect will
1712
			be gotten, and cause crash.
1713
1714
			[]bHasAnimateForm means the UI has changed, bAnimateForm is it value
1715
1716
			So if create a new textgroup animation, the following animation will never be run!
1717
			Since the ¡°Animate attached shape¡± is default checked.
1718
			And the bHasAnimateForm default is false, and if user uncheck it the value bAnimateForm will be false, 
1719
			it same as the TextGroup¡¯s default value, also could not be run setAnimateForm.
1720
			if( bHasAnimateForm )
1721
			{
1722
			if( pTextGroup->getAnimateForm() != bAnimateForm )
1723
			{
1724
			pEffectSequence->setAnimateForm( pTextGroup, bAnimateForm );
1725
			bChanged = true;
1726
			}
1727
			}
1728
1729
			In setTextGrouping, there are three case:
1730
			1.	Create new text effects for empty TextGroup
1731
			2.	Remove all text effects of TextGroup (nTextGrouping == -1)
1732
			3.	Change all the text effects¡¯ start type
1733
1734
			So here is the right logic:
1735
			If set the animation from text to shape and remove text animation, 
1736
			should do setAnimateForm first, then do setTextGrouping.
1737
			Other case,do setTextGrouping first, then do setAnimateForm. 
1738
1739
			*/
1740
			/************************************************************************/
1741
1742
			bool	bDoSetAnimateFormFirst = false;
1743
			bool	bNeedDoSetAnimateForm = false;
1744
1745
			if( bHasAnimateForm )
1746
			{
1747
				if( pTextGroup->getAnimateForm() != bAnimateForm )
1748
				{
1749
					if( (pTextGroup->getTextGrouping() >= 0) && (nTextGrouping == -1 ) )
1750
					{
1751
						bDoSetAnimateFormFirst = true;
1752
					}
1753
					bNeedDoSetAnimateForm = true;
1754
				}
1755
			}
1756
1757
			if (bDoSetAnimateFormFirst)
1758
			{
1759
				pEffectSequence->setAnimateForm( pTextGroup, bAnimateForm );
1760
				bChanged = true;
1761
			}
1762
			
1700
			if( bHasTextGrouping )
1763
			if( bHasTextGrouping )
1701
			{
1764
			{
1702
				if( (pTextGroup->getTextGrouping() != nTextGrouping) )
1765
				if( (pTextGroup->getTextGrouping() != nTextGrouping) )
Lines 1706-1718 Link Here
1706
				}
1769
				}
1707
			}
1770
			}
1708
1771
1709
			if( bHasAnimateForm )
1772
			if (!bDoSetAnimateFormFirst&&bNeedDoSetAnimateForm)
1710
			{
1773
			{
1711
				if( pTextGroup->getAnimateForm() != bAnimateForm )
1774
				pEffectSequence->setAnimateForm( pTextGroup, bAnimateForm );
1712
				{
1775
				bChanged = true;
1713
					pEffectSequence->setAnimateForm( pTextGroup, bAnimateForm );
1714
					bChanged = true;
1715
				}
1716
			}
1776
			}
1717
1777
1718
			if( bHasTextGroupingAuto )
1778
			if( bHasTextGroupingAuto )

Return to issue 119988