Kaydet (Commit) 6db1448e authored tarafından Mark Hung's avatar Mark Hung

tdf#119629 Fix keytime formula and missing effect node type.

1. Don't override keytime formula value if already read.
2. MSO's effect node type Click parallel node, with group node,
after group node were missing, now mapping to ON_CLICK,
WITH_PREVIOUS, AFTER_PREVIOUS correspondingly.

Change-Id: Id81d6c8597f4de58a7face3f013fcd7a36bb0fd9
Reviewed-on: https://gerrit.libreoffice.org/59940
Tested-by: Jenkins
Reviewed-by: 's avatarMark Hung <marklh9@gmail.com>
üst 8d7b1f2e
...@@ -102,6 +102,7 @@ public: ...@@ -102,6 +102,7 @@ public:
void testTdf115394PPT(); void testTdf115394PPT();
void testBulletsAsImage(); void testBulletsAsImage();
void testTdf113818(); void testTdf113818();
void testTdf119629();
void testTdf113822(); void testTdf113822();
CPPUNIT_TEST_SUITE(SdExportTest); CPPUNIT_TEST_SUITE(SdExportTest);
...@@ -130,6 +131,7 @@ public: ...@@ -130,6 +131,7 @@ public:
CPPUNIT_TEST(testTdf115394PPT); CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST(testBulletsAsImage); CPPUNIT_TEST(testBulletsAsImage);
CPPUNIT_TEST(testTdf113818); CPPUNIT_TEST(testTdf113818);
CPPUNIT_TEST(testTdf119629);
CPPUNIT_TEST(testTdf113822); CPPUNIT_TEST(testTdf113822);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -1137,6 +1139,26 @@ void SdExportTest::testTdf113818() ...@@ -1137,6 +1139,26 @@ void SdExportTest::testTdf113818()
xDocShRef->DoClose(); xDocShRef->DoClose();
} }
void SdExportTest::testTdf119629()
{
utl::TempFile tempFile;
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/ppt/tdf119629.ppt"), PPT);
xDocShRef = saveAndReload(xDocShRef.get(), PPT);
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
xmlDocPtr pXmlDoc = parseExport(tempFile, "content.xml");
// MSO's effect node type Click parallel node, with group node, after group node
// were missing.
assertXPath(pXmlDoc, "//draw:page"
"/anim:par[@presentation:node-type='timing-root']"
"/anim:seq[@presentation:node-type='main-sequence']"
"/anim:par[@presentation:node-type='on-click']"
"/anim:par[@presentation:node-type='with-previous']"
"/anim:par[@presentation:node-type='on-click']"
"/anim:animate[@anim:formula='width*sin(2.5*pi*$)']", 1);
xDocShRef->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
......
...@@ -125,11 +125,15 @@ namespace ppt ...@@ -125,11 +125,15 @@ namespace ppt
#define DFF_ANIM_PRESS_CLASS_OLE_ACTION 5 #define DFF_ANIM_PRESS_CLASS_OLE_ACTION 5
#define DFF_ANIM_PRESS_CLASS_MEDIACALL 6 #define DFF_ANIM_PRESS_CLASS_MEDIACALL 6
// Effect node type.
#define DFF_ANIM_NODE_TYPE_ON_CLICK 1 #define DFF_ANIM_NODE_TYPE_ON_CLICK 1
#define DFF_ANIM_NODE_TYPE_WITH_PREVIOUS 2 #define DFF_ANIM_NODE_TYPE_WITH_PREVIOUS 2
#define DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS 3 #define DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS 3
#define DFF_ANIM_NODE_TYPE_MAIN_SEQUENCE 4 #define DFF_ANIM_NODE_TYPE_MAIN_SEQUENCE 4
#define DFF_ANIM_NODE_TYPE_INTERACTIVE_SEQ 5 #define DFF_ANIM_NODE_TYPE_INTERACTIVE_SEQ 5
#define DFF_ANIM_NODE_TYPE_CLICK_PARALLEL 6
#define DFF_ANIM_NODE_TYPE_WITH_GROUP 7
#define DFF_ANIM_NODE_TYPE_AFTER_GROUP 8
#define DFF_ANIM_NODE_TYPE_TIMING_ROOT 9 #define DFF_ANIM_NODE_TYPE_TIMING_ROOT 9
/* constants for fill entry in AnimationNode */ /* constants for fill entry in AnimationNode */
......
...@@ -673,8 +673,11 @@ void AnimationImporter::fillNode( Reference< XAnimationNode > const & xNode, con ...@@ -673,8 +673,11 @@ void AnimationImporter::fillNode( Reference< XAnimationNode > const & xNode, con
sal_Int16 nNodeType = css::presentation::EffectNodeType::DEFAULT; sal_Int16 nNodeType = css::presentation::EffectNodeType::DEFAULT;
switch( nPPTNodeType ) switch( nPPTNodeType )
{ {
case DFF_ANIM_NODE_TYPE_CLICK_PARALLEL: SAL_FALLTHROUGH;
case DFF_ANIM_NODE_TYPE_ON_CLICK: nNodeType = css::presentation::EffectNodeType::ON_CLICK; break; case DFF_ANIM_NODE_TYPE_ON_CLICK: nNodeType = css::presentation::EffectNodeType::ON_CLICK; break;
case DFF_ANIM_NODE_TYPE_WITH_GROUP: SAL_FALLTHROUGH;
case DFF_ANIM_NODE_TYPE_WITH_PREVIOUS: nNodeType = css::presentation::EffectNodeType::WITH_PREVIOUS; break; case DFF_ANIM_NODE_TYPE_WITH_PREVIOUS: nNodeType = css::presentation::EffectNodeType::WITH_PREVIOUS; break;
case DFF_ANIM_NODE_TYPE_AFTER_GROUP: SAL_FALLTHROUGH;
case DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS: nNodeType = css::presentation::EffectNodeType::AFTER_PREVIOUS; break; case DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS: nNodeType = css::presentation::EffectNodeType::AFTER_PREVIOUS; break;
case DFF_ANIM_NODE_TYPE_MAIN_SEQUENCE: nNodeType = css::presentation::EffectNodeType::MAIN_SEQUENCE; break; case DFF_ANIM_NODE_TYPE_MAIN_SEQUENCE: nNodeType = css::presentation::EffectNodeType::MAIN_SEQUENCE; break;
case DFF_ANIM_NODE_TYPE_TIMING_ROOT: nNodeType = css::presentation::EffectNodeType::TIMING_ROOT; break; case DFF_ANIM_NODE_TYPE_TIMING_ROOT: nNodeType = css::presentation::EffectNodeType::TIMING_ROOT; break;
...@@ -2151,7 +2154,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen ...@@ -2151,7 +2154,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
if( pValue && pValue->getType() == DFF_msofbtAnimAttributeValue ) if( pValue && pValue->getType() == DFF_msofbtAnimAttributeValue )
{ {
// Any occurrence of the formula becomes the formula of the whole list. // Any occurrence of the formula becomes the formula of the whole list.
if (importAttributeValue(pValue, aValue2)) if (importAttributeValue(pValue, aValue2) && aFormula.isEmpty())
aValue2 >>= aFormula; aValue2 >>= aFormula;
} }
aValues[nKeyTime] = aValue1; aValues[nKeyTime] = aValue1;
......
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