[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-05-23 Thread Aron Budea
 sd/qa/unit/data/ppt/tdf116899.ppt|binary
 sd/qa/unit/import-tests.cxx  |   25 +
 sd/source/filter/ppt/pptinanimations.cxx |   15 ---
 3 files changed, 37 insertions(+), 3 deletions(-)

New commits:
commit 37af3939b768be09b6c5671fc8ae89f4e5fc38b6
Author: Aron Budea 
Date:   Sun Apr 22 16:10:28 2018 +0200

tdf#116899: normalize key times during PPT import if needed

If TimeAnimationValueListEntry contains time with -1000,
key times have to be distributed evenly between 0 and 1.
([MS-PPT] 2.8.31)

Reviewed-on: https://gerrit.libreoffice.org/53284
Tested-by: Jenkins 
Reviewed-by: Aron Budea 
(cherry picked from commit 4e207c2e17d75a3cb7b6b72690375279be40d64a)

Reviewed-on: https://gerrit.libreoffice.org/54663
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 
(cherry picked from commit c703c934d3f9d6ad7cba620c76520d80cc0e2be7)

Change-Id: I67a3b83f1f1832fade5df7908c58032bcb9b73ce
Reviewed-on: https://gerrit.libreoffice.org/54700
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/sd/qa/unit/data/ppt/tdf116899.ppt 
b/sd/qa/unit/data/ppt/tdf116899.ppt
new file mode 100644
index ..edad3356d36f
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf116899.ppt differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c66134291e05..2e24756b80c4 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -158,6 +158,7 @@ public:
 void testTdf114821();
 void testTdf51340();
 void testTdf115639();
+void testTdf116899();
 
 bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, 
std::vector& rExpected);
 void testPatternImport();
@@ -232,6 +233,7 @@ public:
 CPPUNIT_TEST(testTdf114821);
 CPPUNIT_TEST(testTdf51340);
 CPPUNIT_TEST(testTdf115639);
+CPPUNIT_TEST(testTdf116899);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2442,6 +2444,29 @@ void SdImportTest::testTdf115639()
 }
 }
 
+void SdImportTest::testTdf116899()
+{
+// This is a PPT created in Impress and roundtripped in PP, the key times 
become [1, -1] in PP,
+//  a time of -1 (-1000) in PPT means key times have to be distributed 
evenly between 0 and 1
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf116899.ppt"), PPT);
+
+uno::Reference< drawing::XDrawPagesSupplier > xDoc(
+xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
+uno::Reference< drawing::XDrawPage > xPage(
+xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
+uno::Reference< animations::XAnimationNodeSupplier > xAnimNodeSupplier(
+xPage, uno::UNO_QUERY_THROW );
+uno::Reference< animations::XAnimationNode > xRootNode(
+xAnimNodeSupplier->getAnimationNode() );
+std::vector< uno::Reference< animations::XAnimationNode > > aAnimVector;
+anim::create_deep_vector(xRootNode, aAnimVector);
+uno::Reference< animations::XAnimate > xNode(
+aAnimVector[8], uno::UNO_QUERY_THROW );
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of key times in the animation node 
isn't 2.", xNode->getKeyTimes().getLength(), static_cast(2) );
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "First key time in the animation node isn't 
0, key times aren't normalized.", 0., xNode->getKeyTimes()[0] );
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "Second key time in the animation node isn't 
1, key times aren't normalized.", 1., xNode->getKeyTimes()[1] );
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/ppt/pptinanimations.cxx 
b/sd/source/filter/ppt/pptinanimations.cxx
index 2c3574f93d52..c0788f5f9b71 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -2391,15 +2391,17 @@ void AnimationImporter::importAnimateKeyPoints( const 
Atom* pAtom, const Referen
 OUString aFormula;
 
 pIter = pAtom->findFirstChildAtom(DFF_msofbtAnimKeyTime);
-int nKeyTime;
 sal_Int32 nTemp;
-for( nKeyTime = 0; (nKeyTime < nKeyTimes) && pIter; nKeyTime++ )
+bool bToNormalize = false;
+for( int nKeyTime = 0; (nKeyTime < nKeyTimes) && pIter; nKeyTime++ )
 {
 if( pIter->seekToContent() )
 {
 mrStCtrl.ReadInt32( nTemp );
 double fTemp = (double)nTemp / 1000.0;
 aKeyTimes[nKeyTime] = fTemp;
+if( fTemp == -1 )
+bToNormalize = true;
 
 const Atom* pValue = Atom::findNextChildAtom(pIter);
 if( pValue && pValue->getType() == 
DFF_msofbtAnimAttributeValue )
@@ -2496,7 +2498,14 @@ void AnimationImporter::importAnimateKeyPoints( 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-03-27 Thread Szymon Kłos
 sd/qa/unit/data/pptx/tdf84205.pptx   |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   14 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |8 ++--
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 586d56208861135e6548a4d73961e64cd3df5d68
Author: Szymon Kłos 
Date:   Fri Mar 16 21:35:01 2018 +0100

tdf#84205 If theme not found, use first

Not a complete fix, workaround.

Change-Id: If4d765eaeae3419f4f1deb4e1cfbe0113a71da94
Reviewed-on: https://gerrit.libreoffice.org/51440
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/51458
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/pptx/tdf84205.pptx 
b/sd/qa/unit/data/pptx/tdf84205.pptx
new file mode 100644
index ..211cea6d0251
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf84205.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 288b0fe192bd..5315f3558001 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -124,6 +124,7 @@ public:
 void testGroupsPosition();
 void testGroupsRotatedPosition();
 void testAccentColor();
+void testThemeColors();
 void testTdf114848();
 void testFontScale();
 void testTdf115394();
@@ -178,6 +179,7 @@ public:
 CPPUNIT_TEST(testGroupsPosition);
 CPPUNIT_TEST(testGroupsRotatedPosition);
 CPPUNIT_TEST(testAccentColor);
+CPPUNIT_TEST(testThemeColors);
 CPPUNIT_TEST(testTdf114848);
 CPPUNIT_TEST(testFontScale);
 CPPUNIT_TEST(testTdf115394);
@@ -1119,6 +1121,18 @@ void SdOOXMLExportTest2::testAccentColor()
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
 }
 
+void SdOOXMLExportTest2::testThemeColors()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf84205.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+xDocShRef->DoClose();
+
+xmlDocPtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
+assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a");
+assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", "a5a5a5");
+}
+
 void SdOOXMLExportTest2::testTdf114848()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114848.pptx"), 
PPTX);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 9a8c67e65c22..bc6d9623f945 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2652,8 +2652,12 @@ void PowerPointExport::WriteTheme( sal_Int32 nThemeNum )
 
 if (!WriteColorSchemes(pFS, sThemePath))
 {
-// color schemes are required - use default values
-WriteDefaultColorSchemes(pFS);
+// if style is not defined, try to use first one
+if (!WriteColorSchemes(pFS, "ppt/theme/theme1.xml"))
+{
+// color schemes are required - use default values
+WriteDefaultColorSchemes(pFS);
+}
 }
 
 pFS->endElementNS(XML_a, XML_clrScheme);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-03-27 Thread Szymon Kłos
 sd/qa/unit/data/pptx/tdf104789.pptx  |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   15 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   61 +--
 3 files changed, 41 insertions(+), 35 deletions(-)

New commits:
commit 63f6174b67a7e731389d477e0856b64478e6511d
Author: Szymon Kłos 
Date:   Thu Mar 15 19:23:20 2018 +0100

tdf#104789 Export opacity attribute name

Change-Id: Id47ab6b3cb20fbcebb2d7fa589f3b0d7552e2cce
Reviewed-on: https://gerrit.libreoffice.org/51369
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/51457
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/pptx/tdf104789.pptx 
b/sd/qa/unit/data/pptx/tdf104789.pptx
new file mode 100644
index ..d5ead6a931a7
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104789.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 16c0e55c43be..288b0fe192bd 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -132,6 +132,7 @@ public:
 void testTdf104792();
 void testTdf90627();
 void testTdf104786();
+void testTdf104789();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -184,6 +185,7 @@ public:
 CPPUNIT_TEST(testTdf104792);
 CPPUNIT_TEST(testTdf90627);
 CPPUNIT_TEST(testTdf104786);
+CPPUNIT_TEST(testTdf104789);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1245,6 +1247,19 @@ void SdOOXMLExportTest2::testTdf104786()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf104789()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104789.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+OUString sAttributeName = getXPathContent(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:attrNameLst/p:attrName");
+CPPUNIT_ASSERT_EQUAL(OUString("style.opacity"), sAttributeName);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index f44121b1c967..9a8c67e65c22 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -991,23 +991,19 @@ void PowerPointExport::WriteAnimationAttributeName( const 
FSHelperPtr& pFS, cons
 
 SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName));
 
+const char* pAttribute = nullptr;
+
 if (rAttributeName == "Visibility")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("style.visibility");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "style.visibility";
 }
 else if (rAttributeName == "X")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("ppt_x");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "ppt_x";
 }
 else if (rAttributeName == "Y")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("ppt_y");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "ppt_y";
 }
 else if (rAttributeName == "X;Y")
 {
@@ -1021,58 +1017,53 @@ void PowerPointExport::WriteAnimationAttributeName( 
const FSHelperPtr& pFS, cons
 }
 else if (rAttributeName == "Width")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("ppt_w");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "ppt_w";
 }
 else if (rAttributeName == "Height")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("ppt_h");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "ppt_h";
 }
 else if (rAttributeName == "Rotate")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("r");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "r";
 }
 else if (rAttributeName == "FillStyle")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("fill.type");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "fill.type";
 }
 else if (rAttributeName == "FillOn")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("fill.on");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "fill.on";
 }
 else 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-03-27 Thread Szymon Kłos
 sd/qa/unit/data/pptx/tdf104786.pptx  |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   15 +++
 sd/source/filter/eppt/epptooxml.hxx  |2 +-
 sd/source/filter/eppt/pptx-epptooxml.cxx |   25 +
 4 files changed, 33 insertions(+), 9 deletions(-)

New commits:
commit 16d316c912ef0ebbab30c66f2df898a407ca5c86
Author: Szymon Kłos 
Date:   Thu Mar 15 17:17:21 2018 +0100

tdf#104786 Don't export empty 'to'

Change-Id: I16b573fd6455813c6be5c2f5a0f0a820360a239f
Reviewed-on: https://gerrit.libreoffice.org/51359
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/51456
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/pptx/tdf104786.pptx 
b/sd/qa/unit/data/pptx/tdf104786.pptx
new file mode 100644
index ..165b5676e400
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104786.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index ed1076fe1f0e..16c0e55c43be 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -131,6 +131,7 @@ public:
 /// SmartArt animated elements
 void testTdf104792();
 void testTdf90627();
+void testTdf104786();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -182,6 +183,7 @@ public:
 CPPUNIT_TEST(testTdf115394Zero);
 CPPUNIT_TEST(testTdf104792);
 CPPUNIT_TEST(testTdf90627);
+CPPUNIT_TEST(testTdf104786);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1230,6 +1232,19 @@ void SdOOXMLExportTest2::testTdf90627()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf104786()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104786.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide2.xml");
+// Don't export empty 'to'
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst/p:set[2]/p:to",
 0);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/epptooxml.hxx 
b/sd/source/filter/eppt/epptooxml.hxx
index fb8617491936..8987fddbdb8f 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -114,7 +114,7 @@ protected:
 void WriteAnimationNodeEffect( const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 
nXmlNodeType, bool bMainSeqChild );
 void WriteAnimationNodeCommand(const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 
nXmlNodeType, bool bMainSeqChild );
 void WriteAnimationNodeCommonPropsStart( const 
::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< 
css::animations::XAnimationNode >& rXNode, bool bSingle, bool bMainSeqChild );
-static void WriteAnimationProperty( const ::sax_fastparser::FSHelperPtr& 
pFS, const css::uno::Any& rAny );
+static void WriteAnimationProperty( const ::sax_fastparser::FSHelperPtr& 
pFS, const css::uno::Any& rAny, sal_Int32 nToken = 0 );
 void WriteAnimationTarget( const ::sax_fastparser::FSHelperPtr& pFS, const 
css::uno::Any& rTarget );
 bool WriteComments( sal_uInt32 nPageNum );
 void ImplWriteBackground( const ::sax_fastparser::FSHelperPtr& pFS, const 
css::uno::Reference< css::beans::XPropertySet >& aXBackgroundPropSet );
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index ca50427f4bab..f44121b1c967 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -885,7 +885,7 @@ void PowerPointExport::WriteTransition( const FSHelperPtr& 
pFS )
 }
 }
 
-void PowerPointExport::WriteAnimationProperty( const FSHelperPtr& pFS, const 
Any& rAny )
+void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const 
Any& rAny, sal_Int32 nToken)
 {
 if( !rAny.hasValue() )
 return;
@@ -893,7 +893,17 @@ void PowerPointExport::WriteAnimationProperty( const 
FSHelperPtr& pFS, const Any
 sal_uInt32 nRgb;
 double fDouble;
 
-switch( rAny.getValueType().getTypeClass() ) {
+uno::TypeClass aClass = rAny.getValueType().getTypeClass();
+bool bWriteToken = nToken &&
+(  aClass == TypeClass_LONG
+|| aClass == TypeClass_DOUBLE
+|| aClass == TypeClass_STRING );
+
+if (bWriteToken)
+pFS->startElementNS(XML_p, XML_to, FSEND);
+
+switch (rAny.getValueType().getTypeClass())

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-03-27 Thread Szymon Kłos
 sd/qa/unit/data/odp/tdf90627.odp |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   15 +++
 sd/source/filter/eppt/epptooxml.hxx  |4 -
 sd/source/filter/eppt/pptx-epptooxml.cxx |   63 ++-
 4 files changed, 47 insertions(+), 35 deletions(-)

New commits:
commit a21204ec1cf0b5f311f581ecce437785005d0456
Author: Szymon Kłos 
Date:   Wed Mar 14 18:59:49 2018 +0100

tdf#90627 Don't save empty conditions

Change-Id: I5a953c1b0fff7bf41a59360a8f52596264ddf266
Reviewed-on: https://gerrit.libreoffice.org/51293
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/51455
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/odp/tdf90627.odp b/sd/qa/unit/data/odp/tdf90627.odp
new file mode 100644
index ..dfa28c9b09a3
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf90627.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 9818801662aa..ed1076fe1f0e 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -130,6 +130,7 @@ public:
 void testTdf115394Zero();
 /// SmartArt animated elements
 void testTdf104792();
+void testTdf90627();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -180,6 +181,7 @@ public:
 CPPUNIT_TEST(testTdf115394);
 CPPUNIT_TEST(testTdf115394Zero);
 CPPUNIT_TEST(testTdf104792);
+CPPUNIT_TEST(testTdf90627);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1215,6 +1217,19 @@ void SdOOXMLExportTest2::testTdf104792()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf90627()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf90627.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+// Don't export empty conditions
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:endCondLst",
 0);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/epptooxml.hxx 
b/sd/source/filter/eppt/epptooxml.hxx
index 7c4ab7a9580a..fb8617491936 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -103,8 +103,8 @@ protected:
 
 static void WriteAnimateTo( const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Any& rValue, const OUString& rAttributeName );
 static void WriteAnimateValues( const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Reference< css::animations::XAnimate >& rXAnimate );
-static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& 
pFS, css::uno::Any& rAny, bool bWriteEvent, bool bMainSeqChild );
-static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& 
pFS, const char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay );
+static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& 
pFS, css::uno::Any const & rAny, bool bWriteEvent, bool bMainSeqChild, 
sal_Int32 nToken );
+static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& 
pFS, const char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay, 
sal_Int32 nToken );
 void WriteAnimations( const ::sax_fastparser::FSHelperPtr& pFS );
 static void WriteAnimationAttributeName( const 
::sax_fastparser::FSHelperPtr& pFS, const OUString& rAttributeName );
 void WriteAnimationNode( const ::sax_fastparser::FSHelperPtr& pFS, const 
css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool 
bMainSeqChild );
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index c9774718..ca50427f4bab 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1250,29 +1250,35 @@ void PowerPointExport::WriteAnimationNodeAnimateInside( 
const FSHelperPtr& pFS,
 WriteAnimateTo( pFS, rXAnimate->getTo(), rXAnimate->getAttributeName() 
);
 }
 
-void PowerPointExport::WriteAnimationCondition( const FSHelperPtr& pFS, const 
char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay )
+void PowerPointExport::WriteAnimationCondition(const FSHelperPtr& pFS, const 
char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay, sal_Int32 
nToken)
 {
-if( bHasFDelay || pDelay || pEvent ) {
-if( !pEvent )
-pFS->singleElementNS( XML_p, XML_cond,
-  XML_delay, bHasFDelay ? I64S( (sal_uInt32) (fDelay*1000.0) ) 
: pDelay,
-  FSEND );
-

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-03-12 Thread Mike Kaganski
 sd/qa/unit/misc-tests.cxx   |   30 ++
 sd/source/core/stlsheet.cxx |2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)

New commits:
commit bafd367521f5deb3c7d496ec63218c42510bac32
Author: Mike Kaganski 
Date:   Sun Mar 11 07:04:23 2018 +0300

tdf#44774: Parent style's msApiName could yet be empty; use GetApiName()

Reviewed-on: https://gerrit.libreoffice.org/51069
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 
(cherry picked from commit a8fc81d478f4dcf8600ed9a2b4e0f7adff4a17ee)

Change-Id: Ie0e218ea83d34aa7ee22fea1f32b2851a942544f
Reviewed-on: https://gerrit.libreoffice.org/51101
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index d7027f9b0830..046e97f20525 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -51,12 +52,14 @@ public:
 void testTdf96708();
 void testTdf99396();
 void testTdf99396TextEdit();
+void testTdf44774();
 
 CPPUNIT_TEST_SUITE(SdMiscTest);
 CPPUNIT_TEST(testTdf96206);
 CPPUNIT_TEST(testTdf96708);
 CPPUNIT_TEST(testTdf99396);
 CPPUNIT_TEST(testTdf99396TextEdit);
+CPPUNIT_TEST(testTdf44774);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -255,6 +258,33 @@ void SdMiscTest::testTdf99396TextEdit()
 xDocSh->DoClose();
 }
 
+void SdMiscTest::testTdf44774()
+{
+sd::DrawDocShellRef xDocShRef = new 
sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false,
+DocumentType::Draw);
+const uno::Reference xLoadable(xDocShRef->GetModel(), 
uno::UNO_QUERY_THROW);
+xLoadable->initNew();
+SfxStyleSheetBasePool* pSSPool = xDocShRef->GetStyleSheetPool();
+
+// Create a new style with an empty name, like what happens in UI when 
creating a new style
+SfxStyleSheetBase& rStyleA = pSSPool->Make("", SfxStyleFamily::Para, 
SFXSTYLEBIT_USERDEF);
+// Assign a new name, which does not yet set its ApiName
+rStyleA.SetName("StyleA");
+// Create another style
+SfxStyleSheetBase& rStyleB = pSSPool->Make("StyleB", SfxStyleFamily::Para, 
SFXSTYLEBIT_USERDEF);
+// ... and set its parent to the first one
+rStyleB.SetParent("StyleA");
+
+// Now save the file and reload
+xDocShRef = saveAndReload(xDocShRef.get(), ODG);
+pSSPool = xDocShRef->GetStyleSheetPool();
+
+SfxStyleSheetBase* pStyle = pSSPool->Find("StyleB", SfxStyleFamily::Para);
+CPPUNIT_ASSERT(pStyle);
+// The parent set in StyleB used to reset, because parent style's 
msApiName was empty
+CPPUNIT_ASSERT_EQUAL(OUString("StyleA"), pStyle->GetParent());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index cf76a458c067..b3380370836f 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -912,7 +912,7 @@ OUString SAL_CALL SdStyleSheet::getParentStyle() 
throw(RuntimeException, std::ex
 {
 SdStyleSheet* pParentStyle = static_cast< SdStyleSheet* >( 
mxPool->Find( GetParent(), nFamily ) );
 if( pParentStyle )
-return pParentStyle->msApiName;
+return pParentStyle->GetApiName();
 }
 return OUString();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-02-21 Thread Tamás Zolnai
 sd/qa/unit/tiledrendering/data/paste_text_onslide.odp |binary
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |   66 ++
 sd/source/ui/view/sdview2.cxx |8 +-
 3 files changed, 73 insertions(+), 1 deletion(-)

New commits:
commit d6f89b5daccd498fb5af6f47d06b749f92dcdaca
Author: Tamás Zolnai 
Date:   Wed Feb 21 03:07:33 2018 +0100

sd lok: Fix pasting text on slide

Use the same solution as for images in this commit:
9fee132c18b658c9ea9fb1114c1fefa56b57532a

Place the inserted text shape to the center of the slide
for LOK, because we don't get correct window size here.

Reviewed-on: https://gerrit.libreoffice.org/50074
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit e86fb2edfdca48b92b11c149002ab2b06a630b94)

Change-Id: Ie0c3717d22da6b6a988ab8d566bd9759e03f86c8
Reviewed-on: https://gerrit.libreoffice.org/50097
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/tiledrendering/data/paste_text_onslide.odp 
b/sd/qa/unit/tiledrendering/data/paste_text_onslide.odp
new file mode 100644
index ..c33b7c110229
Binary files /dev/null and 
b/sd/qa/unit/tiledrendering/data/paste_text_onslide.odp differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index e23ac2449841..0eabab25fab2 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -103,6 +103,7 @@ public:
 void testLanguageStatus();
 void testDefaultView();
 void testIMESupport();
+void testPasteTextOnSlide();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -144,6 +145,7 @@ public:
 CPPUNIT_TEST(testLanguageStatus);
 CPPUNIT_TEST(testDefaultView);
 CPPUNIT_TEST(testIMESupport);
+CPPUNIT_TEST(testPasteTextOnSlide);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1962,6 +1964,70 @@ void SdTiledRenderingTest::testIMESupport()
 comphelper::LibreOfficeKit::setActive(false);
 }
 
+void SdTiledRenderingTest::testPasteTextOnSlide()
+{
+// Load the document.
+comphelper::LibreOfficeKit::setActive();
+SdXImpressDocument* pXImpressDocument = 
createDoc("paste_text_onslide.odp");
+
+ViewCallback aView1;
+
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(::callback,
 );
+
+// select second text object
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+Scheduler::ProcessEventsToIdle();
+
+// step into text editing
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, '1', 0);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, '1', 0);
+Scheduler::ProcessEventsToIdle();
+
+// select full text
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+Scheduler::ProcessEventsToIdle();
+
+// Copy some text
+comphelper::dispatchCommand(".uno:Copy", 
uno::Sequence());
+Scheduler::ProcessEventsToIdle();
+
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 
awt::Key::ESCAPE);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::ESCAPE);
+Scheduler::ProcessEventsToIdle();
+
+// Paste onto the slide
+comphelper::dispatchCommand(".uno:Paste", 
uno::Sequence());
+Scheduler::ProcessEventsToIdle();
+
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 
awt::Key::ESCAPE);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::ESCAPE);
+Scheduler::ProcessEventsToIdle();
+
+// Check the position of the newly added text shape, created for 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-02-12 Thread Szymon Kłos
 sd/qa/unit/export-tests-ooxml2.cxx   |   36 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |  151 ++-
 2 files changed, 146 insertions(+), 41 deletions(-)

New commits:
commit 67ad5a0d25f12ddb5cc95f7226601f54a1074696
Author: Szymon Kłos 
Date:   Mon Feb 5 12:41:58 2018 +0100

tdf#115394 export custom transition time in PPTX

Change-Id: Ib8f4cef713895029dc18f68a07baa4b65e4260c0
Reviewed-on: https://gerrit.libreoffice.org/49245
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/49522
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 3d1ad4f28b78..59d1d0e7f424 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -125,6 +125,7 @@ public:
 void testGroupsRotatedPosition();
 void testAccentColor();
 void testTdf114848();
+void testTdf115394();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -171,6 +172,7 @@ public:
 CPPUNIT_TEST(testGroupsRotatedPosition);
 CPPUNIT_TEST(testAccentColor);
 CPPUNIT_TEST(testTdf114848);
+CPPUNIT_TEST(testTdf115394);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1130,6 +1132,40 @@ void SdOOXMLExportTest2::testGroupRotation()
 assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[2]/p:spPr/a:xfrm", "rot", "2040");
 }
 
+void SdOOXMLExportTest2::testTdf115394()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115394.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+double fTransitionDuration;
+
+// Slow in MS formats
+SdPage* pPage1 = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
+fTransitionDuration = pPage1->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
+
+// Medium in MS formats
+SdPage* pPage2 = xDocShRef->GetDoc()->GetSdPage(1, PageKind::Standard);
+fTransitionDuration = pPage2->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(0.75, fTransitionDuration);
+
+// Fast in MS formats
+SdPage* pPage3 = xDocShRef->GetDoc()->GetSdPage(2, PageKind::Standard);
+fTransitionDuration = pPage3->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(0.5, fTransitionDuration);
+
+// Custom values
+SdPage* pPage4 = xDocShRef->GetDoc()->GetSdPage(3, PageKind::Standard);
+fTransitionDuration = pPage4->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(0.25, fTransitionDuration);
+
+SdPage* pPage5 = xDocShRef->GetDoc()->GetSdPage(4, PageKind::Standard);
+fTransitionDuration = pPage5->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(4.25, fTransitionDuration);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index f61d7017382e..07c290895970 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -643,7 +643,43 @@ void PowerPointExport::WriteTransition( const FSHelperPtr& 
pFS )
 sal_Int32 advanceTiming = -1;
 sal_Int32 changeType = 0;
 
-if( GETA( Speed ) ) {
+sal_Int32 nTransitionDuration = -1;
+bool isTransitionDurationSet = false;
+
+// try to use TransitionDuration instead of old Speed property
+if (GETA(TransitionDuration))
+{
+double fTransitionDuration = -1.0;
+mAny >>= fTransitionDuration;
+if (fTransitionDuration >= 0)
+{
+nTransitionDuration = fTransitionDuration * 1000.0;
+
+// override values because in MS formats meaning of 
fast/medium/slow is different
+if (nTransitionDuration <= 500)
+{
+// fast is default
+speed = nullptr;
+}
+else if (nTransitionDuration >= 1000)
+{
+speed = "slow";
+}
+else
+{
+speed = "med";
+}
+
+bool isStandardValue = nTransitionDuration == 500
+|| nTransitionDuration == 750
+|| nTransitionDuration == 1000;
+
+if(!isStandardValue)
+isTransitionDurationSet = true;
+}
+}
+else if (GETA(Speed))
+{
 mAny >>= animationSpeed;
 
 switch( animationSpeed ) {
@@ -666,45 +702,6 @@ void PowerPointExport::WriteTransition( const FSHelperPtr& 
pFS )
 if( changeType == 1 && GETA( Duration ) )
 mAny >>= advanceTiming;
 
-if (nTransition14 || pPresetTransition)
-{
-const char* pRequiresNS = nTransition14 ? "p14" : "p15";
-
-

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2018-02-12 Thread Szymon Kłos
 sd/qa/unit/data/ppt/tdf115394.ppt |binary
 sd/qa/unit/export-tests.cxx   |   39 ++
 sd/qa/unit/import-tests.cxx   |   25 
 sd/source/filter/eppt/eppt.cxx|   26 ++---
 sd/source/filter/ppt/pptin.cxx|6 ++---
 5 files changed, 90 insertions(+), 6 deletions(-)

New commits:
commit d7763fb35f7556acffa5543f7b2a8eda47862fd1
Author: Szymon Kłos 
Date:   Wed Feb 7 12:22:52 2018 +0100

tdf#115394 export correct slide transition time in PPT

Change-Id: Ie293dd4cc128c256e39d54fdcd83bb5e13484662
Reviewed-on: https://gerrit.libreoffice.org/49345
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/49523
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/ppt/tdf115394.ppt 
b/sd/qa/unit/data/ppt/tdf115394.ppt
new file mode 100644
index ..1fd299a5e4be
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf115394.ppt differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index f42673006e82..a1f067287de5 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -95,6 +95,7 @@ public:
 void testEmbeddedPdf();
 void testTdf100926();
 void testTextRotation();
+void testTdf115394PPT();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -112,6 +113,7 @@ public:
 CPPUNIT_TEST(testEmbeddedPdf);
 CPPUNIT_TEST(testTdf100926);
 CPPUNIT_TEST(testTextRotation);
+CPPUNIT_TEST(testTdf115394PPT);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -708,6 +710,43 @@ void SdExportTest::testTextRotation()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf115394PPT()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/ppt/tdf115394.ppt"), PPT);
+
+// Export the document and import again for a check
+uno::Reference< lang::XComponent > xComponent(xDocShRef->GetModel(), 
uno::UNO_QUERY);
+uno::Reference xStorable(xComponent, uno::UNO_QUERY);
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= 
OStringToOUString(OString(aFileFormats[PPT].pFilterName), 
RTL_TEXTENCODING_UTF8);
+
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+xStorable->storeToURL(aTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
+xComponent.set(xStorable, uno::UNO_QUERY);
+xComponent->dispose();
+xDocShRef = loadURL(aTempFile.GetURL(), PPT);
+
+double fTransitionDuration;
+
+// Fast
+SdPage* pPage1 = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
+fTransitionDuration = pPage1->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(0.5, fTransitionDuration);
+
+// Medium
+SdPage* pPage2 = xDocShRef->GetDoc()->GetSdPage(1, PageKind::Standard);
+fTransitionDuration = pPage2->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(0.75, fTransitionDuration);
+
+// Slow
+SdPage* pPage3 = xDocShRef->GetDoc()->GetSdPage(2, PageKind::Standard);
+fTransitionDuration = pPage3->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 187d678a2958..0796cebbaef0 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -151,6 +151,7 @@ public:
 void testActiveXCheckbox();
 void testTdf108926();
 void testTdf115394();
+void testTdf115394PPT();
 
 bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, 
std::vector& rExpected);
 void testPatternImport();
@@ -221,6 +222,7 @@ public:
 CPPUNIT_TEST(testActiveXCheckbox);
 CPPUNIT_TEST(testTdf108926);
 CPPUNIT_TEST(testTdf115394);
+CPPUNIT_TEST(testTdf115394PPT);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2293,6 +2295,29 @@ void SdImportTest::testTdf115394()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf115394PPT()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf115394.ppt"), PPT);
+double fTransitionDuration;
+
+// Fast
+SdPage* pPage1 = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
+fTransitionDuration = pPage1->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(0.5, fTransitionDuration);
+
+// Medium
+SdPage* pPage2 = xDocShRef->GetDoc()->GetSdPage(1, PageKind::Standard);
+fTransitionDuration = pPage2->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(0.75, fTransitionDuration);
+
+// Slow
+SdPage* pPage3 = xDocShRef->GetDoc()->GetSdPage(2, PageKind::Standard);
+fTransitionDuration = pPage3->getTransitionDuration();
+CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
+
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source sd/uiconfig

2017-11-30 Thread Henry Castro
 sd/qa/unit/tiledrendering/tiledrendering.cxx |4 +-
 sd/source/ui/docshell/docshel3.cxx   |3 -
 sd/source/ui/docshell/docshell.cxx   |   54 +++
 sd/source/ui/view/ViewShellBase.cxx  |   14 +++
 sd/uiconfig/simpress/statusbar/statusbar.xml |1 
 5 files changed, 40 insertions(+), 36 deletions(-)

New commits:
commit f25e0008a0a18c4894891587337a204805173e0c
Author: Henry Castro 
Date:   Thu Nov 16 22:13:27 2017 -0400

sd: enable language status bar item

Change-Id: I7cb725cdcfc92366694fc8cb24c1443dd74d102e
Reviewed-on: https://gerrit.libreoffice.org/44851
Tested-by: Jenkins 
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/45448
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 6b27320bc0d0..03d756e5a260 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1838,8 +1838,8 @@ void SdTiledRenderingTest::testLanguageStatus()
 std::unique_ptr pItem2;
 pView1->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, 
pItem1);
 pView2->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, 
pItem2);
-CPPUNIT_ASSERT(dynamic_cast< const SfxStringListItem* >(pItem1.get()));
-CPPUNIT_ASSERT(dynamic_cast< const SfxStringListItem* >(pItem2.get()));
+CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(pItem1.get()));
+CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(pItem2.get()));
 }
 
 comphelper::LibreOfficeKit::setActive(false);
diff --git a/sd/source/ui/docshell/docshel3.cxx 
b/sd/source/ui/docshell/docshel3.cxx
index f9c5eb47b5ee..a22f3376c16a 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -315,8 +315,6 @@ void DrawDocShell::Execute( SfxRequest& rReq )
 else
 lcl_setLanguage( pDoc, aNewLangTxt );
 
-mpViewShell->GetFrame()->GetBindings().Invalidate( 
SID_LANGUAGE_STATUS );
-
 if ( pDoc->GetOnlineSpell() )
 {
 pDoc->StartOnlineSpelling();
@@ -324,6 +322,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
 }
 }
 }
+Broadcast(SfxHint(SFX_HINT_LANGUAGECHANGED));
 }
 break;
 
diff --git a/sd/source/ui/docshell/docshell.cxx 
b/sd/source/ui/docshell/docshell.cxx
index 6553474cedf2..0ec666309be0 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -273,47 +273,37 @@ void DrawDocShell::GetState(SfxItemSet )
 break;
 case SID_LANGUAGE_STATUS:
 {
-if ( comphelper::LibreOfficeKit::isActive() )
+SdrObject* pObj = nullptr;
+bool bLanguageFound = false;
+OutlinerParaObject* pParaObj = nullptr;
+LanguageType eLanguage( LANGUAGE_DONTKNOW );
+sal_uInt16 nCount = mpDoc->GetPageCount();
+for ( sal_uInt16 itPage = 0; itPage < nCount && 
!bLanguageFound; itPage++ )
 {
-SdrObject* pObj = nullptr;
-bool bLanguageFound = false;
-OutlinerParaObject* pParaObj = nullptr;
-LanguageType eLanguage( LANGUAGE_DONTKNOW );
-sal_uInt16 nCount = mpDoc->GetPageCount();
-for ( sal_uInt16 itPage = 0; itPage < nCount && 
!bLanguageFound; itPage++ )
+SdrObjListIter aListIter(*mpDoc->GetPage(itPage), 
SdrIterMode::DeepWithGroups);
+while ( aListIter.IsMore() && !bLanguageFound )
 {
-SdrObjListIter aListIter(*mpDoc->GetPage(itPage), 
SdrIterMode::DeepWithGroups);
-while ( aListIter.IsMore() && !bLanguageFound )
+pObj = aListIter.Next();
+if ( pObj )
 {
-pObj = aListIter.Next();
-if ( pObj )
+pParaObj = pObj->GetOutlinerParaObject();
+if ( pParaObj )
 {
-pParaObj = pObj->GetOutlinerParaObject();
-if ( pParaObj )
-{
-SdrOutliner aOutliner(>GetPool(), 
OutlinerMode::TextObject);
-aOutliner.SetText(*pParaObj);
-eLanguage = aOutliner.GetLanguage(0, 0);
- 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-11-28 Thread Henry Castro
 sd/qa/unit/tiledrendering/data/notes-view.odp |binary
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |   29 ++
 sd/source/ui/unoidl/unomodel.cxx  |4 ---
 sd/source/ui/view/ImpressViewShellBase.cxx|   18 
 4 files changed, 39 insertions(+), 12 deletions(-)

New commits:
commit 394506840a6bfc8684e89292cefff7088557a915
Author: Henry Castro 
Date:   Tue Nov 14 16:15:52 2017 -0400

sd lok: ensure default view

In Tiled rendering case, the only default view is supported

Change-Id: Ia6df85dba28f8ebb41bdc20ae48916b0437ea185
Reviewed-on: https://gerrit.libreoffice.org/44737
Tested-by: Jenkins 
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/44744
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sd/qa/unit/tiledrendering/data/notes-view.odp 
b/sd/qa/unit/tiledrendering/data/notes-view.odp
new file mode 100644
index ..d41bdf9599a4
Binary files /dev/null and b/sd/qa/unit/tiledrendering/data/notes-view.odp 
differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 55d5712fe632..6b27320bc0d0 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "../sdmodeltestbase.hxx"
+#include 
 #include 
 #include 
 #include 
@@ -98,6 +99,7 @@ public:
 void testMultiViewInsertDeletePage();
 void testDisableUndoRepair();
 void testLanguageStatus();
+void testDefaultView();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -136,6 +138,7 @@ public:
 CPPUNIT_TEST(testMultiViewInsertDeletePage);
 CPPUNIT_TEST(testDisableUndoRepair);
 CPPUNIT_TEST(testLanguageStatus);
+CPPUNIT_TEST(testDefaultView);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1818,6 +1821,8 @@ void SdTiledRenderingTest::testDisableUndoRepair()
 CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item* >(pItem1.get()));
 CPPUNIT_ASSERT_EQUAL(static_cast(SID_REPAIRPACKAGE), 
dynamic_cast< const SfxUInt32Item * >(pItem1.get())->GetValue());
 }
+
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testLanguageStatus()
@@ -1836,6 +1841,30 @@ void SdTiledRenderingTest::testLanguageStatus()
 CPPUNIT_ASSERT(dynamic_cast< const SfxStringListItem* >(pItem1.get()));
 CPPUNIT_ASSERT(dynamic_cast< const SfxStringListItem* >(pItem2.get()));
 }
+
+comphelper::LibreOfficeKit::setActive(false);
+}
+
+void SdTiledRenderingTest::testDefaultView()
+{
+// Load the document with notes view.
+comphelper::LibreOfficeKit::setActive();
+
+SdXImpressDocument* pXImpressDocument = createDoc("notes-view.odp");
+sd::ViewShell* pView = pXImpressDocument->GetDocShell()->GetViewShell();
+{
+std::unique_ptr pItem1;
+std::unique_ptr pItem2;
+
pView->GetViewFrame()->GetBindings().QueryState(SID_NORMAL_MULTI_PANE_GUI, 
pItem1);
+pView->GetViewFrame()->GetBindings().QueryState(SID_NOTES_MODE, 
pItem2);
+const SfxBoolItem* pImpressView = dynamic_cast< const SfxBoolItem* 
>(pItem1.get());
+const SfxBoolItem* pNotesView = dynamic_cast< const SfxBoolItem* 
>(pItem2.get());
+CPPUNIT_ASSERT(pImpressView);
+CPPUNIT_ASSERT(pNotesView);
+CPPUNIT_ASSERT_EQUAL(true, pImpressView->GetValue());
+CPPUNIT_ASSERT_EQUAL(false, pNotesView->GetValue());
+}
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 6b852e2cb5bb..c844c559a642 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2445,10 +2445,6 @@ void 
SdXImpressDocument::initializeForTiledRendering(const css::uno::SequenceGetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_VIEWSHELL0,
 SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
-
 if (DrawViewShell* pViewShell = GetViewShell())
 {
 DrawView* pDrawView = pViewShell->GetDrawView();
diff --git a/sd/source/ui/view/ImpressViewShellBase.cxx 
b/sd/source/ui/view/ImpressViewShellBase.cxx
index e74440f08010..12dcfd949e32 100644
--- a/sd/source/ui/view/ImpressViewShellBase.cxx
+++ b/sd/source/ui/view/ImpressViewShellBase.cxx
@@ -19,16 +19,18 @@
 
 #include "ImpressViewShellBase.hxx"
 
-#include "DrawDocShell.hxx"
-#include "sdresid.hxx"
-#include "strings.hrc"
-#include "app.hrc"
-#include "framework/FrameworkHelper.hxx"
-#include "framework/ImpressModule.hxx"
-#include "MasterPageObserver.hxx"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 namespace sd {
 
@@ -41,7 +43,7 @@ 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-10-07 Thread Szymon Kłos
 sd/qa/unit/data/pptx/tdf104788.pptx   |binary
 sd/qa/unit/export-tests-ooxml2.cxx|   19 ++
 sd/source/filter/eppt/epptooxml.hxx   |2 -
 sd/source/filter/eppt/pptexanimations.cxx |1 
 sd/source/filter/eppt/pptx-epptooxml.cxx  |   40 --
 5 files changed, 53 insertions(+), 9 deletions(-)

New commits:
commit 02dd08fa5c3a6c6b2aaf39bdc9be5a0fe14fecd8
Author: Szymon Kłos 
Date:   Fri Sep 29 18:22:49 2017 +0200

tdf#104788 write xshear & to attribute

Change-Id: I2cdaf18424b7f2e5b5e1fe81a9f504f36773eff3
Reviewed-on: https://gerrit.libreoffice.org/42948
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/43117
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/pptx/tdf104788.pptx 
b/sd/qa/unit/data/pptx/tdf104788.pptx
new file mode 100755
index ..c46fb3da50a9
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104788.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index c1858e5a38a4..f2e36afb68a7 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -118,6 +118,7 @@ public:
 void testTdf112334();
 void testTdf112647();
 void testTdf112086();
+void testTdf104788();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -157,6 +158,7 @@ public:
 CPPUNIT_TEST(testTdf112334);
 CPPUNIT_TEST(testTdf112647);
 CPPUNIT_TEST(testTdf112086);
+CPPUNIT_TEST(testTdf104788);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1019,6 +1021,23 @@ void SdOOXMLExportTest2::testTdf112086()
 CPPUNIT_ASSERT_EQUAL(OUString("ppt_h"), sAttributeName);
 }
 
+void SdOOXMLExportTest2::testTdf104788()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104788.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+xDocShRef->DoClose();
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide6.xml");
+
+OUString sVal = getXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]",
 "to");
+CPPUNIT_ASSERT_EQUAL(OUString("-1.0"), sVal);
+
+OUString sAttributeName = getXPathContent(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:cBhvr/p:attrNameLst/p:attrName");
+CPPUNIT_ASSERT_EQUAL(OUString("xshear"), sAttributeName);
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/epptooxml.hxx 
b/sd/source/filter/eppt/epptooxml.hxx
index ebfe5d345813..52241d2d4949 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -105,7 +105,7 @@ protected:
 static void WriteAnimationAttributeName( const 
::sax_fastparser::FSHelperPtr& pFS, const OUString& rAttributeName );
 void WriteAnimationNode( const ::sax_fastparser::FSHelperPtr& pFS, const 
css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool 
bMainSeqChild );
 void WriteAnimationNodeAnimate( const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 
nXmlNodeType, bool bMainSeqChild );
-void WriteAnimationNodeAnimateInside( const ::sax_fastparser::FSHelperPtr& 
pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool 
bMainSeqChild, bool bSimple );
+void WriteAnimationNodeAnimateInside( const ::sax_fastparser::FSHelperPtr& 
pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool 
bMainSeqChild, bool bSimple, bool bWriteTo = true );
 void WriteAnimationNodeSeq( const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 
nXmlNodeType, bool bMainSeqChild );
 void WriteAnimationNodeEffect( const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 
nXmlNodeType, bool bMainSeqChild );
 void WriteAnimationNodeCommand(const ::sax_fastparser::FSHelperPtr& pFS, 
const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 
nXmlNodeType, bool bMainSeqChild );
diff --git a/sd/source/filter/eppt/pptexanimations.cxx 
b/sd/source/filter/eppt/pptexanimations.cxx
index 7a15904c7c94..0a3ab58f8459 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1409,7 +1409,6 @@ Any AnimationExporter::convertAnimateValue( const Any& 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-09-28 Thread Aron Budea
 sd/qa/unit/data/pptx/tdf111863.pptx  |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   15 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   21 +++--
 3 files changed, 26 insertions(+), 10 deletions(-)

New commits:
commit f30016d6c72e5056148e08777fb8777ffb8ad791
Author: Aron Budea 
Date:   Thu Sep 14 07:59:15 2017 +0200

tdf#111863: Animations turned from out to in during PPTX export

animEffect element's transition attribute was filled from
XTransitionFilter's Direction attribute, while it should have
been Mode.

Reviewed-on: https://gerrit.libreoffice.org/42261
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 1ea4496f3b2defaf51391e816d159717c55f2929)

Change-Id: I40be0311a7b7ffc64ac3a97a92a3ea835faa5293
Reviewed-on: https://gerrit.libreoffice.org/42825
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/sd/qa/unit/data/pptx/tdf111863.pptx 
b/sd/qa/unit/data/pptx/tdf111863.pptx
new file mode 100644
index ..19579ada5aaf
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf111863.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 2bdaa14d1691..9a19c6ec80fc 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -106,6 +106,7 @@ public:
 void testTdf92076();
 void testTdf59046();
 void testTdf105739();
+void testTdf111863();
 void testTdf111518();
 void testTdf106867();
 void testTdf112280();
@@ -143,6 +144,7 @@ public:
 CPPUNIT_TEST(testTdf92076);
 CPPUNIT_TEST(testTdf59046);
 CPPUNIT_TEST(testTdf105739);
+CPPUNIT_TEST(testTdf111863);
 CPPUNIT_TEST(testTdf111518);
 CPPUNIT_TEST(testTdf106867);
 CPPUNIT_TEST(testTdf112280);
@@ -813,6 +815,19 @@ void SdOOXMLExportTest2::testTdf105739()
 xShell->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf111863()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf111863.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+xDocShRef->DoClose();
+
+// check that transition attribute didn't change from 'out' to 'in'
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animEffect",
+"transition", "out");
+}
+
 void SdOOXMLExportTest2::testTdf111518()
 {
 sd::DrawDocShellRef xShell = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf111518.pptx"), 
PPTX);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 394ed1b4eb15..f8f22e78656b 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1454,18 +1454,19 @@ void PowerPointExport::WriteAnimationNodeSeq( const 
FSHelperPtr& pFS, const Refe
 void PowerPointExport::WriteAnimationNodeEffect( const FSHelperPtr& pFS, const 
Reference< XAnimationNode >& rXNode, sal_Int32, bool bMainSeqChild )
 {
 SAL_INFO("sd.eppt", "write animation node FILTER");
-Reference< XTransitionFilter > xFilter( rXNode, UNO_QUERY );
-if ( xFilter.is() ) {
-const char* pFilter = ::ppt::AnimationExporter::FindTransitionName( 
xFilter->getTransition(), xFilter->getSubtype(), xFilter->getDirection() );
-const char* pDirection = xFilter->getDirection() ? "in" : "out";
-pFS->startElementNS( XML_p, XML_animEffect,
- XML_filter, pFilter,
- XML_transition, pDirection,
- FSEND );
+Reference< XTransitionFilter > xFilter(rXNode, UNO_QUERY);
+if (xFilter.is())
+{
+const char* pFilter = 
::ppt::AnimationExporter::FindTransitionName(xFilter->getTransition(), 
xFilter->getSubtype(), xFilter->getDirection());
+const char* pMode = xFilter->getMode() ? "in" : "out";
+pFS->startElementNS(XML_p, XML_animEffect,
+XML_filter, pFilter,
+XML_transition, pMode,
+FSEND);
 
-WriteAnimationNodeAnimateInside( pFS, rXNode, bMainSeqChild, false );
+WriteAnimationNodeAnimateInside( pFS, rXNode, bMainSeqChild, false );
 
-pFS->endElementNS( XML_p, XML_animEffect );
+pFS->endElementNS( XML_p, XML_animEffect );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-09-23 Thread Tamás Zolnai
 sd/qa/unit/data/odp/tdf112557.odp|binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   14 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   11 +++
 3 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 65b7634ac5074aaef9b80028e4953f04270a3c3e
Author: Tamás Zolnai 
Date:   Fri Sep 22 16:12:06 2017 +0200

tdf#112557: Subtitle placeholder shape leads to corrupted PPTX file

Reviewed-on: https://gerrit.libreoffice.org/42611
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 238cfa9efa21f08514703ea6cc181ce02d8feb12)

Change-Id: I26680ecdb5f0db4f27180c221de062341af0265c
Reviewed-on: https://gerrit.libreoffice.org/42651
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/odp/tdf112557.odp 
b/sd/qa/unit/data/odp/tdf112557.odp
new file mode 100755
index ..5587e7fcef82
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf112557.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 0cea10d65a8f..13accd5e5c13 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -108,6 +108,7 @@ public:
 void testTdf106867();
 void testTdf112280();
 void testTdf112552();
+void testTdf112557();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -139,6 +140,7 @@ public:
 CPPUNIT_TEST(testTdf106867);
 CPPUNIT_TEST(testTdf112280);
 CPPUNIT_TEST(testTdf112552);
+CPPUNIT_TEST(testTdf112557);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -872,6 +874,18 @@ void SdOOXMLExportTest2::testTdf112552()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf112557()
+{
+// Subtitle shape should be skipped by export.
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf112557.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, 
"ppt/slideMasters/slideMaster1.xml");
+assertXPath(pXmlDocContent, "/p:sldMaster/p:cSld/p:spTree/p:sp", 2); // 
title and object
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 7557a73e5a4d..5d59edfebda0 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -310,8 +310,11 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape( 
const Reference< XShape >
 }
 else if ( sShapeType == "com.sun.star.presentation.SubtitleShape" )
 {
-if( !WritePlaceholder( xShape, Subtitle, mbMaster ) )
-ShapeExport::WriteTextShape( xShape );
+if(mePageType != MASTER)
+{
+if( !WritePlaceholder( xShape, Subtitle, mbMaster ) )
+ShapeExport::WriteTextShape( xShape );
+}
 }
 else
 SAL_WARN("sd.eppt", "unknown shape not handled: " << USS(sShapeType));
@@ -1911,7 +1914,7 @@ void PowerPointExport::ImplWriteSlideMaster( sal_uInt32 
nPageNum, Reference< XPr
 pFS->startElementNS( XML_p, XML_cSld, FSEND );
 
 ImplWriteBackground( pFS, aXBackgroundPropSet );
-WriteShapeTree( pFS, LAYOUT, true );
+WriteShapeTree( pFS, MASTER, true );
 
 pFS->endElementNS( XML_p, XML_cSld );
 
@@ -2068,7 +2071,7 @@ void PowerPointExport::WriteShapeTree( const FSHelperPtr& 
pFS, PageType ePageTyp
 
 ShapeExport& PowerPointShapeExport::WritePageShape( const Reference< XShape >& 
xShape, PageType ePageType, bool bPresObj )
 {
-if( ( ePageType == NOTICE && bPresObj ) || ePageType == LAYOUT )
+if( ( ePageType == NOTICE && bPresObj ) || ePageType == LAYOUT || 
ePageType == MASTER)
 return WritePlaceholderShape( xShape, SlideImage );
 
 return WriteTextShape( xShape );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-09-08 Thread Jan Holesovsky
 sd/qa/unit/data/pptx/tdf112280.pptx  |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   15 +
 sd/source/filter/eppt/pptx-epptooxml.cxx |   84 +++
 3 files changed, 89 insertions(+), 10 deletions(-)

New commits:
commit 38aa31db63b950f11af3feccb889ab34b6a6099f
Author: Jan Holesovsky 
Date:   Thu Sep 7 19:26:07 2017 +0200

tdf#112280: Export spin animation in PPTX.

Contains also:

tdf#112280: Unit test.

Change-Id: I9f13bbc2bd3a3de582491ea5b2ad16535589420a
Reviewed-on: https://gerrit.libreoffice.org/42079
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/sd/qa/unit/data/pptx/tdf112280.pptx 
b/sd/qa/unit/data/pptx/tdf112280.pptx
new file mode 100644
index ..39c2aa4cb1b8
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf112280.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 5586564a33e5..531f97b153c9 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -106,6 +106,7 @@ public:
 void testTdf105739();
 void testTdf111518();
 void testTdf106867();
+void testTdf112280();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -135,6 +136,7 @@ public:
 CPPUNIT_TEST(testTdf105739);
 CPPUNIT_TEST(testTdf111518);
 CPPUNIT_TEST(testTdf106867);
+CPPUNIT_TEST(testTdf112280);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -840,6 +842,19 @@ void SdOOXMLExportTest2::testTdf106867()
 "spid", "42");
 }
 
+void SdOOXMLExportTest2::testTdf112280()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112280.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+xDocShRef->DoClose();
+
+// check the animRot value
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animRot",
+"by", "2160");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index d4d8fe6908b4..7557a73e5a4d 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -41,12 +41,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -912,6 +914,16 @@ void PowerPointExport::WriteAnimationAttributeName( const 
FSHelperPtr& pFS, cons
 pFS->writeEscaped("ppt_y");
 pFS->endElementNS(XML_p, XML_attrName);
 }
+else if (rAttributeName == "Rotate")
+{
+pFS->startElementNS(XML_p, XML_attrName, FSEND);
+pFS->writeEscaped("r");
+pFS->endElementNS(XML_p, XML_attrName);
+}
+else
+{
+SAL_INFO("sd.eppt", "unhandled animation attribute name: " << 
rAttributeName);
+}
 
 pFS->endElementNS( XML_p, XML_attrNameLst );
 }
@@ -973,27 +985,62 @@ void PowerPointExport::WriteAnimationNodeAnimate( const 
FSHelperPtr& pFS, const
 }
 }
 
-OUString aPath;
 if (nXmlNodeType == XML_animMotion)
 {
-Reference rMotion(rXNode, UNO_QUERY);
-if (rMotion.is())
-rMotion->getPath() >>= aPath;
-}
+OUString aPath;
+Reference xMotion(rXNode, UNO_QUERY);
+if (xMotion.is())
+xMotion->getPath() >>= aPath;
 
-if (aPath.isEmpty())
+pFS->startElementNS(XML_p, nXmlNodeType,
+XML_path, OUStringToOString(aPath, 
RTL_TEXTENCODING_UTF8),
+FSEND);
+}
+else if (nXmlNodeType == XML_animRot)
 {
+// when const char* is nullptr, the attribute is completely omitted in 
the output
+const char* pBy = nullptr;
+const char* pFrom = nullptr;
+const char* pTo = nullptr;
+OString aBy, aFrom, aTo;
+
+Reference xTransform(rXNode, UNO_QUERY);
+if (xTransform.is())
+{
+double value;
+if (xTransform->getBy() >>= value)
+{
+aBy = OString::number(static_cast(value * PER_DEGREE));
+pBy = aBy.getStr();
+}
+
+if (xTransform->getFrom() >>= value)
+{
+aFrom = OString::number(static_cast(value * PER_DEGREE));
+pFrom = aFrom.getStr();
+}
+
+if (xTransform->getTo() >>= value)
+{
+aTo = OString::number(static_cast(value * PER_DEGREE));
+pTo = aTo.getStr();
+}
+}
+
 pFS->startElementNS(XML_p, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-08-25 Thread Tamás Zolnai
 sd/qa/unit/data/pptx/tdf108926.ppt |binary
 sd/qa/unit/import-tests.cxx|   19 ++
 sd/source/filter/ppt/pptin.cxx |  321 ++---
 3 files changed, 178 insertions(+), 162 deletions(-)

New commits:
commit b9763e77863cd4db843a72c3a3d7291ed8ae
Author: Tamás Zolnai 
Date:   Thu Aug 24 14:29:00 2017 +0200

tdf#108926: Notes placeholder text boxes not shown in PPTs

Regression from:
acb2943c8125f4ceed74f35f31776929dedeb8d8

Call this placeholder related code not only for
normal slide pages.

Reviewed-on: https://gerrit.libreoffice.org/41517
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit b766cab621690a3aaf4e10fcf925ebab1c1925b8)

Change-Id: Iae185ac7e5d2505554692045516cc51dbdcd735b
Reviewed-on: https://gerrit.libreoffice.org/41528
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sd/qa/unit/data/pptx/tdf108926.ppt 
b/sd/qa/unit/data/pptx/tdf108926.ppt
new file mode 100644
index ..c8455e226e1b
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf108926.ppt differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c657ebc352c1..ab58fe2fd7c0 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -149,6 +149,7 @@ public:
 void testTdf108925();
 void testTdf109223();
 void testActiveXCheckbox();
+void testTdf108926();
 
 bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, 
std::vector& rExpected);
 void testPatternImport();
@@ -217,6 +218,7 @@ public:
 CPPUNIT_TEST(testTdf108925);
 CPPUNIT_TEST(testTdf109223);
 CPPUNIT_TEST(testActiveXCheckbox);
+CPPUNIT_TEST(testTdf108926);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2240,6 +2242,23 @@ void SdImportTest::testActiveXCheckbox()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf108926()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf108926.ppt"), PPT);
+uno::Reference< presentation::XPresentationPage > xPage (getPage(0, 
xDocShRef), uno::UNO_QUERY_THROW);
+uno::Reference< drawing::XDrawPage > xNotesPage (xPage->getNotesPage(), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(static_cast(2), xNotesPage->getCount());
+
+// Second object should be imported as an empty presentation shape
+uno::Reference< beans::XPropertySet > 
xPresentationShape(xNotesPage->getByIndex(1), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xPresentationShape.is());
+bool bIsEmptyPresObject = false;
+xPresentationShape->getPropertyValue( "IsEmptyPresentationObject" )  >>= 
bIsEmptyPresObject;
+CPPUNIT_ASSERT(bIsEmptyPresObject);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index f2e90fc41cb6..755ea064ac68 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2353,212 +2353,209 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* 
pTextObj, SdrTextObj* pObj
 sal_uInt32 nPlacementId = pPlaceHolder->nPlacementId;
 PptPlaceholder nPlaceholderId = pPlaceHolder->nPlaceholderId;
 
-if ( eAktPageKind == PPT_SLIDEPAGE )
+PresObjKind ePresObjKind = PRESOBJ_NONE;
+boolbEmptyPresObj = true;
+boolbVertical = false;
+if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( 
pTextObj->GetShapeType() == mso_sptTextBox ) )
 {
-PresObjKind ePresObjKind = PRESOBJ_NONE;
-boolbEmptyPresObj = true;
-boolbVertical = false;
-if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( 
pTextObj->GetShapeType() == mso_sptTextBox ) )
+//if a placeholder with some custom attribute,the pTextObj 
will keep those attr,whose text size is zero,
+//so sdPage should renew a PresObj to process placeholder.
+bEmptyPresObj = ( pTextObj->Count() == 0 ) || ( 
pTextObj->Count() == 1 && pTextObj->First()->GetTextSize() == 0 );
+switch ( nPlaceholderId )
 {
-//if a placeholder with some custom attribute,the 
pTextObj will keep those attr,whose text size is zero,
-//so sdPage should renew a PresObj to process 
placeholder.
-bEmptyPresObj = ( pTextObj->Count() == 0 ) || ( 
pTextObj->Count() == 1 && pTextObj->First()->GetTextSize() == 0 );
-switch ( nPlaceholderId )
+case PptPlaceholder::NOTESBODY :
ePresObjKind = PRESOBJ_NOTES;   break;

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-08-10 Thread Jan Holesovsky
 sd/qa/unit/data/pptx/tdf111518.pptx  |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   16 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   71 +++
 3 files changed, 70 insertions(+), 17 deletions(-)

New commits:
commit 981f3a2c7fec50e1d80b62b669caecc14ad231b6
Author: Jan Holesovsky 
Date:   Wed Aug 9 14:52:17 2017 +0200

tdf#111518 pptx: Add support for export of p:animMotion.

Contains also the following patches:

tdf#111518 pptx: Unit test.
related tdf#111518 pptx: These attributes are not supposed to be here.

Change-Id: Idd5692c803b1e8d434abc0154419a341934d0753
Reviewed-on: https://gerrit.libreoffice.org/40972
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/sd/qa/unit/data/pptx/tdf111518.pptx 
b/sd/qa/unit/data/pptx/tdf111518.pptx
new file mode 100644
index ..a0d77617f67a
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf111518.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index e2130861e515..817cad398a13 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -104,6 +104,7 @@ public:
 void testTdf92076();
 void testTdf59046();
 void testTdf105739();
+void testTdf111518();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -131,6 +132,7 @@ public:
 CPPUNIT_TEST(testTdf92076);
 CPPUNIT_TEST(testTdf59046);
 CPPUNIT_TEST(testTdf105739);
+CPPUNIT_TEST(testTdf111518);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -790,6 +792,20 @@ void SdOOXMLExportTest2::testTdf105739()
 xShell->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf111518()
+{
+sd::DrawDocShellRef xShell = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf111518.pptx"), 
PPTX);
+utl::TempFile tempFile;
+tempFile.EnableKillingFile(false);
+xShell = saveAndReload(xShell.get(), PPTX, );
+xShell->DoClose();
+
+xmlDocPtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDocRels,
+
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animMotion",
+"path",
+"M -3.54167E-6 -4.81481E-6 L 0.39037 -0.00069");
+}
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 1a54791bb5b7..ac11c3798c0c 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -46,7 +46,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -887,18 +887,34 @@ void PowerPointExport::WriteAnimationAttributeName( const 
FSHelperPtr& pFS, cons
 
 SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName));
 
-const char* sAttributeName = nullptr;
-if ( rAttributeName == "Visibility" ) {
-sAttributeName = "style.visibility";
-} else if ( rAttributeName == "X" ) {
-sAttributeName = "ppt_x";
-} else if ( rAttributeName == "Y" ) {
-sAttributeName = "ppt_y";
+if (rAttributeName == "Visibility")
+{
+pFS->startElementNS(XML_p, XML_attrName, FSEND);
+pFS->writeEscaped("style.visibility");
+pFS->endElementNS(XML_p, XML_attrName);
+}
+else if (rAttributeName == "X")
+{
+pFS->startElementNS(XML_p, XML_attrName, FSEND);
+pFS->writeEscaped("ppt_x");
+pFS->endElementNS(XML_p, XML_attrName);
+}
+else if (rAttributeName == "Y")
+{
+pFS->startElementNS(XML_p, XML_attrName, FSEND);
+pFS->writeEscaped("ppt_y");
+pFS->endElementNS(XML_p, XML_attrName);
 }
+else if (rAttributeName == "X;Y")
+{
+pFS->startElementNS(XML_p, XML_attrName, FSEND);
+pFS->writeEscaped("ppt_x");
+pFS->endElementNS(XML_p, XML_attrName);
 
-pFS->startElementNS( XML_p, XML_attrName, FSEND );
-pFS->writeEscaped( sAttributeName );
-pFS->endElementNS( XML_p, XML_attrName );
+pFS->startElementNS(XML_p, XML_attrName, FSEND);
+pFS->writeEscaped("ppt_y");
+pFS->endElementNS(XML_p, XML_attrName);
+}
 
 pFS->endElementNS( XML_p, XML_attrNameLst );
 }
@@ -960,12 +976,29 @@ void PowerPointExport::WriteAnimationNodeAnimate( const 
FSHelperPtr& pFS, const
 }
 }
 
-pFS->startElementNS( XML_p, nXmlNodeType,
- XML_calcmode, pCalcMode,
- XML_valueType, pValueType,
- FSEND );
-WriteAnimationNodeAnimateInside( pFS, rXNode, bMainSeqChild, bSimple );
-pFS->endElementNS( XML_p, nXmlNodeType );
+OUString aPath;
+if (nXmlNodeType == XML_animMotion)
+{
+Reference rMotion(rXNode, UNO_QUERY);
+if (rMotion.is())
+rMotion->getPath() >>= aPath;

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-07-26 Thread Henry Castro
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   55 +
 sd/source/ui/view/viewshe3.cxx   |   68 ++-
 2 files changed, 91 insertions(+), 32 deletions(-)

New commits:
commit 0892238c635009a7b078a0778dbd6138e06e0ac0
Author: Henry Castro 
Date:   Tue Jun 27 20:42:11 2017 -0400

sd lok: disable undo state if conflict with other views

Change-Id: I046d118fca32c95f7734d6e29598da56578c9ec0
Reviewed-on: https://gerrit.libreoffice.org/39333
Tested-by: Jenkins 
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/39400
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 6a75280b7f4f..46dc5acf7c7c 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -95,6 +95,7 @@ public:
 void testTdf105502();
 void testCommentCallbacks();
 void testMultiViewInsertDeletePage();
+void testDisableUndoRepair();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -131,6 +132,7 @@ public:
 CPPUNIT_TEST(testTdf105502);
 CPPUNIT_TEST(testCommentCallbacks);
 CPPUNIT_TEST(testMultiViewInsertDeletePage);
+CPPUNIT_TEST(testDisableUndoRepair);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1762,6 +1764,59 @@ void 
SdTiledRenderingTest::testMultiViewInsertDeletePage()
 comphelper::LibreOfficeKit::setActive(false);
 }
 
+void SdTiledRenderingTest::testDisableUndoRepair()
+{
+// Load the document.
+comphelper::LibreOfficeKit::setActive();
+SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+SfxViewShell* pView1 = SfxViewShell::Current();
+int nView1 = SfxLokHelper::getView();
+SfxLokHelper::createView();
+SfxViewShell* pView2 = SfxViewShell::Current();
+int nView2 = SfxLokHelper::getView();
+{
+std::unique_ptr pItem1;
+std::unique_ptr pItem2;
+CPPUNIT_ASSERT(SfxItemState::DISABLED == 
pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem1));
+CPPUNIT_ASSERT(SfxItemState::DISABLED == 
pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem2));
+}
+
+// Insert a character in the first view.
+SfxLokHelper::setView(nView1);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'h', 0);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'h', 0);
+Scheduler::ProcessEventsToIdle();
+{
+std::unique_ptr pItem1;
+std::unique_ptr pItem2;
+pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem1);
+pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem2);
+CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(pItem1.get()));
+CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item* >(pItem2.get()));
+CPPUNIT_ASSERT_EQUAL(static_cast(SID_REPAIRPACKAGE), 
dynamic_cast< const SfxUInt32Item * >(pItem2.get())->GetValue());
+}
+
+// Insert a character in the second view.
+SfxLokHelper::setView(nView2);
+pXImpressDocument->setPart(1);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'c', 0);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'c', 0);
+Scheduler::ProcessEventsToIdle();
+{
+std::unique_ptr pItem1;
+std::unique_ptr pItem2;
+pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem1);
+pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem2);
+CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(pItem2.get()));
+CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item* >(pItem1.get()));
+CPPUNIT_ASSERT_EQUAL(static_cast(SID_REPAIRPACKAGE), 
dynamic_cast< const SfxUInt32Item * >(pItem1.get())->GetValue());
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx
index 6600248086f3..49d36b755214 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -125,54 +125,58 @@ void  ViewShell::GetMenuState( SfxItemSet  )
 if(SfxItemState::DEFAULT == rSet.GetItemState(SID_UNDO))
 {
 ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
-bool bActivate(false);
-
 if(pUndoManager)
 {
 if(pUndoManager->GetUndoActionCount() != 0)
 {
-bActivate = true;
+// If an 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sd/qa sd/source

2017-03-13 Thread Jan Holesovsky
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   17 +
 sd/source/ui/view/Outliner.cxx   |   10 +++---
 2 files changed, 24 insertions(+), 3 deletions(-)

New commits:
commit 73cd9f7fb898860428e1901535351083aa439c73
Author: Jan Holesovsky 
Date:   Mon Mar 13 19:03:48 2017 +0100

sd lok: Don't search on master pages & notes in Impress.

Change-Id: I43ed9f53618dca09e0289bffadc2c05056e0eebb

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 379f2fe..2f38bc3 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -72,6 +72,7 @@ public:
 void testSearchAllSelections();
 void testSearchAllNotifications();
 void testSearchAllFollowedBySearch();
+void testDontSearchInMasterPages();
 void testInsertDeletePage();
 void testInsertTable();
 void testPartHash();
@@ -106,6 +107,7 @@ public:
 CPPUNIT_TEST(testSearchAllSelections);
 CPPUNIT_TEST(testSearchAllNotifications);
 CPPUNIT_TEST(testSearchAllFollowedBySearch);
+CPPUNIT_TEST(testDontSearchInMasterPages);
 CPPUNIT_TEST(testInsertDeletePage);
 CPPUNIT_TEST(testInsertTable);
 CPPUNIT_TEST(testPartHash);
@@ -624,6 +626,21 @@ void SdTiledRenderingTest::testSearchAllFollowedBySearch()
 CPPUNIT_ASSERT_EQUAL(OString("match"), 
pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
 }
 
+void SdTiledRenderingTest::testDontSearchInMasterPages()
+{
+comphelper::LibreOfficeKit::setActive();
+SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(::callback,
 this);
+
+// This should trigger the not-found callback ("date" is present only on
+// the master page)
+lcl_search("date");
+CPPUNIT_ASSERT_EQUAL(false, m_bFound);
+
+comphelper::LibreOfficeKit::setActive(false);
+}
+
 namespace
 {
 
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 396e0ef..115addb 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1074,8 +1074,12 @@ void SdOutliner::ProvideNextTextObject()
 if (maObjectIterator != sd::outliner::OutlinerContainer(this).end())
 {
 maCurrentPosition = *maObjectIterator;
+
+// LOK: do not descent to notes or master pages when searching
+bool bForbiddenPage = comphelper::LibreOfficeKit::isActive() && 
(maCurrentPosition.mePageKind != PageKind::Standard || 
maCurrentPosition.meEditMode != EditMode::Page);
+
 // Switch to the current object only if it is a valid text object.
-if (IsValidTextObject (maCurrentPosition))
+if (!bForbiddenPage && IsValidTextObject(maCurrentPosition))
 {
 // Don't set yet in case of searching: the text object may not 
match.
 if (meMode != SEARCH)
@@ -1085,9 +1089,9 @@ void SdOutliner::ProvideNextTextObject()
 }
 ++maObjectIterator;
 
-if (mpObj != nullptr)
+if (mpObj)
 {
-PutTextIntoOutliner ();
+PutTextIntoOutliner();
 
 std::shared_ptr pViewShell 
(mpWeakViewShell.lock());
 if (pViewShell != nullptr)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits