[Libreoffice-commits] core.git: sd/qa sd/source

2023-11-19 Thread Stephan Bergmann (via logerrit)
 sd/qa/filter/eppt/eppt.cxx|4 
 sd/qa/unit/HtmlExportTest.cxx |   43 -
 sd/qa/unit/SVGExportTests.cxx |  100 +--
 sd/qa/unit/ShapeImportExportTest.cxx  |   88 +--
 sd/qa/unit/dialogs-test.cxx   |   44 -
 sd/qa/unit/export-tests-ooxml1.cxx|  387 +++---
 sd/qa/unit/export-tests-ooxml2.cxx|  673 ++
 sd/qa/unit/export-tests-ooxml3.cxx|  306 ++-
 sd/qa/unit/export-tests-ooxml4.cxx|  198 ---
 sd/qa/unit/export-tests.cxx   |  217 
 sd/qa/unit/layout-tests.cxx   |   97 ++-
 sd/qa/unit/misc-tests.cxx |3 
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   38 -
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |   36 -
 sd/source/filter/eppt/pptx-epptooxml.cxx  |2 
 sd/source/ui/app/sdmod.cxx|2 
 sd/source/ui/remotecontrol/Communicator.cxx   |8 
 sd/source/ui/remotecontrol/ImagePreparer.cxx  |4 
 sd/source/ui/view/ViewShellBase.cxx   |6 
 sd/source/ui/view/drviews1.cxx|2 
 sd/source/ui/view/drviewse.cxx|4 
 sd/source/ui/view/sdview.cxx  |2 
 22 files changed, 1205 insertions(+), 1059 deletions(-)

New commits:
commit c7526e303ff8113b6d4fdcc5b439b2ea2734cd51
Author: Stephan Bergmann 
AuthorDate: Sun Nov 19 17:31:25 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 19 20:38:53 2023 +0100

Extended loplugin:ostr: sd

Change-Id: Iadfe05a173bacd236086728ac23de1e610f0bf27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159679
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx
index 08e83053ed2f..b55a5070e696 100644
--- a/sd/qa/filter/eppt/eppt.cxx
+++ b/sd/qa/filter/eppt/eppt.cxx
@@ -88,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport)
 
 // Verify that this color is not lost:
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/theme/theme1.xml");
-assertXPath(pXmlDoc, "//a:clrScheme/a:lt1/a:srgbClr", "val",
+assertXPath(pXmlDoc, "//a:clrScheme/a:lt1/a:srgbClr"_ostr, "val"_ostr,
 "22"); // expected color 22-22-22
 
 // Check the theme after loading again
@@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation)
 // - Actual  : 0
 // - In <>, XPath '//p:cMediaNode/p:cTn' number of nodes is incorrect
 // i.e. the media node was lost on export, the video no longer looped.
-assertXPath(pXmlDoc, "//p:cMediaNode/p:cTn", "repeatCount", "indefinite");
+assertXPath(pXmlDoc, "//p:cMediaNode/p:cTn"_ostr, "repeatCount"_ostr, 
"indefinite");
 }
 }
 
diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx
index 93c1a21339d1..34b262f6e76c 100644
--- a/sd/qa/unit/HtmlExportTest.cxx
+++ b/sd/qa/unit/HtmlExportTest.cxx
@@ -26,18 +26,19 @@ public:
 save("impress_html_Export");
 htmlDocUniquePtr htmlDoc = parseHtml(maTempFile);
 
-assertXPath(htmlDoc, "/html", 1);
-assertXPath(htmlDoc, "/html/body", 1);
-assertXPath(htmlDoc, "/html/body/h1", 4);
-assertXPath(htmlDoc, "/html/body/table", 1);
-assertXPath(htmlDoc, "/html/body/table/tr", 5);
-assertXPath(htmlDoc, "/html/body/ul", 1);
-assertXPath(htmlDoc, "/html/body/ul/li", 2);
+assertXPath(htmlDoc, "/html"_ostr, 1);
+assertXPath(htmlDoc, "/html/body"_ostr, 1);
+assertXPath(htmlDoc, "/html/body/h1"_ostr, 4);
+assertXPath(htmlDoc, "/html/body/table"_ostr, 1);
+assertXPath(htmlDoc, "/html/body/table/tr"_ostr, 5);
+assertXPath(htmlDoc, "/html/body/ul"_ostr, 1);
+assertXPath(htmlDoc, "/html/body/ul/li"_ostr, 2);
 
-assertXPath(htmlDoc, "/html/head/meta[1]", "content", "text/html; 
charset=utf-8");
-assertXPath(htmlDoc, "/html/head/meta[2]", "name", "generator");
-assertXPath(htmlDoc, "/html/head/meta[3]", "name", "created");
-assertXPath(htmlDoc, "/html/head/meta[3]", "content", 
"2014-04-09T17:05:41.987922038");
+assertXPath(htmlDoc, "/html/head/meta[1]"_ostr, "content"_ostr, 
"text/html; charset=utf-8");
+assertXPath(htmlDoc, "/html/head/meta[2]"_ostr, "name"_ostr, 
"generator");
+assertXPath(htmlDoc, "/html/head/meta[3]"_ostr, "name"_ostr, 
"created");
+assertXPath(htmlDoc, "/html/head/meta[3]"_ostr, "content"_ostr,
+"2014-04-09T17:05:41.987922038");
 }
 
 void testTdf154989()
@@ -46,21 +47,23 @@ public:
 save("XHTML Draw File");
 xmlDocUniquePtr pXmlDoc = parseXml(maTempFile);
 
-assertXPath(pXmlDoc, "/xhtml:html", 1);
+assertXPath(pXmlDoc, "/xhtml:html"_ostr, 1);
 // 1 page
-assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div", 1);
+assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtm

[Libreoffice-commits] core.git: sd/qa sd/source

2023-10-20 Thread Stephan Bergmann (via logerrit)
 sd/qa/unit/SVGExportTests.cxx|2 
 sd/qa/unit/export-tests-ooxml1.cxx   |   16 +--
 sd/qa/unit/export-tests-ooxml3.cxx   |   14 +--
 sd/qa/unit/misc-tests.cxx|   67 ++-
 sd/source/console/PresenterNotesView.cxx |4 
 sd/source/filter/grf/sdgrffilter.cxx |2 
 sd/source/filter/xml/sdtransform.cxx |4 
 sd/source/filter/xml/sdxmlwrp.cxx|2 
 sd/source/ui/animations/CustomAnimationDialog.cxx|2 
 sd/source/ui/animations/CustomAnimationList.cxx  |4 
 sd/source/ui/animations/CustomAnimationPane.cxx  |4 
 sd/source/ui/controller/slidelayoutcontroller.cxx|2 
 sd/source/ui/dlg/TemplateScanner.cxx |2 
 sd/source/ui/docshell/docshel3.cxx   |8 -
 sd/source/ui/framework/factories/PresentationFactory.cxx |2 
 sd/source/ui/remotecontrol/ImagePreparer.cxx |4 
 sd/source/ui/slideshow/slideshowimpl.cxx |6 -
 sd/source/ui/tools/EventMultiplexer.cxx  |4 
 sd/source/ui/unoidl/DrawController.cxx   |2 
 sd/source/ui/unoidl/unomodel.cxx |4 
 sd/source/ui/unoidl/unoobj.cxx   |   32 +++
 sd/source/ui/unoidl/unopage.cxx  |4 
 sd/source/ui/view/DocumentRenderer.cxx   |2 
 sd/source/ui/view/drviewsf.cxx   |8 -
 24 files changed, 97 insertions(+), 104 deletions(-)

New commits:
commit c184f93863c27c5a59614ad0c47bea699abb1e7b
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:32:21 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 20 23:30:58 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: sd

Change-Id: I4dc708ee57a7e305f4e377bde0e486299df56f0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158297
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index aae0d2e00a36..713cd3b5a4d6 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -263,7 +263,7 @@ public:
 
 void testSVGPlaceholderLocale()
 {
-static constexpr OUStringLiteral aLangISO(u"it-IT");
+static constexpr OUString aLangISO(u"it-IT"_ustr);
 SvtSysLocaleOptions aSysLocaleOptions;
 aSysLocaleOptions.SetLocaleConfigString(aLangISO);
 aSysLocaleOptions.SetUILocaleConfigString(aLangISO);
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 28cba427ce26..167f67f8674e 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -1409,8 +1409,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, 
testTdf100348FontworkBitmapFill)
 // Make sure the fontwork shape has a blip bitmap fill and a colored 
outline.
 // Without the patch, fill and outline were black.
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
-static constexpr OStringLiteral sPathStart(
-"//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr");
+static constexpr OString 
sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr"_ostr);
 assertXPath(pXmlDoc, sPathStart + "/a:blipFill/a:blip", 1);
 assertXPath(pXmlDoc, sPathStart + "/a:ln/a:solidFill/a:srgbClr", "val", 
"ffbf00");
 }
@@ -1423,8 +1422,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, 
testTdf100348FontworkGradientGlow)
 // Make sure the fontwork shape has a gradient fill and a colored glow.
 // Without the patch, fill was black and no glow applied.
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
-static constexpr OStringLiteral sPathStart(
-"//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr");
+static constexpr OString 
sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr"_ostr);
 assertXPath(pXmlDoc, sPathStart + "/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", 
"val", "8d281e");
 assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow", "rad", "63360");
 assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow/a:srgbClr", "val", 
"ff4500");
@@ -1447,7 +1445,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, 
testTdf128345GradientLinear)
 
 // Make sure the shape has a lin fill. Without the patch, fill was solid 
red.
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
-static constexpr OStringLiteral 
sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill");
+static constexpr OString 
sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"_ostr);
 assertXPath(pXmlDoc, sPathStart + "/a:lin", "ang", "360");
 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2);
 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]", 

[Libreoffice-commits] core.git: sd/qa sd/source

2023-05-20 Thread Justin Luth (via logerrit)
 sd/qa/uitest/impress_tests2/tdf139511.py |2 +-
 sd/source/ui/table/tablefunction.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fc15f483988622b8e3ea2a97c9a8593f2beb18fb
Author: Justin Luth 
AuthorDate: Fri May 19 15:59:13 2023 -0400
Commit: Justin Luth 
CommitDate: Sat May 20 20:08:52 2023 +0200

tdf#139512: partial revert default row height on new sd tables

Back in 5.0, a regression caused the cell height to ignore
the font height for any empty rows. Well, of course all rows
are empty for a new table, so the table was created with only
a super tiny row height.

That 5.0 regression was properly fixed in 7.4.2 with tdf#144092,
so the height of new rows should automatically be appropriate
for the current font size.
(It was already somewhat fixed in 5.1.1 - enough for this bug.)

Thus, we can revert back to the original default size (200),
since there were complaints that my default size (2000)
was too big.

In practice, each row height will be approximately 750,
since Draw/Impress always create tables with 18pt font size.
200 is appropriate for 4pt font.

Change-Id: Ic03d94ea3557581fd96613a408ab233b2c2c6a7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152021
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/qa/uitest/impress_tests2/tdf139511.py 
b/sd/qa/uitest/impress_tests2/tdf139511.py
index 80410d3dc5b5..52e54d291516 100644
--- a/sd/qa/uitest/impress_tests2/tdf139511.py
+++ b/sd/qa/uitest/impress_tests2/tdf139511.py
@@ -23,7 +23,7 @@ class tdf139511(UITestCase):
 
 
self.xUITest.executeCommand(".uno:InsertTable?Columns:short=4&Rows:short=4")
 
-self.assertEqual(8036, 
document.DrawPages[0].getByIndex(2).BoundRect.Height)
+self.assertEqual(3885, 
document.DrawPages[0].getByIndex(2).BoundRect.Height)
 self.assertEqual(14136, 
document.DrawPages[0].getByIndex(2).BoundRect.Width)
 
 with 
self.ui_test.execute_dialog_through_command(".uno:TransformDialog") as xDialog:
diff --git a/sd/source/ui/table/tablefunction.cxx 
b/sd/source/ui/table/tablefunction.cxx
index 14080fafbbc0..67196e864b39 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -102,7 +102,7 @@ static void InsertTableImpl(const DrawViewShell* pShell,
 }
 else
 {
-Size aSize( 14100, 2000 );
+Size aSize(14100, 200);
 
 Point aPos;
 ::tools::Rectangle aWinRect(aPos, 
pShell->GetActiveWindow()->GetOutputSizePixel());


[Libreoffice-commits] core.git: sd/qa sd/source

2023-01-28 Thread Mark Hung (via logerrit)
 sd/qa/unit/export-tests-ooxml3.cxx|   10 +++---
 sd/source/filter/eppt/pptx-animations-nodectx.cxx |   20 +---
 sd/source/filter/eppt/pptx-animations-nodectx.hxx |4 
 sd/source/filter/eppt/pptx-animations.cxx |   19 ++-
 4 files changed, 46 insertions(+), 7 deletions(-)

New commits:
commit 4e6601cf1b99c1aa52934388e9cefd527389cf80
Author: Mark Hung 
AuthorDate: Sat Jan 28 18:39:49 2023 +0800
Commit: Noel Grandin 
CommitDate: Sun Jan 29 06:01:05 2023 +

tdf#124230 export subTnLst for event triggered nodes.

LibreOffice export all the child nodes of a timenode
to childTnLst. It seems that PowerPoint anticipate there
being fixed starting-time timenodes on childTnLst.
This patch export event-triggered audio time nodes to
subTnLst to make audio playback work. Other node types can
be added in the future once more test cases are found.

Change-Id: Ic96ec50876f568145bdde122d01dec10c1ac7c50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146295
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index db023bef2592..7753abe651ee 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1113,10 +1113,14 @@ void SdOOXMLExportTest3::testTdf44223()
 
 xmlDocUniquePtr pDoc1 = parseExport("ppt/slides/slide1.xml");
 
+// tdf#124230 all nodes were under p:childTnLst, but event triggered nodes 
need
+// to be under p:subTnLst, especially for audio to work correctly.
 // Start condition: 0s after timenode id 5 begins.
-assertXPath(pDoc1, "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", 
"evt", "begin");
-assertXPath(pDoc1, "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", 
"delay", "0");
-assertXPath(pDoc1, "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond/p:tn", 
"val", "5");
+assertXPath(pDoc1, 
"//p:subTnLst/p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", "evt",
+"begin");
+assertXPath(pDoc1, 
"//p:subTnLst/p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", "delay", "0");
+assertXPath(pDoc1, 
"//p:subTnLst/p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond/p:tn", "val",
+"5");
 
 xmlDocUniquePtr pDoc2 = parseExport("ppt/slides/slide2.xml");
 assertXPath(pDoc2, "//p:transition/p:sndAc/p:stSnd/p:snd[@r:embed]", 2);
diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.cxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
index 957301a5afd8..e538a0ca4e99 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.cxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
@@ -57,10 +57,11 @@ bool IsAudioURL(const OUString& rURL)
 /// Returns if rURL has an extension which is a video format.
 bool IsVideoURL(const OUString& rURL) { return 
rURL.endsWithIgnoreAsciiCase(".mp4"); }
 
-void initCondList(const Any& rAny, std::vector& rList, bool 
bIsMainSeqChild)
+bool initCondList(const Any& rAny, std::vector& rList, bool 
bIsMainSeqChild)
 {
+bool bEventTrigger = false;
 if (!rAny.hasValue())
-return;
+return false;
 
 Sequence aCondSeq;
 if (rAny >>= aCondSeq)
@@ -69,15 +70,24 @@ void initCondList(const Any& rAny, std::vector& 
rList, bool bIsMainSeqChil
 {
 Cond aCond(rCond, bIsMainSeqChild);
 if (aCond.isValid())
+{
 rList.push_back(aCond);
+if (aCond.mpEvent)
+bEventTrigger = true;
+}
 }
 }
 else
 {
 Cond aCond(rAny, bIsMainSeqChild);
 if (aCond.isValid())
+{
 rList.push_back(aCond);
+if (aCond.mpEvent)
+bEventTrigger = true;
+}
 }
+return bEventTrigger;
 }
 }
 
@@ -86,6 +96,7 @@ NodeContext::NodeContext(const Reference& 
xNode, bool bMainSeqCh
 : mxNode(xNode)
 , mbMainSeqChild(bMainSeqChild)
 , mbValid(true)
+, mbOnSubTnLst(false)
 , mnEffectNodeType(-1)
 , mnEffectPresetClass(css::presentation::EffectPresetClass::CUSTOM)
 {
@@ -95,7 +106,10 @@ NodeContext::NodeContext(const Reference& 
xNode, bool bMainSeqCh
 
 initValid(initChildNodes(), bIsIterateChild);
 
-initCondList(getNodeForCondition()->getBegin(), maBeginCondList, 
mbMainSeqChild);
+// Put event triggered Audio time nodes to SubTnLst.
+// Add other types of nodes once we find more test cases.
+mbOnSubTnLst = initCondList(getNodeForCondition()->getBegin(), 
maBeginCondList, mbMainSeqChild)
+   && mxNode->getType() == AnimationNodeType::AUDIO;
 
 initCondList(getNodeForCondition()->getEnd(), maEndCondList, 
mbMainSeqChild);
 }
diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.hxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.hxx
index e9f884063c2e..5e3ac0010602 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.hxx
+++ 

[Libreoffice-commits] core.git: sd/qa sd/source

2022-12-19 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf152335.pptx  |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   12 
 sd/source/filter/eppt/pptx-epptooxml.cxx |   11 ---
 3 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 40ea23ecdb46dfe4f4677ddbe5cb82d7f71ee592
Author: Tibor Nagy 
AuthorDate: Thu Dec 1 09:33:58 2022 +0100
Commit: László Németh 
CommitDate: Mon Dec 19 10:10:11 2022 +

tdf#152335 PPTX export: fix 3D shape properties of the shape in theme

The shapes got extra 3D shape properties by the default template,
which caused visible difference in MSO.

Follow-up to commit I02f1edea84b50dbb9b0e0a59b6062a29894afde4
(tdf#152186 PPTX export: fix shadow of the shape in theme)

Follow-up to commit 25e9766e9b87342b6f1b29dc146d5f33e12157a7
(tdf#9 PPTX export: fix line width of the shape in theme)

Change-Id: I84f931e45e7656c456fe910cbb5e09aabeb8924f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143516
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf152335.pptx 
b/sd/qa/unit/data/pptx/tdf152335.pptx
new file mode 100644
index ..03c8612bb54c
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf152335.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index d61d0c0991d4..2c3c5a0152e3 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -51,6 +51,7 @@ public:
 {
 }
 
+void testTdf152335();
 void testTdf149803();
 void testTdf149311();
 void testTdf149128();
@@ -125,6 +126,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
+CPPUNIT_TEST(testTdf152335);
 CPPUNIT_TEST(testTdf149803);
 CPPUNIT_TEST(testTdf149311);
 CPPUNIT_TEST(testTdf149128);
@@ -225,6 +227,16 @@ void checkFontAttributes(const SdrTextObj* pObj, ItemValue 
nVal, sal_uInt32 nId)
 }
 }
 
+void SdOOXMLExportTest1::testTdf152335()
+{
+createSdImpressDoc("pptx/tdf152335.pptx");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocTheme = parseExport("ppt/theme/theme1.xml");
+assertXPathChildren(
+pXmlDocTheme, 
"/a:theme/a:themeElements/a:fmtScheme/a:effectStyleLst/a:effectStyle[3]", 1);
+}
+
 void SdOOXMLExportTest1::testTdf149803()
 {
 createSdImpressDoc("pptx/tdf149803.pptx");
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 842c7944d0c3..05ec471f610f 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2048,17 +2048,6 @@ ShapeExport& 
PowerPointShapeExport::WritePlaceholderReferenceTextBody(
   \
 \
   \
-  \
-\
-  \
-\
-\
-  \
-\
-  \
-  \
-\
-  \
 \
   \
   \


[Libreoffice-commits] core.git: sd/qa sd/source

2022-11-29 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf152186.pptx  |binary
 sd/qa/unit/import-tests2.cxx |   17 +
 sd/source/filter/eppt/pptx-epptooxml.cxx |   16 ++--
 3 files changed, 19 insertions(+), 14 deletions(-)

New commits:
commit bfe33d42a2381bce194cc6fe15b830902f7c8443
Author: Tibor Nagy 
AuthorDate: Thu Nov 24 14:51:55 2022 +0100
Commit: László Németh 
CommitDate: Tue Nov 29 18:15:11 2022 +0100

tdf#152186 PPTX export: fix shadow of the shape in theme

Placeholder line styles defined extra effectStyle, resulting
bad export with shadows.

Follow-up to commit 25e9766e9b87342b6f1b29dc146d5f33e12157a7
(tdf#9 PPTX export: fix line width of the shape in theme)

Change-Id: I02f1edea84b50dbb9b0e0a59b6062a29894afde4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143233
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf152186.pptx 
b/sd/qa/unit/data/pptx/tdf152186.pptx
new file mode 100644
index ..c4160f2091a4
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf152186.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 43ea5583a579..46d1966a2e1a 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -68,6 +68,7 @@ public:
 {
 }
 
+void testTdf152186();
 void testTdf93868();
 void testTdf95932();
 void testTdf99030();
@@ -147,6 +148,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdImportTest2);
 
+CPPUNIT_TEST(testTdf152186);
 CPPUNIT_TEST(testTdf93868);
 CPPUNIT_TEST(testTdf95932);
 CPPUNIT_TEST(testTdf99030);
@@ -225,6 +227,21 @@ public:
 CPPUNIT_TEST_SUITE_END();
 };
 
+void SdImportTest2::testTdf152186()
+{
+loadFromURL(u"pptx/tdf152186.pptx");
+saveAndReload("Impress MS PowerPoint 2007 XML");
+
+bool bHasShadow;
+const SdrPage* pPage = GetPage(1);
+for (size_t i = 0; i < pPage->GetObjCount(); ++i)
+{
+uno::Reference xShape(getShapeFromPage(i, 0));
+xShape->getPropertyValue("Shadow") >>= bHasShadow;
+CPPUNIT_ASSERT(!bHasShadow);
+}
+}
+
 void SdImportTest2::testTdf93868()
 {
 createSdImpressDoc("pptx/tdf93868.pptx");
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a9edd475aeff..842c7944d0c3 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2035,22 +2035,10 @@ ShapeExport& 
PowerPointShapeExport::WritePlaceholderReferenceTextBody(
   \
   \
 \
-  \
-\
-  \
-\
-  \
-\
-  \
+  \
 \
 \
-  \
-\
-  \
-\
-  \
-\
-  \
+  \
 \
 \
   \


[Libreoffice-commits] core.git: sd/qa sd/source

2022-11-23 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf9.pptx   |binary
 sd/qa/unit/export-tests-ooxml3.cxx   |   17 +
 sd/source/filter/eppt/pptx-epptooxml.cxx |6 +++---
 3 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit 25e9766e9b87342b6f1b29dc146d5f33e12157a7
Author: Tibor Nagy 
AuthorDate: Tue Nov 8 11:57:28 2022 +0100
Commit: László Németh 
CommitDate: Wed Nov 23 10:50:59 2022 +0100

tdf#9 PPTX export: fix line width of the shape in theme

Change shape line width values of minimal office theme
to the correct 0.5, 1, 1.5 pt (from  0.7, 2, 3 pt).

Change-Id: Ied7ad2e29daed9130df8b8c8d8baf5342f1c75da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142427
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf9.pptx 
b/sd/qa/unit/data/pptx/tdf9.pptx
new file mode 100644
index ..60ec3b886fe9
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf9.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 90cf168be5a3..bc47f1936316 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -41,6 +41,7 @@ public:
 {
 }
 
+void testTdf9();
 void testTdf129430();
 void testTdf114848();
 void testTdf147586();
@@ -133,6 +134,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
 
+CPPUNIT_TEST(testTdf9);
 CPPUNIT_TEST(testTdf129430);
 CPPUNIT_TEST(testTdf114848);
 CPPUNIT_TEST(testTdf147586);
@@ -229,6 +231,20 @@ public:
 }
 };
 
+void SdOOXMLExportTest3::testTdf9()
+{
+loadFromURL(u"pptx/tdf9.pptx");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocTheme = parseExport("ppt/theme/theme1.xml");
+assertXPath(pXmlDocTheme, 
"/a:theme/a:themeElements/a:fmtScheme/a:lnStyleLst/a:ln[1]", "w",
+"6350");
+assertXPath(pXmlDocTheme, 
"/a:theme/a:themeElements/a:fmtScheme/a:lnStyleLst/a:ln[2]", "w",
+"12700");
+assertXPath(pXmlDocTheme, 
"/a:theme/a:themeElements/a:fmtScheme/a:lnStyleLst/a:ln[3]", "w",
+"19050");
+}
+
 void SdOOXMLExportTest3::testTdf129430()
 {
 loadFromURL(u"odp/tdf129430.odp");
@@ -248,6 +264,7 @@ void SdOOXMLExportTest3::testTdf114848()
 assertXPath(pXmlDocTheme1, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val",
 "1f497d");
 xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml");
+
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val",
 "1f497d");
 }
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index d08b399309d7..b31ea7de9824 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2009,7 +2009,7 @@ ShapeExport& 
PowerPointShapeExport::WritePlaceholderReferenceTextBody(
 \
   \
   \
-\
+\
   \
 \
   \
@@ -2019,14 +2019,14 @@ ShapeExport& 
PowerPointShapeExport::WritePlaceholderReferenceTextBody(
   \
   \
 \
-\
+\
   \
 \
   \
   \
   \
 \
-\
+\
   \
 \
   \


[Libreoffice-commits] core.git: sd/qa sd/source

2022-09-02 Thread Miklos Vajna (via logerrit)
 sd/qa/filter/eppt/data/video-loop.pptx|binary
 sd/qa/filter/eppt/eppt.cxx|   26 
 sd/source/filter/eppt/pptx-animations.cxx |   47 --
 3 files changed, 65 insertions(+), 8 deletions(-)

New commits:
commit 38671e21d7dbcd5019912b9468305018de0c922e
Author: Miklos Vajna 
AuthorDate: Fri Sep 2 14:19:41 2022 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 2 15:41:56 2022 +0200

Related: tdf#149969 PPTX export: add loop from the animation of a media 
shape

The PPTX import maps media nodes to XAudio nodes, but the export side in
PPTXAnimationExport::WriteAnimationNodeAudio() only handled audio, not
video.

This is fine, that code was added for audio narration purposes, but the
same animation handles looping for videos, so this needs extending.

Fix the problem by exporting  conditionally and write video
markup (especially info about repeat count) when the content of the
media shape is video, not audio.

Change-Id: Iba6bb4901b984c4363023f05232efc06ff069022
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139261
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/qa/filter/eppt/data/video-loop.pptx 
b/sd/qa/filter/eppt/data/video-loop.pptx
new file mode 100644
index ..4cb7e20b7428
Binary files /dev/null and b/sd/qa/filter/eppt/data/video-loop.pptx differ
diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx
index 1e8e2c7e1491..151b9cfce27a 100644
--- a/sd/qa/filter/eppt/eppt.cxx
+++ b/sd/qa/filter/eppt/eppt.cxx
@@ -125,6 +125,32 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport)
 // i.e. the RGB color was lost on export.
 xComponent->dispose();
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation)
+{
+// Given a media shape that has an animation that specifies looping for 
the video:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"video-loop.pptx";
+getComponent() = loadFromDesktop(aURL);
+
+// When exporting that to PPTX:
+utl::TempFile aTempFile;
+uno::Reference xStorable(getComponent(), uno::UNO_QUERY);
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("Impress Office Open XML");
+aTempFile.EnableKillingFile();
+xStorable->storeToURL(aTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
+validate(aTempFile.GetFileName(), test::OOXML);
+
+// Then make sure that the "infinite" repeat count is written:
+std::unique_ptr pStream = parseExportStream(aTempFile, 
"ppt/slides/slide1.xml");
+xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+// Without the fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// - In <>, XPath '//p:cMediaNode/p:cTn' number of nodes is incorrect
+// i.e. the media node was lost on export, the video no longer looped.
+assertXPath(pXmlDoc, "//p:cMediaNode/p:cTn", "repeatCount", "indefinite");
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index 54dab17d1972..1c901573c00a 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -659,6 +659,9 @@ bool IsAudioURL(const OUString& rURL)
 {
 return rURL.endsWithIgnoreAsciiCase(".wav") || 
rURL.endsWithIgnoreAsciiCase(".m4a");
 }
+
+/// Returns if rURL has an extension which is a video format.
+bool IsVideoURL(const OUString& rURL) { return 
rURL.endsWithIgnoreAsciiCase(".mp4"); }
 }
 
 namespace oox::core
@@ -1235,6 +1238,7 @@ void PPTXAnimationExport::WriteAnimationNodeAudio()
 bValid = true;
 }
 
+bool bVideo = false;
 if (!bValid)
 {
 if (xAudio->getSource() >>= xShape)
@@ -1243,7 +1247,8 @@ void PPTXAnimationExport::WriteAnimationNodeAudio()
 bool bHasMediaURL = 
xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL");
 if (bHasMediaURL && (xShapeProps->getPropertyValue("MediaURL") >>= 
sUrl))
 {
-bValid = IsAudioURL(sUrl);
+bVideo = IsVideoURL(sUrl);
+bValid = IsAudioURL(sUrl) || bVideo;
 }
 }
 }
@@ -1256,12 +1261,31 @@ void PPTXAnimationExport::WriteAnimationNodeAudio()
 mrPowerPointExport.embedEffectAudio(mpFS, sUrl, sRelId, sName);
 }
 
-bool bNarration = xAudio->getNarration();
-mpFS->startElementNS(XML_p, XML_audio, XML_isNarration, bNarration ? "1" : 
"0");
-bool bHideDuringShow = xAudio->getHideDuringShow();
-mpFS->startElementNS(XML_p, XML_cMediaNode, XML_showWhenStopped, 
bHideDuringShow ? "0" : "1");
+if (bVideo)
+{
+mpFS->startElementNS(XML_p, XML_video);
+mpFS->startElementNS(XML_p, XML_cMediaNode);
+}
+else
+{
+bool bNarration = xAudio->getNarration();
+mpFS->startElementNS(XML_p, XML_audio, XM

[Libreoffice-commits] core.git: sd/qa sd/source

2022-06-29 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/uiimpress.cxx   |   15 +++
 sd/source/ui/view/drviews2.cxx |   34 ++
 2 files changed, 33 insertions(+), 16 deletions(-)

New commits:
commit c09eb0f74c0a110e4a4cfc4783b59883aad30475
Author: Miklos Vajna 
AuthorDate: Wed Jun 29 08:55:17 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Jun 29 12:33:34 2022 +0200

tdf#149748 sd theme: fix crash on selecting none from color bar

Opening Impress, going to view -> color bar to enable it and then
clicking on "none" resulted in a crash.

This went wrong in commit f5db3b12ae1cd3bfe6ee5d260aec9532cc65f2dc (sd
theme: add UI (sidebar) for shape fill color, 2022-04-06), where I
assumed that in case the slot is a SID_ATTR_FILL_COLOR, then its item
set also has a SID_ATTR_FILL_COLOR key. This is usually true, but not in
case of "no color" (i.e. transparent).

Fix the problem by just skipping theming metadata for such a color.

It seems to me that the color set of a theme is not allowed to contain
such "no color" colors, so this should be safe.

Change-Id: I3fb65548dca1d78631311de56c15fdb655b9645a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136599
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 2433d7c4cb73..b309b4e4754f 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -1008,6 +1008,21 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme)
 CPPUNIT_ASSERT_EQUAL(static_cast(6000), nFillColorLumOff);
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorNoColor)
+{
+// Given an empty Impress document:
+mxComponent = loadFromDesktop("private:factory/simpress",
+  
"com.sun.star.presentation.PresentationDocument");
+auto pImpressDocument = 
dynamic_cast(mxComponent.get());
+sd::ViewShell* pViewShell = 
pImpressDocument->GetDocShell()->GetViewShell();
+SfxDispatcher* pDispatcher = pViewShell->GetViewFrame()->GetDispatcher();
+
+// When dispatching a fill color that only has a fill style (no color), 
then make sure we don't
+// crash:
+XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
+pDispatcher->ExecuteList(SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, { 
&aXFillStyleItem });
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 {
 mxComponent = loadFromDesktop("private:factory/simpress",
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index d7a6bc6a2c78..39f5458bfcd6 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -599,24 +599,26 @@ public:
 {
 // Merge the color parameters to the color itself.
 const XFillColorItem* pColorItem = static_cast(pArgs->GetItem(SID_ATTR_FILL_COLOR));
-assert(pColorItem);
-XFillColorItem aColorItem(*pColorItem);
-if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, &pItem) 
== SfxItemState::SET)
+if (pColorItem)
 {
-auto pIntItem = static_cast(pItem);
-aColorItem.GetThemeColor().SetThemeIndex(pIntItem->GetValue());
-}
-if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_MOD, false, &pItem) == 
SfxItemState::SET)
-{
-auto pIntItem = static_cast(pItem);
-aColorItem.GetThemeColor().SetLumMod(pIntItem->GetValue());
-}
-if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_OFF, false, &pItem) == 
SfxItemState::SET)
-{
-auto pIntItem = static_cast(pItem);
-aColorItem.GetThemeColor().SetLumOff(pIntItem->GetValue());
+XFillColorItem aColorItem(*pColorItem);
+if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, 
&pItem) == SfxItemState::SET)
+{
+auto pIntItem = static_cast(pItem);
+
aColorItem.GetThemeColor().SetThemeIndex(pIntItem->GetValue());
+}
+if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_MOD, false, &pItem) 
== SfxItemState::SET)
+{
+auto pIntItem = static_cast(pItem);
+aColorItem.GetThemeColor().SetLumMod(pIntItem->GetValue());
+}
+if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_OFF, false, &pItem) 
== SfxItemState::SET)
+{
+auto pIntItem = static_cast(pItem);
+aColorItem.GetThemeColor().SetLumOff(pIntItem->GetValue());
+}
+pArgs->Put(aColorItem);
 }
-pArgs->Put(aColorItem);
 }
 }
 }


[Libreoffice-commits] core.git: sd/qa sd/source svx/sdi

2022-05-25 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/uiimpress.cxx   |   16 +++-
 sd/source/ui/view/drviews2.cxx |   10 ++
 svx/sdi/svx.sdi|2 +-
 3 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 645413a14a91a72bc06acf0fb4703ff7b9fffec9
Author: Miklos Vajna 
AuthorDate: Wed May 25 20:06:36 2022 +0200
Commit: Miklos Vajna 
CommitDate: Thu May 26 08:16:29 2022 +0200

sd theme: add UI (sidebar) for shape fill color effects

Which was perhaps the last missing piece of the "sd theme: shape fill
color" story.

Change-Id: Ice75d91412aa56afe0c9995086097d491ebf7299
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134952
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index f035c1f68fac..f67d8fa32e4e 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -973,10 +973,12 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme)
  uno::UNO_QUERY);
 xController->select(uno::Any(xShape));
 
-// When setting the fill color of that shape, with theme metadata:
+// When setting the fill color of that shape, with theme metadata & 
effects:
 uno::Sequence aColorArgs = {
 comphelper::makePropertyValue("FillColor", 
static_cast(0xed7d31)), // orange
 comphelper::makePropertyValue("ColorThemeIndex", 
static_cast(4)), // accent 1
+comphelper::makePropertyValue("ColorLumMod", 
static_cast(4000)),
+comphelper::makePropertyValue("ColorLumOff", 
static_cast(6000)),
 };
 dispatchCommand(mxComponent, ".uno:FillColor", aColorArgs);
 Scheduler::ProcessEventsToIdle();
@@ -989,6 +991,18 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme)
 // - Actual  : -1
 // i.e. the theme index was lost during the dispatch of the command.
 CPPUNIT_ASSERT_EQUAL(static_cast(4), nFillColorTheme);
+
+// Then also verify the effects:
+sal_Int16 nFillColorLumMod = 1;
+xShape->getPropertyValue("FillColorLumMod") >>= nFillColorLumMod;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 4000
+// - Actual  : 1
+// i.e. the theme index was set, but not the effects.
+CPPUNIT_ASSERT_EQUAL(static_cast(4000), nFillColorLumMod);
+sal_Int16 nFillColorLumOff = 0;
+xShape->getPropertyValue("FillColorLumOff") >>= nFillColorLumOff;
+CPPUNIT_ASSERT_EQUAL(static_cast(6000), nFillColorLumOff);
 }
 
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 591b90afc3f4..a8906acfc40c 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -606,6 +606,16 @@ public:
 auto pIntItem = static_cast(pItem);
 aColorItem.GetThemeColor().SetThemeIndex(pIntItem->GetValue());
 }
+if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_MOD, false, &pItem) == 
SfxItemState::SET)
+{
+auto pIntItem = static_cast(pItem);
+aColorItem.GetThemeColor().SetLumMod(pIntItem->GetValue());
+}
+if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_OFF, false, &pItem) == 
SfxItemState::SET)
+{
+auto pIntItem = static_cast(pItem);
+aColorItem.GetThemeColor().SetLumOff(pIntItem->GetValue());
+}
 pArgs->Put(aColorItem);
 }
 }
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index b29647e07141..3c8a3642c04a 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -2781,7 +2781,7 @@ XFillBitmapItem FillPageBitmap SID_ATTR_PAGE_BITMAP
 ]
 
 XFillColorItem FillColor SID_ATTR_FILL_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, XFillColorItem FillColor 
SID_ATTR_FILL_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX)
+(SfxStringItem Color SID_ATTR_COLOR_STR, XFillColorItem FillColor 
SID_ATTR_FILL_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, 
SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff 
SID_ATTR_COLOR_LUM_OFF)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,


[Libreoffice-commits] core.git: sd/qa sd/source

2022-05-03 Thread Stephan Bergmann (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx|6 
 sd/qa/unit/export-tests-ooxml3.cxx|6 
 sd/qa/unit/export-tests.cxx   |2 
 sd/qa/unit/misc-tests.cxx |6 
 sd/qa/unit/uiimpress.cxx  |   44 ++--
 sd/source/core/CustomAnimationCloner.cxx  |   12 -
 sd/source/core/CustomAnimationEffect.cxx  |   38 ++--
 sd/source/core/EffectMigration.cxx|   10 -
 sd/source/core/sdpage_animations.cxx  |6 
 sd/source/filter/eppt/pptx-animations.cxx |2 
 sd/source/filter/eppt/pptx-epptooxml.cxx  |2 
 sd/source/filter/ppt/ppt97animations.cxx  |6 
 sd/source/filter/ppt/pptinanimations.cxx  |   32 +--
 sd/source/filter/sdpptwrp.cxx |6 
 sd/source/filter/xml/sdxmlwrp.cxx |   20 +-
 sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx |4 
 sd/source/ui/animations/CustomAnimationDialog.cxx |   89 --
 sd/source/ui/animations/CustomAnimationPane.cxx   |   54 +++---
 sd/source/ui/dlg/copydlg.cxx  |2 
 sd/source/ui/framework/factories/BasicPaneFactory.cxx |4 
 sd/source/ui/framework/module/SlideSorterModule.cxx   |4 
 sd/source/ui/framework/module/ToolBarModule.cxx   |8 
 sd/source/ui/framework/module/ViewTabBarModule.cxx|6 
 sd/source/ui/remotecontrol/Receiver.cxx   |8 
 sd/source/ui/remotecontrol/Server.cxx |4 
 sd/source/ui/sidebar/MasterPageContainer.cxx  |2 
 sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx  |2 
 sd/source/ui/slideshow/slideshowimpl.cxx  |4 
 sd/source/ui/slideshow/slideshowviewimpl.cxx  |2 
 sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx  |4 
 sd/source/ui/slidesorter/controller/SlideSorterController.cxx |4 
 sd/source/ui/tools/ConfigurationAccess.cxx|4 
 sd/source/ui/tools/EventMultiplexer.cxx   |6 
 sd/source/ui/unoidl/DrawController.cxx|   12 -
 sd/source/ui/unoidl/unomodel.cxx  |2 
 sd/source/ui/unoidl/unopage.cxx   |8 
 sd/source/ui/view/PresentationViewShellBase.cxx   |2 
 sd/source/ui/view/frmview.cxx |   76 
 sd/source/ui/view/sdview3.cxx |4 
 39 files changed, 256 insertions(+), 257 deletions(-)

New commits:
commit aebfe0e9432e37936bbdd040fe8a0f099a0d22a5
Author: Stephan Bergmann 
AuthorDate: Tue May 3 23:23:15 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 06:55:14 2022 +0200

Just use Any ctor instead of makeAny in sd

Change-Id: I0cd03dcfef02b0ef3bce6bfb88aee4c04d7f6f98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133785
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index dd3dbd286803..b9c1f437c64c 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -733,10 +733,10 @@ void SdOOXMLExportTest2::testTdf92527()
 xShape1->setPosition(awt::Point(1000, 1000));
 uno::Sequence 
aShapeGeometry(comphelper::InitPropertySequence(
 {
-{"Type", uno::makeAny(OUString("diamond"))},
+{"Type", uno::Any(OUString("diamond"))},
 }));
 uno::Reference xPropertySet1(xShape1, uno::UNO_QUERY);
-xPropertySet1->setPropertyValue("CustomShapeGeometry", 
uno::makeAny(aShapeGeometry));
+xPropertySet1->setPropertyValue("CustomShapeGeometry", 
uno::Any(aShapeGeometry));
 
 xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
 
@@ -1503,7 +1503,7 @@ void SdOOXMLExportTest2::testSmartartRotation2()
 //   code to support this for now
 uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
 uno::Sequence aInteropGrabBag;
-xShape->setPropertyValue("InteropGrabBag", uno::makeAny(aInteropGrabBag));
+xShape->setPropertyValue("InteropGrabBag", uno::Any(aInteropGrabBag));
 
 utl::TempFile tempFile;
 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 63c7ea278595..c53abe6b363a 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1306,7 +1306,7 @@ void SdOOXMLExportTest3::testTdf125360()
 
 uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
 
-xShape->setPropertyValue("FillTransparence", 
uno::makeAny(

[Libreoffice-commits] core.git: sd/qa sd/source

2022-04-14 Thread Noel Grandin (via logerrit)
 sd/qa/unit/SVGExportTests.cxx|   10 +-
 sd/qa/unit/tiledrendering/tiledrendering.cxx |4 ++--
 sd/source/ui/docshell/docshel4.cxx   |   21 +++--
 sd/source/ui/inc/DrawDocShell.hxx|2 +-
 sd/source/ui/inc/DrawViewShell.hxx   |2 +-
 sd/source/ui/inc/unopage.hxx |2 +-
 sd/source/ui/unoidl/unopage.cxx  |   10 +-
 sd/source/ui/view/drviewsh.cxx   |2 +-
 8 files changed, 27 insertions(+), 26 deletions(-)

New commits:
commit 4475483b92da89f6ab7fa503c6db920b7b50d1b7
Author: Noel Grandin 
AuthorDate: Thu Apr 14 11:48:13 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 21:13:00 2022 +0200

use more string_view in sd

Change-Id: I301f3d8a6634df8be5fdd42649c0c265da8f9099
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133004
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index d43815264d26..4878eca27972 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -46,13 +46,13 @@ bool isValidBitmapId(const OUString& sId)
 return std::regex_match(sId.toUtf8().getStr(), aRegEx);
 }
 
-BitmapChecksum getBitmapChecksumFromId(const OUString& sId)
+BitmapChecksum getBitmapChecksumFromId(std::u16string_view sId)
 {
-sal_Int32 nStart = sId.indexOf("(") + 1;
-sal_Int32 nCount = sId.indexOf(")") - nStart;
-bool bIsValidRange = nStart > 0 && nCount > 0;
+size_t nStart = sId.find(u"(") + 1;
+size_t nCount = sId.find(u")") - nStart;
+bool bIsValidRange = nStart > 0 && nStart != std::u16string_view::npos && 
nCount > 0;
 CPPUNIT_ASSERT(bIsValidRange);
-OUString sChecksum = sId.copy( nStart, nCount );
+OUString sChecksum( sId.substr( nStart, nCount ) );
 return sChecksum.toUInt64();
 }
 
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 4207f6bbce7f..9ce85a102f83 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2676,9 +2676,9 @@ void SdTiledRenderingTest::testSlideDuplicateUndo()
 namespace
 {
 
-void lcl_extractHandleParameters(const OString& selection, sal_uInt32& id, 
sal_uInt32& x, sal_uInt32& y)
+void lcl_extractHandleParameters(std::string_view selection, sal_uInt32& id, 
sal_uInt32& x, sal_uInt32& y)
 {
-OString extraInfo = selection.copy(selection.indexOf("{"));
+OString extraInfo( selection.substr(selection.find("{")) );
 std::stringstream aStream(extraInfo.getStr());
 boost::property_tree::ptree aTree;
 boost::property_tree::read_json(aStream, aTree);
diff --git a/sd/source/ui/docshell/docshel4.cxx 
b/sd/source/ui/docshell/docshel4.cxx
index 6150321ca33a..6fe599e44197 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -72,6 +72,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -698,7 +699,7 @@ SfxStyleSheetBasePool* DrawDocShell::GetStyleSheetPool()
 return mpDoc->GetStyleSheetPool();
 }
 
-void DrawDocShell::GotoBookmark(const OUString& rBookmark)
+void DrawDocShell::GotoBookmark(std::u16string_view rBookmark)
 {
 auto pDrawViewShell = dynamic_cast( mpViewShell );
 if (!pDrawViewShell)
@@ -710,28 +711,28 @@ void DrawDocShell::GotoBookmark(const OUString& rBookmark)
 sal_uInt16 nPageNumber = SDRPAGE_NOTFOUND;
 SdrObject* pObj = nullptr;
 
-static const OUStringLiteral sInteraction( u"action?" );
-if ( rBookmark.match( sInteraction ) )
+static constexpr std::u16string_view sInteraction( u"action?" );
+if ( o3tl::starts_with(rBookmark, sInteraction ) )
 {
-static const OUStringLiteral sJump( u"jump=" );
-if ( rBookmark.match( sJump, sInteraction.getLength() ) )
+static constexpr std::u16string_view sJump( u"jump=" );
+if ( o3tl::starts_with(rBookmark.substr( sInteraction.size() ), sJump 
) )
 {
-OUString aDestination( rBookmark.copy( sInteraction.getLength() + 
sJump.getLength() ) );
-if ( aDestination.match( "firstslide" ) )
+std::u16string_view aDestination( rBookmark.substr( 
sInteraction.size() + sJump.size() ) );
+if ( o3tl::starts_with(aDestination, u"firstslide" ) )
 {
 nPageNumber = 1;
 }
-else if ( aDestination.match( "lastslide" ) )
+else if ( o3tl::starts_with(aDestination, u"lastslide" ) )
 {
 nPageNumber = mpDoc->GetPageCount() - 2;
 }
-else if ( aDestination.match( "previousslide" ) )
+else if ( o3tl::starts_with(aDestination, u"previousslide" ) )
 {
 SdPage* pPage = pDrawViewShell->GetActualPage();
 nPageNumber = pPage->GetPageNum();
 nPageNumber = nPageNumber > 2 ? nPageNumber - 2 : 
S

[Libreoffice-commits] core.git: sd/qa sd/source svx/sdi

2022-04-06 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/uiimpress.cxx   |   32 
 sd/source/ui/view/drviews2.cxx |   13 +
 svx/sdi/svx.sdi|2 +-
 3 files changed, 46 insertions(+), 1 deletion(-)

New commits:
commit f5db3b12ae1cd3bfe6ee5d260aec9532cc65f2dc
Author: Miklos Vajna 
AuthorDate: Wed Apr 6 20:14:52 2022 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 7 08:15:48 2022 +0200

sd theme: add UI (sidebar) for shape fill color

This requires extending .uno:FillColor with a new parameter, and then
merging that parameter into the fill color item in sd/. The sidebar's
color picker already generated these parameters.

Change-Id: I83e3c4fc37b8d7bd34f0ef9c0cb96e164f7f0b99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132646
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index f56a0444c351..41664efb3497 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -959,6 +959,38 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testCharColorTheme)
 CPPUNIT_ASSERT_EQUAL(static_cast(8000), nCharColorLumOff);
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme)
+{
+// Given an Impress document with a selected shape:
+mxComponent = loadFromDesktop("private:factory/simpress",
+  
"com.sun.star.presentation.PresentationDocument");
+uno::Reference xPagesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xPage(xPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape(xPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xController(xModel->getCurrentController(),
+ uno::UNO_QUERY);
+xController->select(uno::makeAny(xShape));
+
+// When setting the fill color of that shape, with theme metadata:
+uno::Sequence aColorArgs = {
+comphelper::makePropertyValue("FillColor", 
static_cast(0xed7d31)), // orange
+comphelper::makePropertyValue("ColorThemeIndex", 
static_cast(4)), // accent 1
+};
+dispatchCommand(mxComponent, ".uno:FillColor", aColorArgs);
+Scheduler::ProcessEventsToIdle();
+
+// Then make sure the theme index is not lost when the sidebar sets it:
+sal_Int16 nFillColorTheme{};
+xShape->getPropertyValue("FillColorTheme") >>= nFillColorTheme;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 4
+// - Actual  : -1
+// i.e. the theme index was lost during the dispatch of the command.
+CPPUNIT_ASSERT_EQUAL(static_cast(4), nFillColorTheme);
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 {
 mxComponent = loadFromDesktop("private:factory/simpress",
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index bef73c1726d3..2141cc9b1a3c 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -594,6 +594,19 @@ public:
 pArgs->Put(aItem);
 }
 }
+
+if (nSlot == SID_ATTR_FILL_COLOR)
+{
+// Merge the color parameters to the color itself.
+XFillColorItem aColorItem(
+*static_cast(pArgs->GetItem(SID_ATTR_FILL_COLOR)));
+if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, &pItem) 
== SfxItemState::SET)
+{
+auto pIntItem = static_cast(pItem);
+aColorItem.GetThemeColor().SetThemeIndex(pIntItem->GetValue());
+}
+pArgs->Put(aColorItem);
+}
 }
 }
 
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index b4e3e50a2602..b29647e07141 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -2781,7 +2781,7 @@ XFillBitmapItem FillPageBitmap SID_ATTR_PAGE_BITMAP
 ]
 
 XFillColorItem FillColor SID_ATTR_FILL_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, XFillColorItem FillColor 
SID_ATTR_FILL_COLOR)
+(SfxStringItem Color SID_ATTR_COLOR_STR, XFillColorItem FillColor 
SID_ATTR_FILL_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,


[Libreoffice-commits] core.git: sd/qa sd/source

2022-03-25 Thread Gülşah Köse (via logerrit)
 sd/qa/unit/data/pptx/deftabstop.pptx |binary
 sd/qa/unit/import-tests2.cxx |   14 ++
 sd/source/ui/docshell/docshel4.cxx   |   12 
 3 files changed, 26 insertions(+)

New commits:
commit 362fb6c7b13d5506c6bd9d1b7f113ec45544809d
Author: Gülşah Köse 
AuthorDate: Thu Mar 24 11:19:03 2022 +0300
Commit: Gülşah Köse 
CommitDate: Fri Mar 25 08:25:49 2022 +0100

tdf#96389 Use default tab stop value of MSO for pptx import.

Change-Id: Ib3dde68c672b44d8b60f121fb0e637942b5986b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131698
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/sd/qa/unit/data/pptx/deftabstop.pptx 
b/sd/qa/unit/data/pptx/deftabstop.pptx
new file mode 100644
index ..5cfe71794446
Binary files /dev/null and b/sd/qa/unit/data/pptx/deftabstop.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 2654e6f6290e..7a67debd38d9 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -129,6 +129,7 @@ public:
 void testHyperlinksOnShapes();
 void testTdf112209();
 void testTdf128596();
+void testDefaultTabStop();
 
 CPPUNIT_TEST_SUITE(SdImportTest2);
 
@@ -194,6 +195,7 @@ public:
 CPPUNIT_TEST(testHyperlinksOnShapes);
 CPPUNIT_TEST(testTdf112209);
 CPPUNIT_TEST(testTdf128596);
+CPPUNIT_TEST(testDefaultTabStop);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1907,6 +1909,18 @@ void SdImportTest2::testTdf128596()
 xDocShRef->DoClose();
 }
 
+void SdImportTest2::testDefaultTabStop()
+{
+sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/deftabstop.pptx"), 
PPTX);
+SdDrawDocument* pDoc = xDocShRef->GetDoc();
+sal_Int32 nDefTab = pDoc->GetDefaultTabulator();
+
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), nDefTab);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/docshell/docshel4.cxx 
b/sd/source/ui/docshell/docshel4.cxx
index bed18cbddf70..6150321ca33a 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -399,6 +399,18 @@ bool DrawDocShell::ImportFrom(SfxMedium &rMedium,
 mpDoc->SetSummationOfParagraphs();
 }
 
+if (aFilterName == "Impress MS PowerPoint 2007 XML" ||
+aFilterName == "Impress MS PowerPoint 2007 XML AutoPlay" ||
+aFilterName == "Impress MS PowerPoint 2007 XML VBA" ||
+aFilterName == "Impress Office Open XML")
+{
+// We need to be able to set the default tab size for each text object.
+// This is possible at the moment only for the whole document. See
+// TextParagraphPropertiesContext constructor. So default tab width
+// of the LibreOffice is 1270 but MSO is 2540 on general settings.
+mpDoc->SetDefaultTabulator( 2540 );
+}
+
 const bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition);
 
 SfxItemSet* pSet = rMedium.GetItemSet();


[Libreoffice-commits] core.git: sd/qa sd/source

2022-03-05 Thread Andreas Heinisch (via logerrit)
 sd/qa/unit/uiimpress.cxx   |   31 +++
 sd/source/ui/view/drviewse.cxx |4 ++--
 2 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit 9d25f86236885c40662bcd24517f231688361e8c
Author: Andreas Heinisch 
AuthorDate: Mon Feb 28 18:40:30 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Sat Mar 5 13:08:53 2022 +0100

tdf#38669 - Create the key event using a Unicode character

Instead of using a plain char, create a key event using a Unicode
character, otherwise the key event creates texts including rectangles or
wrong characters.

Change-Id: I9ec0d64998927d54eb3ae90a192c3b28e235f56d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130721
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 52210ca995f7..f56a0444c351 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -782,6 +782,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testSpellOnlineParameter)
 CPPUNIT_ASSERT_EQUAL(!bSet, pImpressDocument->GetDoc()->GetOnlineSpell());
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf38669)
+{
+mxComponent = loadFromDesktop("private:factory/simpress",
+  
"com.sun.star.presentation.PresentationDocument");
+auto pImpressDocument = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pImpressDocument);
+
+// Insert shape with ctrl key
+uno::Sequence aArgs(
+comphelper::InitPropertySequence({ { "KeyModifier", 
uno::makeAny(KEY_MOD1) } }));
+dispatchCommand(mxComponent, ".uno:BasicShapes.rectangle", aArgs);
+Scheduler::ProcessEventsToIdle();
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference xDraws = 
xDrawPagesSupplier->getDrawPages();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
+
+// Insert an UTF-8 character (176 is the code of the degree sign, i.e., 
'°')
+pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 176, 0);
+pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 176, 0);
+Scheduler::ProcessEventsToIdle();
+
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape(xDrawPage->getByIndex(2), 
uno::UNO_QUERY);
+// Without the fix in place, this test would have failed with:
+// - Expected: °
+// - Actual  : ㅀ
+CPPUNIT_ASSERT_EQUAL(OUString(u"°"), xShape->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123841)
 {
 // To check if selecting unfilled rectangle produces unfilled rectangle
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 0b7be81d1845..64e9e88b5396 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -127,9 +127,9 @@ static void ImpAddPrintableCharactersToTextEdit(SfxRequest 
const & rReq, ::sd::V
 {
 for(sal_Int32 a(0); a < aInputString.getLength(); a++)
 {
-char aChar = static_cast(aInputString[a]);
 vcl::KeyCode aKeyCode;
-KeyEvent aKeyEvent(aChar, aKeyCode);
+// tdf#38669 - create the key event using a Unicode character
+KeyEvent aKeyEvent(aInputString[a], aKeyCode);
 
 // add actual character
 pOLV->PostKeyEvent(aKeyEvent);


[Libreoffice-commits] core.git: sd/qa sd/source svx/source sw/inc sw/source

2022-03-02 Thread Armin Le Grand (Allotropia) (via logerrit)
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   31 ++--
 sd/source/ui/view/drviewsj.cxx   |9 +++
 svx/source/svdraw/svdedtv.cxx|8 +++
 svx/source/svdraw/svdpagv.cxx|   65 +--
 sw/inc/fesh.hxx  |2 
 sw/source/core/frmedt/feshview.cxx   |   14 -
 sw/source/uibase/shells/drwbassh.cxx |8 +--
 7 files changed, 72 insertions(+), 65 deletions(-)

New commits:
commit e8a004d54dc939b257b2851a78c324269e2a3973
Author: Armin Le Grand (Allotropia) 
AuthorDate: Fri Feb 25 18:46:23 2022 +0100
Commit: Armin Le Grand 
CommitDate: Wed Mar 2 11:55:07 2022 +0100

Advanced Diagram support: Disable enter Diagram (Groups)

Groups which are in Diagram mode should not be entered, to
do so disable at UI and - for security reasons - also at
the executing mehod.
Groups in Diagram mode can still be UnGrouped (which will
remove the Diagram status & data)

Adapted testRegenerateDiagram() to directly act on the
model data to test the same as before. Using triggering
of UI events to enter the diagram group object needs
reorganization, but model op's will always be possible

Change-Id: I199f3821c2a8308a6f015997ce9eaef87623c46a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130541
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 56487deb5c76..5fabb1fe3038 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2581,31 +2581,12 @@ void SdTiledRenderingTest::testRegenerateDiagram()
 SdPage* pActualPage = 
pXImpressDocument->GetDocShell()->GetViewShell()->GetActualPage();
 CPPUNIT_ASSERT_EQUAL(static_cast(4), 
pActualPage->GetObj(0)->GetSubList()->GetObjCount());
 
-// select diagram
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
-Scheduler::ProcessEventsToIdle();
-
-// enter group
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::F3);
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::F3);
-Scheduler::ProcessEventsToIdle();
-
-// select shape and delete
-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);
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 
awt::Key::DELETE);
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DELETE);
-Scheduler::ProcessEventsToIdle();
-
-// exit group
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | 
awt::Key::F3);
-pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | 
awt::Key::F3);
-Scheduler::ProcessEventsToIdle();
+// For new Diagram funcionality entering group using UI is not allowed as 
long
+// as the group shape is a diagram. Do the same as before done by 
triggering UI
+// events directly in the model
+// Remove and free top-left entry (Box showing "A")
+SdrObject* pTopLeftRemoved = 
pActualPage->GetObj(0)->GetSubList()->RemoveObject(1);
+SdrObject::Free(pTopLeftRemoved);
 
 // select diagram
 pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index 9f9a52012c3d..40dd8dca8214 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -132,12 +132,19 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
 
 /* If it is not a group object or 3D object, we disable "enter
group". */
-if( !( ( dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr && 
nInv == SdrInventor::Default ) ||
+const auto* pIsGroup(dynamic_cast(pObj));
+if( !( ( pIsGroup != nullptr && nInv == SdrInventor::Default ) ||
( dynamic_cast< const E3dScene* >(pObj) != nullptr ) ) )
 {
 rSet.DisableItem( SID_ENTER_GROUP );
 }
 
+// Don't allow enter Diagrams
+if(nullptr != pIsGroup && pIsGroup->isDiagram())
+{
+rSet.DisableItem( SID_ENTER_GROUP );
+}
+
 // If it is not a group object, we disable "ungroup"
 if(dynamic_cast< const SdrObjGroup *>( pObj ) == nullptr || nInv 
!= SdrInventor::Default)
 {
diff --git a/svx/

[Libreoffice-commits] core.git: sd/qa sd/source

2022-02-05 Thread Justin Luth (via logerrit)
 sd/qa/unit/uiimpress.cxx   |2 +-
 sd/source/ui/view/Outliner.cxx |8 
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 5f4ebedcd010f8248d9eea93bd36142a64820fe5
Author: Justin Luth 
AuthorDate: Fri Jan 21 11:08:46 2022 +0200
Commit: Justin Luth 
CommitDate: Sat Feb 5 20:02:39 2022 +0100

tdf#123658 sd search: restart search start on slide change

When the user switches between slides and then re-starts a search,
they expect that the search will begin on the current slide.

This fixes a somewhat 5.2 regression. Before that time, the first
search attempt failed, but the second attempt started
at the current slide. After 5.2 fixed the first-attempt-failure,
the starting position was "the slide after the last find".

This patch resets the starting position to the current slide,
which I saw was done in every case by DetectChange().
I thought about moving all this logic into DetectChange,
but it doesn't make much sense to affect a spell-checking
dialog run by moving around in the slides,
so just keep the logic here.

I submitted the unit test in a PRIOR patch.
The basic search was failing on WIN/MAC platforms
and so I wanted to confirm that this was NOT my fault.
Indeed, on those OSes the testing fails,
so I just run it under Linux where it works fine.

Change-Id: I4d1af3049bb2c0a59ec46f005c4b1773aefffb6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129204
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index fcaa970cc929..0c3930457776 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -869,7 +869,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testTdf123658_SearchAfterSlideChange)
 lcl_search("of");
 // Instead of finding this on the 1st page (or on the 2nd page would be 
acceptable too)
 // it was going to the third page.
-//checkCurrentPageNumber(1);
+checkCurrentPageNumber(1);
 }
 #endif
 
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0e9b2fba833f..e03b56bf1a3d 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -809,6 +809,14 @@ bool 
SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti
 
 if (!getOutlinerView() || 
!GetEditEngine().HasView(&getOutlinerView()->GetEditView()))
 {
+std::shared_ptr pDrawViewShell (
+std::dynamic_pointer_cast(pViewShell));
+
+// Perhaps the user switched to a different page/slide between 
searches.
+// If so, reset the starting search position to the current slide like 
DetectChange does
+if (pDrawViewShell && pDrawViewShell->GetCurPagePos() != 
maCurrentPosition.mnPageIndex)
+maObjectIterator = sd::outliner::OutlinerContainer(this).current();
+
 mpImpl->ProvideOutlinerView(*this, pViewShell, mpWindow);
 }
 


[Libreoffice-commits] core.git: sd/qa sd/source

2022-01-31 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/export-tests-ooxml1.cxx   |   14 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   10 +-
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit b1865ecd67a4ea791ac24e3234d4ad3d2be9d1e3
Author: Tibor Nagy 
AuthorDate: Mon Jan 3 17:18:57 2022 +0100
Commit: László Németh 
CommitDate: Mon Jan 31 17:06:40 2022 +0100

tdf#130165 PPTX export: fix master objects visible property

Follow-up to commit 4574a1ea408c2ac30042dca32d02207ec7add4da
"tdf#146223 PPTX import: fix master objects visible property".

Change-Id: I34e6132837d6c84974f8446978c59226a9a7d2d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127908
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 7631b3113bbd..76e54f62ea1b 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -48,6 +48,7 @@ using namespace css;
 class SdOOXMLExportTest1 : public SdModelTestBaseXML
 {
 public:
+void testTdf130165();
 void testTdf124781();
 void testTdf144914();
 void testTdf124232();
@@ -115,6 +116,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
+CPPUNIT_TEST(testTdf130165);
 CPPUNIT_TEST(testTdf124781);
 CPPUNIT_TEST(testTdf144914);
 CPPUNIT_TEST(testTdf124232);
@@ -209,6 +211,18 @@ void checkFontAttributes( const SdrTextObj* pObj, 
ItemValue nVal, sal_uInt32 nId
 
 }
 
+void SdOOXMLExportTest1::testTdf130165()
+{
+sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf146223.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDoc, "/p:sld", "showMasterSp", "0");
+}
+
 void SdOOXMLExportTest1::testTdf124781()
 {
 sd::DrawDocShellRef xDocShRef
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index b728278c843f..f6e78d357ead 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1361,6 +1361,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 
nPageNum, sal_uInt32 nMasterNum
 mpSlidesFSArray[ nPageNum ] = pFS;
 
 const char* pShow = nullptr;
+const char* pShowMasterShape = nullptr;
 
 if (ImplGetPropertyValue(mXPagePropSet, "Visible"))
 {
@@ -1369,7 +1370,14 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 
nPageNum, sal_uInt32 nMasterNum
 pShow = "0";
 }
 
-pFS->startElementNS(XML_p, XML_sld, PNMSS, XML_show, pShow);
+if (ImplGetPropertyValue(mXPagePropSet, "IsBackgroundObjectsVisible"))
+{
+bool bShowMasterShape(false);
+if ((mAny >>= bShowMasterShape) && !bShowMasterShape)
+pShowMasterShape = "0";
+}
+
+pFS->startElementNS(XML_p, XML_sld, PNMSS, XML_show, pShow, 
XML_showMasterSp, pShowMasterShape);
 
 pFS->startElementNS(XML_p, XML_cSld);
 


[Libreoffice-commits] core.git: sd/qa sd/source

2022-01-22 Thread Caolán McNamara (via logerrit)
 sd/qa/unit/data/ppt/pass/ofz43902-1.ppt |binary
 sd/source/filter/ppt/pptatom.cxx|3 ++-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3cf12be142b4455026112192e2a3cc39e66d2a2c
Author: Caolán McNamara 
AuthorDate: Fri Jan 21 20:56:11 2022 +
Commit: Caolán McNamara 
CommitDate: Sat Jan 22 11:44:22 2022 +0100

ofz#43902 Timeout/Hang

Change-Id: I87a8f3856f82de060bfb4b6cc4abec482c7462e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128746
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/qa/unit/data/ppt/pass/ofz43902-1.ppt 
b/sd/qa/unit/data/ppt/pass/ofz43902-1.ppt
new file mode 100644
index ..44d81a951491
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/ofz43902-1.ppt differ
diff --git a/sd/source/filter/ppt/pptatom.cxx b/sd/source/filter/ppt/pptatom.cxx
index 20d52eb8c63f..24d87f040152 100644
--- a/sd/source/filter/ppt/pptatom.cxx
+++ b/sd/source/filter/ppt/pptatom.cxx
@@ -58,7 +58,8 @@ Atom::Atom( const DffRecordHeader& rRecordHeader, SvStream& 
rStream )
 }
 }
 
-maRecordHeader.SeekToEndOfRecord( mrStream );
+if (!maRecordHeader.SeekToEndOfRecord(mrStream))
+mrStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
 }
 
 Atom::~Atom()


[Libreoffice-commits] core.git: sd/qa sd/source

2021-12-01 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx   |7 ++
 sd/source/filter/eppt/epptooxml.hxx  |   13 -
 sd/source/filter/eppt/pptx-epptooxml.cxx |   75 ---
 3 files changed, 88 insertions(+), 7 deletions(-)

New commits:
commit 5b253b2197e957fb5e42e3d0e233c10ac83afc10
Author: Miklos Vajna 
AuthorDate: Wed Dec 1 11:48:17 2021 +0100
Commit: Miklos Vajna 
CommitDate: Wed Dec 1 13:14:27 2021 +0100

PPTX export: write the theme for the master pages from the doc model

The instant benefit is that now the name of the theme and the color
scheme are preserved, but this will also take changes done on the UI
into account (which is not true for the grab-bag).

Change-Id: I162eb7275d5a69d66db71fc5cd6e2e3ec94725bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126164
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 1951d2f9eae6..4b980cafdfa6 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1608,6 +1608,13 @@ void SdOOXMLExportTest2::testAccentColor()
 assertXPath(pXmlDocTheme1, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "70ad47");
 xmlDocUniquePtr pXmlDocTheme2 = parseExport(tempFile, 
"ppt/theme/theme2.xml");
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: Motyw pakietu Office
+// - Actual  : Office Theme
+// i.e. the theme and color scheme name was lost on export.
+assertXPath(pXmlDocTheme1, "/a:theme", "name", "Motyw pakietu Office");
+assertXPath(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme", "name", 
"Pakiet Office");
 }
 
 void SdOOXMLExportTest2::testThemeColors()
diff --git a/sd/source/filter/eppt/epptooxml.hxx 
b/sd/source/filter/eppt/epptooxml.hxx
index 0c7e098f5771..5ee3248ec81e 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -26,6 +26,11 @@
 
 using ::sax_fastparser::FSHelperPtr;
 
+namespace svx
+{
+class Theme;
+}
+
 namespace oox::core {
 
 struct LayoutInfo
@@ -85,9 +90,15 @@ private:
 virtual void ImplWriteNotes( sal_uInt32 nPageNum ) override;
 virtual void ImplWriteSlideMaster( sal_uInt32 nPageNum, 
css::uno::Reference< css::beans::XPropertySet > const & aXBackgroundPropSet ) 
override;
 void ImplWritePPTXLayout( sal_Int32 nOffset, sal_uInt32 nMasterNum );
+
+/// Export the color set part of a theme.
+static bool WriteColorSets(const FSHelperPtr& pFS, svx::Theme* pTheme);
+
+/// Same as WriteColorSets(), but works from a grab-bag.
 bool WriteColorSchemes(const FSHelperPtr& pFS, const OUString& rThemePath);
+
 static void WriteDefaultColorSchemes(const FSHelperPtr& pFS);
-void WriteTheme( sal_Int32 nThemeNum );
+void WriteTheme( sal_Int32 nThemeNum, svx::Theme* pTheme );
 
 virtual bool ImplCreateDocument() override;
 virtual bool ImplCreateMainNotes() override;
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index d5787d6f4cb7..ef36db9b4ac4 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1482,8 +1482,15 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 
nPageNum, Reference< XPro
   OUString::number(nPageNum + 1) + 
".xml",
  
"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml");
 
+SdrPage* pMasterPage = SdPage::getImplementation(mXDrawPage);
+svx::Theme* pTheme = nullptr;
+if (pMasterPage)
+{
+pTheme = pMasterPage->getSdrPageProperties().GetTheme();
+}
+
 // write theme per master
-WriteTheme(nPageNum);
+WriteTheme(nPageNum, pTheme);
 
 // add implicit relation to the presentation theme
 addRelation(pFS->getOutputStream(),
@@ -2130,6 +2137,48 @@ void PowerPointExport::WriteDefaultColorSchemes(const 
FSHelperPtr& pFS)
 }
 }
 
+bool PowerPointExport::WriteColorSets(const FSHelperPtr& pFS, svx::Theme* 
pTheme)
+{
+static std::map aPredefinedClrTokens =
+{
+// dk1 and lt1 is intentionally missing.
+{ dk2, XML_dk2 },
+{ lt2, XML_lt2 },
+{ accent1, XML_accent1 },
+{ accent2, XML_accent2 },
+{ accent3, XML_accent3 },
+{ accent4, XML_accent4 },
+{ accent5, XML_accent5 },
+{ accent6, XML_accent6 },
+{ hlink, XML_hlink },
+{ folHlink, XML_folHlink }
+};
+
+if (!pTheme)
+{
+return false;
+}
+
+svx::ColorSet* pColorSet = pTheme->GetColorSet();
+if (!pColorSet)
+{
+return false;
+}
+
+for (int nId = PredefinedClrSchemeId::dk2; nId < 
PredefinedClrSchemeId::Count; nId++)
+ 

[Libreoffice-commits] core.git: sd/qa sd/source

2021-11-24 Thread Tünde Tóth (via logerrit)
 sd/qa/uitest/impress_tests/save_readonly_with_password.py |   47 +
 sd/source/filter/eppt/epptooxml.hxx   |2 
 sd/source/filter/eppt/pptx-epptooxml.cxx  |   71 ++
 3 files changed, 120 insertions(+)

New commits:
commit 04e279007272de286be31152d01e9cb45c9bd3e3
Author: Tünde Tóth 
AuthorDate: Wed Nov 3 12:59:47 2021 +0100
Commit: László Németh 
CommitDate: Wed Nov 24 09:19:18 2021 +0100

tdf#145511 PPTX: export the password for editing

The password for editing wasn't exported in PPTX
documents.

Test: Edit->Edit Mode doesn't change to edit mode
any more without asking the password for editing.

Follow-up to commit 5697e09b3e726a38b58ce31ac0c3a97e7871c74a
"tdf#144943 PPTX import: fix permission for editing".

Change-Id: I1a9de511cf8b79224d8ac0a9aa0bf860b87bf184
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124651
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/uitest/impress_tests/save_readonly_with_password.py 
b/sd/qa/uitest/impress_tests/save_readonly_with_password.py
index 3f789035d0a8..cd4fe98339c0 100644
--- a/sd/qa/uitest/impress_tests/save_readonly_with_password.py
+++ b/sd/qa/uitest/impress_tests/save_readonly_with_password.py
@@ -13,6 +13,53 @@ import os.path
 
 class save_readonly_with_password(UITestCase):
 
+#Bug 145511 - FILESAVE to PPTX as read-only with additional password 
protection for editing not working
+   def test_save_to_pptx(self):
+
+with TemporaryDirectory() as tempdir:
+xFilePath = os.path.join(tempdir, "tdf144374-tmp.pptx")
+
+with self.ui_test.create_doc_in_start_center("impress"):
+xTemplateDlg = self.xUITest.getTopFocusWindow()
+xCancelBtn = xTemplateDlg.getChild("close")
+self.ui_test.close_dialog_through_button(xCancelBtn)
+
+# Save the document
+with self.ui_test.execute_dialog_through_command(".uno:Save", 
close_button="") as xSaveDialog:
+xFileName = xSaveDialog.getChild("file_name")
+xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": 
xFilePath}))
+xFileTypeCombo = xSaveDialog.getChild("file_type")
+select_by_text(xFileTypeCombo, "Office Open XML 
Presentation (.pptx)")
+xPasswordCheckButton = xSaveDialog.getChild("password")
+xPasswordCheckButton.executeAction("CLICK", tuple())
+xOpen = xSaveDialog.getChild("open")
+
+with self.ui_test.execute_dialog_through_action(xOpen, 
"CLICK") as xPasswordDialog:
+xReadonly = xPasswordDialog.getChild("readonly")
+xReadonly.executeAction("CLICK", tuple())
+xNewPassword = 
xPasswordDialog.getChild("newpassroEntry")
+xNewPassword.executeAction("TYPE", 
mkPropertyValues({"TEXT": "password"}))
+xConfirmPassword = 
xPasswordDialog.getChild("confirmropassEntry")
+xConfirmPassword.executeAction("TYPE", 
mkPropertyValues({"TEXT": "password"}))
+
+# PPTX confirmation dialog is displayed
+xWarnDialog = self.xUITest.getTopFocusWindow()
+xSave = xWarnDialog.getChild("save")
+self.ui_test.close_dialog_through_button(xSave)
+
+with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as 
document:
+
+self.assertTrue(document.isReadonly())
+
+# Without the fix in place, this dialog wouldn't have been 
displayed
+with 
self.ui_test.execute_dialog_through_command(".uno:EditDoc") as xDialog:
+xPassword = xDialog.getChild("newpassEntry")
+xPassword.executeAction("TYPE", mkPropertyValues({"TEXT": 
"password"}))
+
+self.assertFalse(document.isReadonly())
+
def test_save_to_odp(self):
 
 with TemporaryDirectory() as tempdir:
diff --git a/sd/source/filter/eppt/epptooxml.hxx 
b/sd/source/filter/eppt/epptooxml.hxx
index 82bb6a3ab937..0c7e098f5771 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -168,6 +168,8 @@ private:
 
 /// If this is PPTM, output the VBA stream.
 void WriteVBA();
+
+void WriteModifyVerifier();
 };
 
 }
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 59f2e879b06f..d5787d6f4cb7 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -495,6 +495,8 @@ bool PowerPointExport::exportDocument()
 
 WriteVBA();
 
+WriteModif

[Libreoffice-commits] core.git: sd/qa sd/source

2021-10-30 Thread Mike Kaganski (via logerrit)
 sd/qa/unit/import-tests.cxx   |   64 ++---
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |5 
 sd/source/core/CustomAnimationEffect.cxx  |   15 -
 sd/source/core/EffectMigration.cxx|9 
 sd/source/filter/grf/sdgrffilter.cxx  |5 
 sd/source/filter/html/HtmlOptionsDialog.cxx   |2 
 sd/source/filter/html/buttonset.cxx   |6 
 sd/source/filter/html/htmlex.cxx  |   37 +--
 sd/source/filter/ppt/pptinanimations.cxx  |   52 ++--
 sd/source/filter/xml/sdxmlwrp.cxx |3 
 sd/source/ui/animations/CustomAnimationDialog.cxx |5 
 sd/source/ui/animations/CustomAnimationPane.cxx   |9 
 sd/source/ui/controller/slidelayoutcontroller.cxx |5 
 sd/source/ui/dlg/diactrl.cxx  |9 
 sd/source/ui/dlg/gluectrl.cxx |7 
 sd/source/ui/framework/configuration/ConfigurationUpdater.cxx |3 
 sd/source/ui/framework/configuration/ResourceId.cxx   |5 
 sd/source/ui/framework/factories/FullScreenPane.cxx   |   16 -
 sd/source/ui/framework/factories/ViewShellWrapper.cxx |3 
 sd/source/ui/framework/module/ModuleController.cxx|6 
 sd/source/ui/presenter/PresenterHelper.cxx|   13 -
 sd/source/ui/remotecontrol/ImagePreparer.cxx  |   33 +-
 sd/source/ui/slideshow/SlideShowRestarter.cxx |7 
 sd/source/ui/slideshow/slideshow.cxx  |   24 --
 sd/source/ui/slideshow/slideshowimpl.cxx  |   18 -
 sd/source/ui/unoidl/SdUnoSlideView.cxx|3 
 sd/source/ui/unoidl/UnoDocumentSettings.cxx   |8 
 sd/source/ui/unoidl/unomodel.cxx  |  119 --
 sd/source/ui/unoidl/unoobj.cxx|2 
 sd/source/ui/view/DocumentRenderer.cxx|   73 ++
 sd/source/ui/view/ViewTabBar.cxx  |   10 
 sd/source/ui/view/drviews5.cxx|5 
 sd/source/ui/view/drviewse.cxx|   11 
 sd/source/ui/view/sdview4.cxx |7 
 sd/source/ui/view/viewshe2.cxx|5 
 35 files changed, 276 insertions(+), 328 deletions(-)

New commits:
commit 94f34c57be79187c7108eea845e1303ddc6319e5
Author: Mike Kaganski 
AuthorDate: Fri Oct 29 10:02:01 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sat Oct 30 23:13:41 2021 +0200

Prepare for removal of non-const operator[] from Sequence in sd

Change-Id: I82dc012188f846161beeb54901c2f5d298e5c3b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124385
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 561f5b71abc5..e1b71fd788cf 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -91,6 +91,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1741,22 +1742,19 @@ void SdImportTest::testTdf113163()
 uno::Reference < uno::XComponentContext > xContext = 
::comphelper::getProcessComponentContext();
 uno::Reference< drawing::XGraphicExportFilter > xGraphicExporter = 
drawing::GraphicExportFilter::create(xContext);
 
-uno::Sequence< beans::PropertyValue > aFilterData(2);
-aFilterData[0].Name = "PixelWidth";
-aFilterData[0].Value <<= sal_Int32(100);
-aFilterData[1].Name = "PixelHeight";
-aFilterData[1].Value <<= sal_Int32(100);
+uno::Sequence< beans::PropertyValue > aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
+};
 
 utl::TempFile aTempFile;
 aTempFile.EnableKillingFile();
 
-uno::Sequence< beans::PropertyValue > aDescriptor(3);
-aDescriptor[0].Name = "URL";
-aDescriptor[0].Value <<= aTempFile.GetURL();
-aDescriptor[1].Name = "FilterName";
-aDescriptor[1].Value <<= OUString("PNG");
-aDescriptor[2].Name = "FilterData";
-aDescriptor[2].Value <<= aFilterData;
+uno::Sequence< beans::PropertyValue > aDescriptor{
+comphelper::makePropertyValue("URL", aTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
 
 uno::Reference< lang::XComponent > xPage(getPage(0, xDocShRef), 
uno::UNO_QUERY);
 xGraphicExporter->setSourceDocument(xPage);
@@ -1794,22 +1792,19 @@ void SdImportTest::testTdf93124()
 uno::Reference < uno::XComponentContext > xContext = 
::comphelper::getProcessComponentContext();
 uno::Reference< drawing::

[Libreoffice-commits] core.git: sd/qa sd/source

2021-09-21 Thread Attila Bakos (NISZ) (via logerrit)
 sd/qa/uitest/impress_tests/data/tdf127900.fodp |  778 +
 sd/qa/uitest/impress_tests/tdf127900.py|   39 +
 sd/source/ui/view/drawview.cxx |3 
 3 files changed, 819 insertions(+), 1 deletion(-)

New commits:
commit ca5e344aec6a5848831101bc0d623b2bac754b6e
Author: Attila Bakos (NISZ) 
AuthorDate: Tue Aug 24 16:48:07 2021 +0200
Commit: László Németh 
CommitDate: Tue Sep 21 12:12:51 2021 +0200

tdf#127900 sd: fix regression at applying master properties

Language settings of frames in slide master weren't applied
on the slides based on that master.

Regression since LO 6.3 by "tdf#126067 Fix slide scope
feature." (commit 40bb9ac690d979ef544d5aa759bd734a176912a0).

Co-developed-by: Dániel Arató (NISZ)

Change-Id: I559adbe00870ed8a3d2947fef8dae435a387e34a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120993
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/uitest/impress_tests/data/tdf127900.fodp 
b/sd/qa/uitest/impress_tests/data/tdf127900.fodp
new file mode 100644
index ..adedafc2757a
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/data/tdf127900.fodp
@@ -0,0 +1,778 @@
+
+
+http://openoffice.org/2004/office"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/200
 4/writer" xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns
 :css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 
xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" 
xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.presentation">
+ 
2021-08-30T08:55:10.39400LibreOffice/7.1.1.2$Windows_X86_64
 
LibreOffice_project/fe0b08f4af1bacafe4c7ecc87ce55bb4261646762021-08-30T08:56:29.11600PT7S1
+ 
+  
+   0
+   0
+   14099
+   
+   
+
+ view1
+ false
+ false
+ true
+ true
+ true
+ true
+ false
+ false
+ true
+ 1500
+ false
+ Hw==
+ Hw==
+ 
+ false
+ true
+ false
+ 0
+ 1
+ false
+ true
+ true
+ 4
+ 0
+ -974
+ -423
+ 28894
+ 17739
+ 2000
+ 2000
+ 500
+ 500
+ 2000
+ 4
+ 2000
+ 4
+ false
+ 1500
+ true
+ false
+
+   
+  
+  
+   true
+   $(inst)/share/palette%3B$(user)/config/standard.sob
+   0
+   $(inst)/share/palette%3B$(user)/config/standard.soc
+   $(inst)/share/palette%3B$(user)/config/standard.sod
+   1250
+   true
+   true
+   false
+   true
+   false
+   $(inst)/share/palette%3B$(user)/config/standard.sog
+   true
+   $(inst)/share/palette%3B$(user)/config/standard.soh
+   false
+   false
+   true
+   true
+   false
+   true
+   false
+   false
+   true
+   false
+   false
+   false
+   false
+   false
+   $(inst)/share/palette%3B$(user)/config/standard.soe
+   false
+   4
+   false
+   0
+   low-resolution
+   Microsoft Print to PDF
+   false
+   GRb+/01pY3Jvc29mdCBQcmludCB0byBQREYATWljcm9zb2Z0IFByaW50IFRvIFBERgAW

[Libreoffice-commits] core.git: sd/qa sd/source

2021-08-19 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf143624.pptx  |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   16 
 sd/source/filter/eppt/pptx-epptooxml.cxx |2 ++
 3 files changed, 18 insertions(+)

New commits:
commit 351a4308ba4708cf0cf9fd53d9f3dee0de1515e5
Author: Tibor Nagy 
AuthorDate: Mon Aug 16 11:05:39 2021 +0200
Commit: László Németh 
CommitDate: Thu Aug 19 17:33:11 2021 +0200

tdf#143624 PPTX: slideshow setting “Manual forwarding” not exported

Follow-up to commit f8ddaaf0f5e1fb61e0d4404ea28757bc652ae4be
(tdf#142915 PPTX import: support for presentation's timing attribute).

Change-Id: I1b175d406d2cd0fc40ba7085517709fb477fed58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120529
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf143624.pptx 
b/sd/qa/unit/data/pptx/tdf143624.pptx
new file mode 100644
index ..1eed8fedaa03
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf143624.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 59848719adf0..b191cc62ee76 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -61,6 +61,7 @@ using namespace css;
 class SdOOXMLExportTest1 : public SdModelTestBaseXML
 {
 public:
+void testTdf143624();
 void testTdf142648();
 void testTdf47365();
 void testTdf125071();
@@ -123,6 +124,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
+CPPUNIT_TEST(testTdf143624);
 CPPUNIT_TEST(testTdf142648);
 CPPUNIT_TEST(testTdf47365);
 CPPUNIT_TEST(testTdf125071);
@@ -212,6 +214,20 @@ void checkFontAttributes( const SdrTextObj* pObj, 
ItemValue nVal, sal_uInt32 nId
 
 }
 
+void SdOOXMLExportTest1::testTdf143624()
+{
+sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143624.pptx"), PPTX );
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/presProps.xml");
+
+assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "useTimings", "0");
+
+assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
+}
+
 void SdOOXMLExportTest1::testTdf142648()
 {
 sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142648.pptx"), PPTX );
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 74a5925f92d9..4791f4696910 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1104,6 +1104,7 @@ void PowerPointExport::WritePresentationProps()
 Reference 
xPresentationProps(xPresentationSupplier->getPresentation(),
   uno::UNO_QUERY);
 bool bEndlessVal = 
xPresentationProps->getPropertyValue("IsEndless").get();
+bool bChangeManually = 
xPresentationProps->getPropertyValue("IsAutomatic").get();
 OUString sFirstPage = 
xPresentationProps->getPropertyValue("FirstPage").get();
 OUString sCustomShow = 
xPresentationProps->getPropertyValue("CustomShow").get();
 
@@ -1117,6 +1118,7 @@ void PowerPointExport::WritePresentationProps()
 pFS->startElementNS(XML_p, XML_presentationPr, PPRNMSS);
 
 pFS->startElementNS(XML_p, XML_showPr, XML_loop, 
sax_fastparser::UseIf("1", bEndlessVal),
+XML_useTimings, sax_fastparser::UseIf("0", 
bChangeManually),
 XML_showNarration, "1");
 
 Reference xDPS(mXModel, 
uno::UNO_QUERY_THROW);


[Libreoffice-commits] core.git: sd/qa sd/source

2021-08-12 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf143129.pptx  |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   15 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   22 ++
 3 files changed, 37 insertions(+)

New commits:
commit 569cb54f1d82e993dcf1fd11d92d4cbd4f224a2d
Author: Tibor Nagy 
AuthorDate: Tue Jul 27 16:17:37 2021 +0200
Commit: László Németh 
CommitDate: Thu Aug 12 11:53:05 2021 +0200

tdf#143129 PPTX: custom slide show use as default is not exported.

Follow-up to commit 11ef976624dce8a8e50a1eb20e9c586519fd7ec8
"tdf#142590 PPTX import: fix custom slide show use as default"

Change-Id: Ie8a53a79bd531cfe2c3b3559b70d28770ca8b960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119564
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf143129.pptx 
b/sd/qa/unit/data/pptx/tdf143129.pptx
new file mode 100644
index ..77377c212be8
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf143129.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index cf757d35f0ff..59848719adf0 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -119,6 +119,7 @@ public:
 void testTdf124457();
 void testPlaceholderFillAndOutlineExport();
 void testTdf143126();
+void testTdf143129();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -180,6 +181,7 @@ public:
 CPPUNIT_TEST(testTdf124457);
 CPPUNIT_TEST(testPlaceholderFillAndOutlineExport);
 CPPUNIT_TEST(testTdf143126);
+CPPUNIT_TEST(testTdf143129);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1594,6 +1596,19 @@ void SdOOXMLExportTest1::testTdf143126()
 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3" );
 }
 
+void SdOOXMLExportTest1::testTdf143129()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143129.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/presProps.xml");
+
+assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
+assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0" );
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 4ee219d2a38c..bacfc54dc583 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1105,6 +1105,7 @@ void PowerPointExport::WritePresentationProps()
   uno::UNO_QUERY);
 bool bEndlessVal = 
xPresentationProps->getPropertyValue("IsEndless").get();
 OUString sFirstPage = 
xPresentationProps->getPropertyValue("FirstPage").get();
+OUString sCustomShow = 
xPresentationProps->getPropertyValue("CustomShow").get();
 
 FSHelperPtr pFS = openFragmentStreamWithSerializer(
 "ppt/presProps.xml",
@@ -1140,6 +1141,27 @@ void PowerPointExport::WritePresentationProps()
  OUString::number(nEndSlide));
 }
 
+if (!sCustomShow.isEmpty())
+{
+css::uno::Reference
+XCustPresentationSupplier(mXModel, css::uno::UNO_QUERY_THROW);
+css::uno::Reference mxCustShows;
+mxCustShows = XCustPresentationSupplier->getCustomPresentations();
+const css::uno::Sequence 
aNameSeq(mxCustShows->getElementNames());
+
+sal_Int32 nCustShowIndex = 0;
+for (sal_Int32 i = 0; i < aNameSeq.getLength(); i++)
+{
+if (aNameSeq[i] == sCustomShow)
+{
+nCustShowIndex = i;
+break;
+}
+}
+
+pFS->singleElementNS(XML_p, XML_custShow, XML_id, 
OUString::number(nCustShowIndex));
+}
+
 pFS->endElementNS(XML_p, XML_showPr);
 
 pFS->endElementNS(XML_p, XML_presentationPr);


[Libreoffice-commits] core.git: sd/qa sd/source

2021-07-27 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf143126.pptx  |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   16 
 sd/source/filter/eppt/pptx-epptooxml.cxx |   29 +++--
 3 files changed, 43 insertions(+), 2 deletions(-)

New commits:
commit d2c2985024ee085796a21ef9c3226dde10311c80
Author: Tibor Nagy 
AuthorDate: Thu Jul 8 16:12:05 2021 +0200
Commit: László Németh 
CommitDate: Tue Jul 27 11:59:49 2021 +0200

tdf#143126 PPTX: slideshow setting “Start from” not exported

Follow-up to commit 3d55149dcf19cffefcc19c16a3abbe8851453c5e
(tdf#142913 PPTX: slideshow setting “Start from” not imported).

Change-Id: I4124e528f8af61c3b87978c2f3d2b96d983ec056
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118648
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf143126.pptx 
b/sd/qa/unit/data/pptx/tdf143126.pptx
new file mode 100644
index ..f5799b60f26b
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf143126.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 15832942c2a8..cf757d35f0ff 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -118,6 +118,7 @@ public:
 void testTdf140865Wordart3D();
 void testTdf124457();
 void testPlaceholderFillAndOutlineExport();
+void testTdf143126();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -178,6 +179,7 @@ public:
 CPPUNIT_TEST(testTdf140865Wordart3D);
 CPPUNIT_TEST(testTdf124457);
 CPPUNIT_TEST(testPlaceholderFillAndOutlineExport);
+CPPUNIT_TEST(testTdf143126);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1578,6 +1580,20 @@ void SdOOXMLExportTest1::testTdf124457()
 "repeatCount", "indefinite");
 }
 
+void SdOOXMLExportTest1::testTdf143126()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143126.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/presProps.xml");
+
+assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
+assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "st", "2" );
+assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3" );
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 7d9a3f72cd49..4ee219d2a38c 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1104,6 +1104,7 @@ void PowerPointExport::WritePresentationProps()
 Reference 
xPresentationProps(xPresentationSupplier->getPresentation(),
   uno::UNO_QUERY);
 bool bEndlessVal = 
xPresentationProps->getPropertyValue("IsEndless").get();
+OUString sFirstPage = 
xPresentationProps->getPropertyValue("FirstPage").get();
 
 FSHelperPtr pFS = openFragmentStreamWithSerializer(
 "ppt/presProps.xml",
@@ -1114,8 +1115,32 @@ void PowerPointExport::WritePresentationProps()
 
 pFS->startElementNS(XML_p, XML_presentationPr, PPRNMSS);
 
-pFS->singleElementNS(XML_p, XML_showPr, XML_loop, 
sax_fastparser::UseIf("1", bEndlessVal),
- XML_showNarration, sax_fastparser::UseIf("1", 
bEndlessVal));
+pFS->startElementNS(XML_p, XML_showPr, XML_loop, 
sax_fastparser::UseIf("1", bEndlessVal),
+XML_showNarration, "1");
+
+Reference xDPS(mXModel, 
uno::UNO_QUERY_THROW);
+Reference xDrawPages(xDPS->getDrawPages(), 
uno::UNO_SET_THROW);
+if (!sFirstPage.isEmpty())
+{
+sal_Int32 nStartSlide = 1;
+sal_Int32 nEndSlide = xDrawPages->getCount();
+for (sal_Int32 i = 0; i < nEndSlide; i++)
+{
+Reference xDrawPage;
+xDrawPages->getByIndex(i) >>= xDrawPage;
+Reference xNamed(xDrawPage, 
uno::UNO_QUERY_THROW);
+if (xNamed->getName() == sFirstPage)
+{
+nStartSlide = i + 1;
+break;
+}
+}
+
+pFS->singleElementNS(XML_p, XML_sldRg, XML_st, 
OUString::number(nStartSlide), XML_end,
+ OUString::number(nEndSlide));
+}
+
+pFS->endElementNS(XML_p, XML_showPr);
 
 pFS->endElementNS(XML_p, XML_presentationPr);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2021-07-19 Thread Tibor Nagy (via logerrit)
 sd/qa/uitest/impress_tests/customSlideShowDialog.py |   21 
 sd/source/ui/func/fucushow.cxx  |9 +---
 2 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit d7dff57384126e50b75c95e84fd3081db2f326a1
Author: Tibor Nagy 
AuthorDate: Thu Jul 1 16:43:33 2021 +0200
Commit: László Németh 
CommitDate: Mon Jul 19 09:19:06 2021 +0200

tdf#143125 sd: fix crash when closing Custom Slide Shows dialog

regression from commit I6e97a69c546870199d5a45d9a6ad102e30d820c2

Change-Id: I760dabeb024413f1a2aeb57434f63adedb4246f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118231
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/uitest/impress_tests/customSlideShowDialog.py 
b/sd/qa/uitest/impress_tests/customSlideShowDialog.py
new file mode 100644
index ..b515a9657f85
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/customSlideShowDialog.py
@@ -0,0 +1,21 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import importlib
+from uitest.debug import sleep
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import get_state_as_dict, type_text
+
+class customSlideShowDialog(UITestCase):
+def test_customSlideShowDialog(self):
+with self.ui_test.create_doc_in_start_center("impress"):
+MainWindow = self.xUITest.getTopFocusWindow()
+TemplateDialog = self.xUITest.getTopFocusWindow()
+cancel = TemplateDialog.getChild("close")
+self.ui_test.close_dialog_through_button(cancel)
+with 
self.ui_test.execute_dialog_through_command(".uno:CustomShowDialog") as 
CustomSlideShows:
+self.ui_test.close_doc()
+# Without the fix in place, this test would have crashed here
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/source/ui/func/fucushow.cxx b/sd/source/ui/func/fucushow.cxx
index 8c63d0215776..eb3b12211085 100644
--- a/sd/source/ui/func/fucushow.cxx
+++ b/sd/source/ui/func/fucushow.cxx
@@ -74,10 +74,13 @@ void FuCustomShowDlg::DoExecute( SfxRequest& )
 }
 if (nRet == RET_OK)
 {
-if (!pDlg->IsCustomShow())
+if (mpDoc->GetCustomShowList())
 {
-rSettings.mbCustomShow = false;
-rSettings.mbAll = true;
+if (!pDlg->IsCustomShow())
+{
+rSettings.mbCustomShow = false;
+rSettings.mbAll = true;
+}
 }
 }
 pDlg.disposeAndClear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2021-05-31 Thread Attila Bakos (NISZ) (via logerrit)
 sd/qa/unit/data/pptx/LostPlaceholderFill.odp |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   53 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   18 +
 3 files changed, 71 insertions(+)

New commits:
commit 8acc6bc43e0334157b97b36f570987a49c5febdd
Author: Attila Bakos (NISZ) 
AuthorDate: Tue May 25 16:48:51 2021 +0200
Commit: László Németh 
CommitDate: Mon May 31 11:43:02 2021 +0200

tdf#142537 PPTX export: fix placeholder style export

Regression from: b6b02e0b4c9d739836e1f61a886ea45b01e6696e
(tdf#111903 tdf#137152 PPTX export: fix placeholders)

Placeholders lost the formatting, which has been fixed.
(fill, effects, and outline)

Change-Id: I2b9300b85cf3641d89d748a03377f950e668a2af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116113
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/LostPlaceholderFill.odp 
b/sd/qa/unit/data/pptx/LostPlaceholderFill.odp
new file mode 100644
index ..d2ea8dab6d4a
Binary files /dev/null and b/sd/qa/unit/data/pptx/LostPlaceholderFill.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 08504c8286a6..b5222c40f913 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -115,6 +115,7 @@ public:
 void testNarrationMimeType();
 void testTdf140865Wordart3D();
 void testTdf124457();
+void testPlaceholderFillAndOutlineExport();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -172,6 +173,7 @@ public:
 CPPUNIT_TEST(testNarrationMimeType);
 CPPUNIT_TEST(testTdf140865Wordart3D);
 CPPUNIT_TEST(testTdf124457);
+CPPUNIT_TEST(testPlaceholderFillAndOutlineExport);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -442,6 +444,57 @@ void SdOOXMLExportTest1::testLostPlaceholders()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest1::testPlaceholderFillAndOutlineExport()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/LostPlaceholderFill.odp"),
 ODP);
+
+uno::Any aFillStyle;
+uno::Any aFillColor;
+uno::Any aLineStyle;
+uno::Any aLineColor;
+
+for (int i = 1; i <= 2; i++)
+{
+CPPUNIT_ASSERT(xDocShRef.is());
+
+auto pDoc = xDocShRef->GetDoc();
+CPPUNIT_ASSERT(pDoc);
+auto pPage = pDoc->GetPage(1);
+CPPUNIT_ASSERT(pPage);
+auto pObj = pPage->GetObj(1);
+CPPUNIT_ASSERT(pObj);
+
+uno::Reference xShp(pObj->getUnoShape(), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShp);
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!", 
OUString(u"com.sun.star.presentation.OutlinerShape"), xShp->getShapeType());
+uno::Reference xShpProps(xShp, uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("It must be a placeholder!", true, 
xShpProps->getPropertyValue("IsPresentationObject").get());
+
+if (i == 1)
+{
+aFillStyle = xShpProps->getPropertyValue("FillStyle");
+aFillColor = xShpProps->getPropertyValue("FillColor");
+
+aLineStyle = xShpProps->getPropertyValue("LineStyle");
+aLineColor = xShpProps->getPropertyValue("LineColor");
+
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+continue;
+}
+else
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillstyle has not 
been exported!", aFillStyle, xShpProps->getPropertyValue("FillStyle"));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillcolor has not 
been exported!", aFillColor, xShpProps->getPropertyValue("FillColor"));
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linestyle has not 
been exported!", aLineStyle, xShpProps->getPropertyValue("LineStyle"));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linecolor has not 
been exported!", aLineColor, xShpProps->getPropertyValue("LineColor"));
+break;
+}
+}
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest1::testFdo71961()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo71961.odp"), ODP);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 089e3bbdffa5..a1a6dd6cad5d 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1534,7 +1534,25 @@ ShapeExport& 
PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap
 WritePresetShape("rect");
 Reference< XPropertySet > xProps(xShape, UNO_QUERY);
 if (xProps.is())
+{
 WriteBlipFill(xProps, "Graphic");
+// Do not forget to export the visible properties.
+WriteFill( xProps );
+WriteOutline( xProps );
+WriteShapeEffects( xProps );
+
+bool bHas3DEffectinShape = false;
+uno::Sequence grabBag;
+if (xProps->getPropertySetIn

[Libreoffice-commits] core.git: sd/qa sd/source

2021-05-28 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf125071.pptx  |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   15 +++
 sd/source/filter/eppt/epptooxml.hxx  |4 +
 sd/source/filter/eppt/pptx-epptooxml.cxx |   66 +++
 4 files changed, 85 insertions(+)

New commits:
commit a4b66458a7b8da2f5580014813e5dabe3fa670b6
Author: Tibor Nagy 
AuthorDate: Wed May 26 10:22:30 2021 +0200
Commit: László Németh 
CommitDate: Fri May 28 12:26:10 2021 +0200

tdf#125071 PPTX: fix missing custom slide show export

Follow-up to commit ecf48b2d4f3e54dbb2c1e295120d73e7b7a11338
"tdf#131390 PPTX: fix custom slide show is not imported".

Change-Id: I2a85e2ea08f6a70cd5f26cfb99a0ff1add2c296a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116177
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf125071.pptx 
b/sd/qa/unit/data/pptx/tdf125071.pptx
new file mode 100644
index ..42b65ab1f1b2
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf125071.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index c2d07f5ca092..9395e6eabeab 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -61,6 +61,7 @@ using namespace css;
 class SdOOXMLExportTest1 : public SdModelTestBaseXML
 {
 public:
+void testTdf125071();
 void testTdf54037();
 void testFdo90607();
 void testTdf127237();
@@ -117,6 +118,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
+CPPUNIT_TEST(testTdf125071);
 CPPUNIT_TEST(testTdf54037);
 CPPUNIT_TEST(testFdo90607);
 CPPUNIT_TEST(testTdf127237);
@@ -223,6 +225,19 @@ void checkFontAttributes( const SdrTextObj* pObj, 
ItemValue nVal)
 
 }
 
+void SdOOXMLExportTest1::testTdf125071()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf125071.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/presentation.xml");
+
+assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[1]", 
"name", "Custom1");
+assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[2]", 
"name", "Custom2");
+}
+
 void SdOOXMLExportTest1::testTdf54037()
 {
 sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf54037.pptx"), PPTX );
diff --git a/sd/source/filter/eppt/epptooxml.hxx 
b/sd/source/filter/eppt/epptooxml.hxx
index bedd492ca2b7..43beea7ca032 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -110,6 +110,8 @@ private:
 // Write docProps/core.xml and docprops/custom.xml and docprops/app.xml
 void writeDocumentProperties();
 
+void WriteCustomSlideShow();
+
 void AddLayoutIdAndRelation( const ::sax_fastparser::FSHelperPtr& pFS, 
sal_Int32 nLayoutFileId );
 
 virtual OUString SAL_CALL getImplementationName() override;
@@ -134,6 +136,8 @@ private:
 
 sal_uInt32 mnDiagramId;
 
+std::vector maRelId;
+
 bool mbCreateNotes;
 
 ::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap;
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index cee8f7760e4a..089e3bbdffa5 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -47,6 +47,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -436,6 +439,8 @@ bool PowerPointExport::exportDocument()
  XML_cx, 
OString::number(PPTtoEMU(maNotesPageSize.Width)),
  XML_cy, 
OString::number(PPTtoEMU(maNotesPageSize.Height)));
 
+WriteCustomSlideShow();
+
 WriteAuthors();
 
 WriteVBA();
@@ -449,6 +454,7 @@ bool PowerPointExport::exportDocument()
 
 maShapeMap.clear();
 maAuthors.clear();
+maRelId.clear();
 
 return true;
 }
@@ -458,6 +464,64 @@ bool PowerPointExport::exportDocument()
 return new ::oox::ole::VbaProject(getComponentContext(), getModel(), 
u"Impress");
 }
 
+void PowerPointExport::WriteCustomSlideShow()
+{
+Reference aXCPSup(mXModel, 
css::uno::UNO_QUERY);
+if (aXCPSup.is() && aXCPSup->getCustomPresentations()->hasElements())
+{
+mPresentationFS->startElementNS(XML_p, XML_custShowLst);
+
+Reference xDPS(getModel(), uno::UNO_QUERY_THROW);
+Reference xDrawPages(xDPS->getDrawPages(), 
uno::UNO_SET_THROW);
+Reference 
aXNameCont(aXCPSup->getCustomPresentations());
+const Sequence aNameSeq(aXNameCont->getElementNames());
+
+OUString sRelId;
+sal_uInt32 nCustomShowIndex = 0;
+sal_Int32 nSlideCount = xDrawPages->getCount();
+
+for (OUString const& customShowName : aNameSeq)
+{
+mPresentationFS->startElementNS

[Libreoffice-commits] core.git: sd/qa sd/source

2021-05-10 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf124457.pptx   |binary
 sd/qa/unit/export-tests-ooxml1.cxx|   22 ++
 sd/source/filter/eppt/pptx-animations.cxx |   22 +-
 3 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit c89a7e2d900da5a6bded573f6dcff04c7be98339
Author: Tibor Nagy 
AuthorDate: Wed May 5 12:38:51 2021 +0200
Commit: László Németh 
CommitDate: Mon May 10 11:40:18 2021 +0200

tdf#124457 PPTX animation: export repeatCount

Aanimation timing property "repeatCount" wasn't exported.

Note: PPTX uses a 1000 multiplication in repeatCount to
support fractional movement of animated objects, e.g.
1500 means one and a half steps.

Change-Id: Iac0dd10007c3e48f06c131d61671e1f78cad45a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115138
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/tdf124457.pptx 
b/sd/qa/unit/data/pptx/tdf124457.pptx
new file mode 100644
index ..5ea5173a10d5
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf124457.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index ad8bb624c614..c2d07f5ca092 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -113,6 +113,7 @@ public:
 void testArcTo();
 void testNarrationMimeType();
 void testTdf140865Wordart3D();
+void testTdf124457();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -168,6 +169,7 @@ public:
 CPPUNIT_TEST(testArcTo);
 CPPUNIT_TEST(testNarrationMimeType);
 CPPUNIT_TEST(testTdf140865Wordart3D);
+CPPUNIT_TEST(testTdf124457);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1472,6 +1474,26 @@ void SdOOXMLExportTest1::testTdf140865Wordart3D()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest1::testTdf124457()
+{
+sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf124457.pptx"), PPTX );
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
+
+assertXPath(pXmlDoc,
+"/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[1]/p:cTn",
+"repeatCount", "3000");
+
+assertXPath(pXmlDoc,
+"/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[2]/p:cTn",
+"repeatCount", "indefinite");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index 63423c8489c0..43ef7ce4d55d 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -994,11 +994,13 @@ void 
PPTXAnimationExport::WriteAnimationNodeCommonPropsStart()
 {
 const Reference& rXNode = getCurrentNode();
 std::optional sDuration;
+std::optional sRepeatCount;
 const char* pRestart = nullptr;
 const char* pNodeType = nullptr;
 const char* pPresetClass = nullptr;
 const char* pFill = nullptr;
 double fDuration = 0;
+double fRepeatCount = 0;
 Any aAny;
 assert(mpContext);
 
@@ -1070,12 +1072,30 @@ void 
PPTXAnimationExport::WriteAnimationNodeCommonPropsStart()
 
 bool bAutoReverse = rXNode->getAutoReverse();
 
+aAny = rXNode->getRepeatCount();
+if (aAny.hasValue())
+{
+Timing eTiming;
+
+if (aAny >>= eTiming)
+{
+if (eTiming == Timing_INDEFINITE)
+sRepeatCount = "indefinite";
+}
+else
+aAny >>= fRepeatCount;
+}
+
+if (fRepeatCount != 0)
+sRepeatCount = OString::number(static_cast(fRepeatCount * 
1000.0));
+
 mpFS->startElementNS(
 XML_p, XML_cTn, XML_id, 
OString::number(GetNextAnimationNodeId(rXNode)), XML_dur, sDuration,
 XML_autoRev, sax_fastparser::UseIf("1", bAutoReverse), XML_restart, 
pRestart, XML_nodeType,
 pNodeType, XML_fill, pFill, XML_presetClass, pPresetClass, 
XML_presetID,
 sax_fastparser::UseIf(OString::number(nPresetId), bPresetId), 
XML_presetSubtype,
-sax_fastparser::UseIf(OString::number(nPresetSubType), 
bPresetSubType));
+sax_fastparser::UseIf(OString::number(nPresetSubType), 
bPresetSubType), XML_repeatCount,
+sRepeatCount);
 
 WriteAnimationCondList(mpContext->getCondition(true), XML_stCondLst);
 WriteAnimationCondList(mpContext->getCondition(false), XML_endCondLst);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoff

[Libreoffice-commits] core.git: sd/qa sd/source

2021-04-29 Thread Attila Bakos (NISZ) (via logerrit)
 sd/qa/unit/data/pptx/LostPlaceholder.odp |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   35 ++-
 sd/source/filter/eppt/pptx-epptooxml.cxx |   17 +++
 3 files changed, 47 insertions(+), 5 deletions(-)

New commits:
commit b6b02e0b4c9d739836e1f61a886ea45b01e6696e
Author: Attila Bakos (NISZ) 
AuthorDate: Tue Apr 20 13:02:44 2021 +0200
Commit: László Németh 
CommitDate: Thu Apr 29 10:48:27 2021 +0200

tdf#111903 tdf#137152 PPTX export: fix placeholders

Empty placeholders were exported as white empty
custom shapes, losing their visibility and usability.

Note: export of properties hasn't been implemented, yet.

Change-Id: Ie8bd6a611f5fb43bcaa55f6b2f5b07daf731b163
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114331
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/qa/unit/data/pptx/LostPlaceholder.odp 
b/sd/qa/unit/data/pptx/LostPlaceholder.odp
new file mode 100644
index ..80ead189f260
Binary files /dev/null and b/sd/qa/unit/data/pptx/LostPlaceholder.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index fded47a1c2c9..0be65e22ee13 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -69,6 +69,7 @@ public:
 void testN828390_4();
 void testN828390_5();
 void testFdo71961();
+void testLostPlaceholders();
 void testN828390();
 void testBnc880763();
 void testBnc862510_5();
@@ -122,6 +123,7 @@ public:
 CPPUNIT_TEST(testN828390_4);
 CPPUNIT_TEST(testN828390_5);
 CPPUNIT_TEST(testFdo71961);
+CPPUNIT_TEST(testLostPlaceholders);
 CPPUNIT_TEST(testN828390);
 CPPUNIT_TEST(testBnc880763);
 CPPUNIT_TEST(testBnc862510_5);
@@ -370,6 +372,37 @@ void SdOOXMLExportTest1::testN828390_5()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest1::testLostPlaceholders()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/LostPlaceholder.odp"),
 ODP);
+CPPUNIT_ASSERT(xDocShRef.is());
+
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+CPPUNIT_ASSERT(xDocShRef.is());
+
+auto pDoc = xDocShRef->GetDoc();
+CPPUNIT_ASSERT(pDoc);
+auto pPage = pDoc->GetPage(1);
+CPPUNIT_ASSERT(pPage);
+auto pObj = pPage->GetObj(1);
+CPPUNIT_ASSERT(pObj);
+uno::Reference xShp (pObj->getUnoShape(), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShp);
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!", 
OUString(u"com.sun.star.presentation.OutlinerShape"), xShp->getShapeType());
+uno::Reference xShpProps(xShp, uno::UNO_QUERY);
+// Without the fix in place there will be the following error:
+// Expected: com.sun.star.presentation.OutlinerShape
+// Actual: com.sun.star.drawing.CustomShape
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("It must be a placeholder!", true, 
xShpProps->getPropertyValue("IsPresentationObject").get());
+// Without the fix in place this will the following:
+// Expected: true
+// Actual: false
+
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest1::testFdo71961()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo71961.odp"), ODP);
@@ -379,7 +412,7 @@ void SdOOXMLExportTest1::testFdo71961()
 
 // Export to .pptx changes all text frames to custom shape objects, which 
obey TextWordWrap property
 // (which is false for text frames otherwise and is ignored). Check that 
frames that should wrap still do.
-SdrObjCustomShape *pTxtObj = dynamic_cast( 
pPage->GetObj( 1 ));
+auto  pTxtObj = pPage->GetObj( 1 );
 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
 CPPUNIT_ASSERT_EQUAL( OUString( "Text to be always wrapped" ), 
pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
 CPPUNIT_ASSERT_EQUAL( true, 
pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index d87f51a07712..fa1a55ac6b5f 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1439,13 +1439,22 @@ ShapeExport& 
PowerPointShapeExport::WritePageShape(const Reference< XShape >& xS
 bool PowerPointShapeExport::WritePlaceholder(const Reference< XShape >& 
xShape, PlaceholderType ePlaceholder, bool bMaster)
 {
 SAL_INFO("sd.eppt", "WritePlaceholder " << bMaster << " " << 
ShapeExport::NonEmptyText(xShape));
-if (bMaster && ShapeExport::NonEmptyText(xShape))
+if (!xShape)
+return false;
+try
 {
-WritePlaceholderShape(xShape, ePlaceholder);
+Reference xShapeProps(xShape, UNO_QUERY);
+if (xShapeProps->getPropertyValue("IsPresentationObject").get())
+{
+WritePlaceholderShape(xShape, ePlaceholder);
 
-return true;
+return true;
+}
+}
+catch (Except

[Libreoffice-commits] core.git: sd/qa sd/source

2021-04-07 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/data/pptx/narration-non-media-shape.pptx |binary
 sd/qa/unit/export-tests-ooxml1.cxx  |   13 +
 sd/source/filter/eppt/pptx-animations.cxx   |7 +--
 3 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 9ac1d3ac65b198f739421f39ab3adc65d35a0908
Author: Miklos Vajna 
AuthorDate: Wed Apr 7 08:31:28 2021 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 7 09:45:13 2021 +0200

tdf#141267 PPTX export: fix handling of audio nodes with non-media source

Regression from commit cf5fa358a6bf6e7c0aae2dca1e8fa3334d95ebdb (PPTX
export: fix missing audio anim node for slide narrations, 2021-01-25),
the problem was that the audio source can be any kind of shape, not only
a media shape.

Fix the problem by explicitly checking of the shape has a media URL.

Change-Id: I2bdde0f9ed3576f307aabff5e39d441f295c203f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113715
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/qa/unit/data/pptx/narration-non-media-shape.pptx 
b/sd/qa/unit/data/pptx/narration-non-media-shape.pptx
new file mode 100644
index ..e7a527485f36
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/narration-non-media-shape.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 4972669e4b82..f12140f1a07f 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -98,6 +98,7 @@ public:
 void testRoundtripOwnLineStyles();
 void testRoundtripPrstDash();
 void testDashOnHairline();
+void testNarrationNonMediaShape();
 void testCustomshapeBitmapfillSrcrect();
 void testTdf100348FontworkBitmapFill();
 void testTdf100348FontworkGradientGlow();
@@ -150,6 +151,7 @@ public:
 CPPUNIT_TEST(testRoundtripOwnLineStyles);
 CPPUNIT_TEST(testRoundtripPrstDash);
 CPPUNIT_TEST(testDashOnHairline);
+CPPUNIT_TEST(testNarrationNonMediaShape);
 CPPUNIT_TEST(testCustomshapeBitmapfillSrcrect);
 CPPUNIT_TEST(testTdf100348FontworkBitmapFill);
 CPPUNIT_TEST(testTdf100348FontworkGradientGlow);
@@ -1144,6 +1146,17 @@ void SdOOXMLExportTest1::testDashOnHairline()
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:ln/a:custDash/a:ds", 11);
 }
 
+void SdOOXMLExportTest1::testNarrationNonMediaShape()
+{
+sd::DrawDocShellRef xDocShRef = loadURL(
+
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/narration-non-media-shape.pptx"),
 PPTX);
+utl::TempFile aTempFile;
+// Without the accompanying fix in place, this test would have failed,
+// beans::UnknownPropertyException was thrown.
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &aTempFile);
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect()
 {
 ::sd::DrawDocShellRef xDocShRef = loadURL(
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index 5de9475857d3..63423c8489c0 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -1220,7 +1220,8 @@ void PPTXAnimationExport::WriteAnimationNodeAudio()
 if (xAudio->getSource() >>= xShape)
 {
 uno::Reference xShapeProps(xShape, 
uno::UNO_QUERY);
-if (xShapeProps->getPropertyValue("MediaURL") >>= sUrl)
+bool bHasMediaURL = 
xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL");
+if (bHasMediaURL && (xShapeProps->getPropertyValue("MediaURL") >>= 
sUrl))
 {
 bValid = IsAudioURL(sUrl);
 }
@@ -1431,7 +1432,9 @@ void NodeContext::initValid(bool bHasValidChild, bool 
bIsIterateChild)
 else if (xAudio->getSource() >>= xShape)
 {
 uno::Reference xShapeProps(xShape, 
uno::UNO_QUERY);
-if (xShapeProps->getPropertyValue("MediaURL") >>= sURL)
+bool bHasMediaURL
+= 
xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL");
+if (bHasMediaURL && (xShapeProps->getPropertyValue("MediaURL") 
>>= sURL))
 {
 mbValid = IsAudioURL(sURL);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2021-02-14 Thread Noel (via logerrit)
 sd/qa/unit/misc-tests.cxx |8 
 sd/source/core/annotations/Annotation.cxx |   12 +---
 sd/source/core/stlfamily.cxx  |2 +-
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx |6 +++---
 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx  |6 +++---
 sd/source/ui/annotations/annotationmanager.cxx|4 ++--
 sd/source/ui/dlg/sdtreelb.cxx |2 +-
 sd/source/ui/framework/configuration/ResourceId.cxx   |2 +-
 sd/source/ui/framework/factories/BasicViewFactory.cxx |2 +-
 sd/source/ui/framework/tools/FrameworkHelper.cxx  |2 +-
 sd/source/ui/slideshow/slideshow.cxx  |5 ++---
 sd/source/ui/slideshow/slideshowimpl.cxx  |4 ++--
 sd/source/ui/unoidl/unomodel.cxx  |2 +-
 13 files changed, 27 insertions(+), 30 deletions(-)

New commits:
commit 0ae0b7ff575b4148f9c06abd3bac78d0881ec817
Author: Noel 
AuthorDate: Fri Feb 12 15:35:49 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 15 08:37:47 2021 +0100

loplugin:referencecasting in sd

Change-Id: I3d5e0fd3f9d8ea61aad5846a0ee19568a5d365a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110817
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 8dc23c0295a3..f23ee5b5cea5 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -163,11 +163,11 @@ sd::DrawDocShellRef SdMiscTest::Load(const OUString& 
rURL, sal_Int32 nFormat)
 CPPUNIT_ASSERT(xController.is());
 
 // introduce model/view/controller to each other
-xController->attachModel(xModel2.get());
-xModel2->connectController(xController.get());
-xTargetFrame->setComponent(xController->getComponentWindow(), 
xController.get());
+xController->attachModel(xModel2);
+xModel2->connectController(xController);
+xTargetFrame->setComponent(xController->getComponentWindow(), xController);
 xController->attachFrame(xTargetFrame);
-xModel2->setCurrentController(xController.get());
+xModel2->setCurrentController(xController);
 
 sd::ViewShell *pViewShell = xDocSh->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
diff --git a/sd/source/core/annotations/Annotation.cxx 
b/sd/source/core/annotations/Annotation.cxx
index 8831b3f337a8..7e9d4aff275a 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -298,7 +298,7 @@ uno::Reference SAL_CALL 
Annotation::getTextRange()
 {
 m_TextRange = TextApiObject::create( static_cast< SdDrawDocument* >( 
&mpPage->getSdrModelFromSdrPage() ) );
 }
-return uno::Reference( m_TextRange.get() );
+return m_TextRange;
 }
 
 std::unique_ptr CreateUndoInsertOrRemoveAnnotation( const 
uno::Reference& xAnnotation, bool bInsert )
@@ -423,7 +423,7 @@ void UndoInsertOrRemoveAnnotation::Undo()
 if( !(pPage && pModel) )
 return;
 
-uno::Reference xAnnotation( mxAnnotation.get() );
+uno::Reference xAnnotation( mxAnnotation );
 if( mbInsert )
 {
 pPage->removeAnnotation( xAnnotation );
@@ -442,7 +442,7 @@ void UndoInsertOrRemoveAnnotation::Redo()
 if( !(pPage && pModel) )
 return;
 
-uno::Reference xAnnotation( mxAnnotation.get() );
+uno::Reference xAnnotation( mxAnnotation );
 
 if( mbInsert )
 {
@@ -466,16 +466,14 @@ void UndoAnnotation::Undo()
 {
 maRedoData.get( mxAnnotation );
 maUndoData.set( mxAnnotation );
-uno::Reference xAnnotation( mxAnnotation.get() );
-LOKCommentNotifyAll( CommentNotificationType::Modify, xAnnotation );
+LOKCommentNotifyAll( CommentNotificationType::Modify, mxAnnotation );
 }
 
 void UndoAnnotation::Redo()
 {
 maUndoData.get( mxAnnotation );
 maRedoData.set( mxAnnotation );
-uno::Reference xAnnotation( mxAnnotation.get() );
-LOKCommentNotifyAll( CommentNotificationType::Modify, xAnnotation );
+LOKCommentNotifyAll( CommentNotificationType::Modify, mxAnnotation );
 }
 
 } // namespace sd
diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx
index 0f03615c88f3..8e9150a292ef 100644
--- a/sd/source/core/stlfamily.cxx
+++ b/sd/source/core/stlfamily.cxx
@@ -350,7 +350,7 @@ Any SAL_CALL SdStyleFamily::getByIndex( sal_Int32 Index )
 {
 PresStyleMap::iterator iter( rStyleSheets.begin() );
 std::advance(iter, Index);
-return Any( Reference< XStyle >( (*iter).second.get() ) );
+return Any( Reference< XStyle >( (*iter).second ) );
 }
 }
 else
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx 
b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index ba7a546045d2..15f5c24dc963 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/s

[Libreoffice-commits] core.git: sd/qa sd/source

2021-02-01 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/uiimpress.cxx|   33 
 sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx |2 
 2 files changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 58814d047be09d6bd31da5dfd0efe3bae593c4d5
Author: Xisco Fauli 
AuthorDate: Mon Feb 1 14:13:30 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Feb 1 23:32:17 2021 +0100

tdf#139996: sd_uiimpress: Add unittest

Change-Id: If4a8e415fadb1d004166b2a7428aff775bc37634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110254
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 83eb2a39cd13..8b444d7f3674 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -235,6 +235,39 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf126197)
 pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, 
SfxCallMode::SYNCHRON);
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf139996)
+{
+mxComponent = loadFromDesktop("private:factory/simpress",
+  
"com.sun.star.presentation.PresentationDocument");
+
+CPPUNIT_ASSERT(mxComponent.is());
+
+sd::slidesorter::SlideSorterViewShell* pSSVS = getSlideSorterViewShell();
+auto& rSSController = pSSVS->GetSlideSorter().GetController();
+auto& rPageSelector = rSSController.GetPageSelector();
+
+CPPUNIT_ASSERT_EQUAL(1, rPageSelector.GetSelectedPageCount());
+
+rPageSelector.DeselectAllPages();
+
+CPPUNIT_ASSERT_EQUAL(0, rPageSelector.GetSelectedPageCount());
+
+// Without the fix in place, this test would have crashed here
+dispatchCommand(mxComponent, ".uno:MovePageUp", {});
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:MovePageDown", {});
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:MovePageTop", {});
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:MovePageBottom", {});
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(0, rPageSelector.GetSelectedPageCount());
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf128651)
 {
 // Error was, that undo and redo changes size of the shape. Affected 
actions were e.g.
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx 
b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
index 5993618db157..51123f752ea9 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
@@ -60,7 +60,7 @@ public:
 
 // Exported for unit test
 SD_DLLPUBLIC void SelectAllPages();
-void DeselectAllPages();
+SD_DLLPUBLIC void DeselectAllPages();
 
 /** Update the selection state of all page descriptors to be the same as
 that of the corresponding pages of the SdPage objects and issue
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2021-02-01 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/uiimpress.cxx|   84 
 sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx |2 
 2 files changed, 85 insertions(+), 1 deletion(-)

New commits:
commit bc04a3c85afaf290958ae63ff374ff1d3f07bb66
Author: Xisco Fauli 
AuthorDate: Mon Feb 1 16:19:45 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Feb 1 20:17:39 2021 +0100

tdf#100950: sd_uiimpress: Add unittest

Change-Id: Ia2ecdc6d2836f51d7c47f1dc7208f52d4ab12a02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110258
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 7bfe6e42ac87..83eb2a39cd13 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -29,6 +30,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -39,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -53,6 +60,8 @@ public:
 virtual void tearDown() override;
 
 void checkCurrentPageNumber(sal_uInt16 nNum);
+void insertStringToObject(sal_uInt16 nObj, const std::string& rStr);
+sd::slidesorter::SlideSorterViewShell* getSlideSorterViewShell();
 };
 
 void SdUiImpressTest::setUp()
@@ -82,6 +91,55 @@ void SdUiImpressTest::checkCurrentPageNumber(sal_uInt16 nNum)
 CPPUNIT_ASSERT_EQUAL(nNum, nPageNumber);
 }
 
+void SdUiImpressTest::insertStringToObject(sal_uInt16 nObj, const std::string& 
rStr)
+{
+auto pImpressDocument = 
dynamic_cast(mxComponent.get());
+sd::ViewShell* pViewShell = 
pImpressDocument->GetDocShell()->GetViewShell();
+SdPage* pPage = pViewShell->GetActualPage();
+SdrObject* pShape = pPage->GetObj(nObj);
+CPPUNIT_ASSERT_MESSAGE("No Shape", pShape);
+SdrView* pView = pViewShell->GetView();
+pView->MarkObj(pShape, pView->GetSdrPageView());
+
+CPPUNIT_ASSERT(!pView->IsTextEdit());
+
+for (const char c : rStr)
+{
+pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, c, 0);
+pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, c, 0);
+Scheduler::ProcessEventsToIdle();
+}
+
+CPPUNIT_ASSERT(pView->IsTextEdit());
+
+pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::ESCAPE);
+pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::ESCAPE);
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT(!pView->IsTextEdit());
+}
+
+sd::slidesorter::SlideSorterViewShell* 
SdUiImpressTest::getSlideSorterViewShell()
+{
+auto pXImpressDocument = 
dynamic_cast(mxComponent.get());
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+sd::slidesorter::SlideSorterViewShell* pSSVS = nullptr;
+// Same as in sd/qa/unit/misc-tests.cxx
+for (int i = 0; i < 1000; i++)
+{
+// Process all Tasks - slide sorter is created here
+while (Scheduler::ProcessTaskScheduling())
+;
+if ((pSSVS = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(
+ pViewShell->GetViewShellBase()))
+!= nullptr)
+break;
+osl::Thread::wait(std::chrono::milliseconds(100));
+}
+CPPUNIT_ASSERT(pSSVS);
+return pSSVS;
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf111522)
 {
 // Load the document and create two new windows.
@@ -213,6 +271,32 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf128651)
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Redo changes width", nUndoWidth, nRedoWidth);
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf100950)
+{
+mxComponent = loadFromDesktop("private:factory/simpress",
+  
"com.sun.star.presentation.PresentationDocument");
+
+CPPUNIT_ASSERT(mxComponent.is());
+
+dispatchCommand(mxComponent, ".uno:InsertPage", {});
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:InsertPage", {});
+Scheduler::ProcessEventsToIdle();
+
+insertStringToObject(0, "Test");
+
+dispatchCommand(mxComponent, ".uno:Undo", {});
+Scheduler::ProcessEventsToIdle();
+
+sd::slidesorter::SlideSorterViewShell* pSSVS = getSlideSorterViewShell();
+auto& rSSController = pSSVS->GetSlideSorter().GetController();
+auto& rPageSelector = rSSController.GetPageSelector();
+
+// Without the fix in place, this test would have failed here
+CPPUNIT_ASSERT(rPageSelector.IsPageSelected(2));
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf129346)
 {
 mxComponent = loadFromDesktop("private:factory/simpress",
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx 
b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
index c61578954dae..5993618db157 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx

[Libreoffice-commits] core.git: sd/qa sd/source

2021-02-01 Thread Xisco Fauli (via logerrit)
 sd/qa/uitest/impress_tests/moveSlides.py |   77 ---
 sd/source/ui/uitest/uiobject.cxx |1 
 2 files changed, 78 deletions(-)

New commits:
commit f23bdb16f22957c9e71219040731911b3b849ffd
Author: Xisco Fauli 
AuthorDate: Mon Feb 1 10:13:25 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Feb 1 12:50:14 2021 +0100

Revert "uitest: sd: Add UItest for move pages"

This reverts commit 9aab76d2d1311d85fefa0ff7ad910a3e162bee10.

Actually this can be tested in a CppUnittest.

Change-Id: Ic42289d935e2ff6b4b18520bf683946415668f3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110222
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/uitest/impress_tests/moveSlides.py 
b/sd/qa/uitest/impress_tests/moveSlides.py
deleted file mode 100644
index fa89253af2ce..
--- a/sd/qa/uitest/impress_tests/moveSlides.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, 
type_text
-from libreoffice.uno.propertyvalue import mkPropertyValues
-
-class moveSlides(UITestCase):
-
-def renameSlide(self, editWin, currentPos):
-self.assertEqual(currentPos, 
get_state_as_dict(editWin)['CurrentSlide'])
-self.assertEqual("Slide " + currentPos, 
get_state_as_dict(editWin)['CurrentSlideName'])
-
-self.ui_test.execute_dialog_through_command(".uno:RenamePage")
-xDialog = self.xUITest.getTopFocusWindow()
-
-name_entry = xDialog.getChild("name_entry")
-name_entry.executeAction("TYPE", mkPropertyValues({"TEXT": "Test " + 
currentPos}))
-
-xOKBtn = xDialog.getChild("ok")
-self.ui_test.close_dialog_through_button(xOKBtn)
-
-self.assertEqual(currentPos, 
get_state_as_dict(editWin)['CurrentSlide'])
-self.assertEqual("Test " + currentPos, 
get_state_as_dict(editWin)['CurrentSlideName'])
-
-def test_moveSlides(self):
-
-self.ui_test.create_doc_in_start_center("impress")
-
-xTemplateDlg = self.xUITest.getTopFocusWindow()
-xCancelBtn = xTemplateDlg.getChild("close")
-self.ui_test.close_dialog_through_button(xCancelBtn)
-
-xImpress = self.xUITest.getTopFocusWindow()
-xEditWin = xImpress.getChild("impress_win")
-
-self.renameSlide(xEditWin, '1')
-
-for i in range(2):
-self.xUITest.executeCommand(".uno:InsertPage")
-
-self.renameSlide(xEditWin, str(i + 2))
-
-# Move slide 'Test 3' up
-for i in range(2, 0, -1):
-self.xUITest.executeCommand(".uno:MovePageUp")
-
-self.assertEqual(str(i), 
get_state_as_dict(xEditWin)['CurrentSlide'])
-self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
-
-# Move slide 'Test 3' down
-for i in range(2, 4, 1):
-self.xUITest.executeCommand(".uno:MovePageDown")
-
-self.assertEqual(str(i), 
get_state_as_dict(xEditWin)['CurrentSlide'])
-self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
-
-# Move slide 'Test 3' to the top
-self.xUITest.executeCommand(".uno:MovePageFirst")
-
-self.assertEqual('1', get_state_as_dict(xEditWin)['CurrentSlide'])
-self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
-
-# Move slide 'Test 3' to the bottom
-self.xUITest.executeCommand(".uno:MovePageLast")
-
-self.assertEqual('3', get_state_as_dict(xEditWin)['CurrentSlide'])
-self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
-
-self.ui_test.close_doc()
-
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/source/ui/uitest/uiobject.cxx b/sd/source/ui/uitest/uiobject.cxx
index d5acbc42963f..87e9a137fcaa 100644
--- a/sd/source/ui/uitest/uiobject.cxx
+++ b/sd/source/ui/uitest/uiobject.cxx
@@ -86,7 +86,6 @@ StringMap ImpressWindowUIObject::get_state()
 
 aMap["SelectedText"] = getViewShell(mxWindow)->GetSelectionText(false);
 aMap["CurrentSlide"] = 
OUString::number(getViewShell(mxWindow)->GetCurPagePos() + 1);
-aMap["CurrentSlideName"] = 
getViewShell(mxWindow)->GetActualPage()->GetName();
 aMap["Zoom"] = OUString::number(getViewShell(mxWindow)->GetZoom());
 
 return aMap;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2021-01-31 Thread Xisco Fauli (via logerrit)
 sd/qa/uitest/impress_tests/moveSlides.py |   77 +++
 sd/source/ui/uitest/uiobject.cxx |1 
 2 files changed, 78 insertions(+)

New commits:
commit 9aab76d2d1311d85fefa0ff7ad910a3e162bee10
Author: Xisco Fauli 
AuthorDate: Sun Jan 31 19:17:56 2021 +0100
Commit: Xisco Fauli 
CommitDate: Sun Jan 31 20:26:26 2021 +0100

uitest: sd: Add UItest for move pages

Change-Id: If15bdff99251f050f8183289819510e866bec9b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110210
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/uitest/impress_tests/moveSlides.py 
b/sd/qa/uitest/impress_tests/moveSlides.py
new file mode 100644
index ..fa89253af2ce
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/moveSlides.py
@@ -0,0 +1,77 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, 
type_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class moveSlides(UITestCase):
+
+def renameSlide(self, editWin, currentPos):
+self.assertEqual(currentPos, 
get_state_as_dict(editWin)['CurrentSlide'])
+self.assertEqual("Slide " + currentPos, 
get_state_as_dict(editWin)['CurrentSlideName'])
+
+self.ui_test.execute_dialog_through_command(".uno:RenamePage")
+xDialog = self.xUITest.getTopFocusWindow()
+
+name_entry = xDialog.getChild("name_entry")
+name_entry.executeAction("TYPE", mkPropertyValues({"TEXT": "Test " + 
currentPos}))
+
+xOKBtn = xDialog.getChild("ok")
+self.ui_test.close_dialog_through_button(xOKBtn)
+
+self.assertEqual(currentPos, 
get_state_as_dict(editWin)['CurrentSlide'])
+self.assertEqual("Test " + currentPos, 
get_state_as_dict(editWin)['CurrentSlideName'])
+
+def test_moveSlides(self):
+
+self.ui_test.create_doc_in_start_center("impress")
+
+xTemplateDlg = self.xUITest.getTopFocusWindow()
+xCancelBtn = xTemplateDlg.getChild("close")
+self.ui_test.close_dialog_through_button(xCancelBtn)
+
+xImpress = self.xUITest.getTopFocusWindow()
+xEditWin = xImpress.getChild("impress_win")
+
+self.renameSlide(xEditWin, '1')
+
+for i in range(2):
+self.xUITest.executeCommand(".uno:InsertPage")
+
+self.renameSlide(xEditWin, str(i + 2))
+
+# Move slide 'Test 3' up
+for i in range(2, 0, -1):
+self.xUITest.executeCommand(".uno:MovePageUp")
+
+self.assertEqual(str(i), 
get_state_as_dict(xEditWin)['CurrentSlide'])
+self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
+
+# Move slide 'Test 3' down
+for i in range(2, 4, 1):
+self.xUITest.executeCommand(".uno:MovePageDown")
+
+self.assertEqual(str(i), 
get_state_as_dict(xEditWin)['CurrentSlide'])
+self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
+
+# Move slide 'Test 3' to the top
+self.xUITest.executeCommand(".uno:MovePageFirst")
+
+self.assertEqual('1', get_state_as_dict(xEditWin)['CurrentSlide'])
+self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
+
+# Move slide 'Test 3' to the bottom
+self.xUITest.executeCommand(".uno:MovePageLast")
+
+self.assertEqual('3', get_state_as_dict(xEditWin)['CurrentSlide'])
+self.assertEqual("Test 3", 
get_state_as_dict(xEditWin)['CurrentSlideName'])
+
+self.ui_test.close_doc()
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/source/ui/uitest/uiobject.cxx b/sd/source/ui/uitest/uiobject.cxx
index 87e9a137fcaa..d5acbc42963f 100644
--- a/sd/source/ui/uitest/uiobject.cxx
+++ b/sd/source/ui/uitest/uiobject.cxx
@@ -86,6 +86,7 @@ StringMap ImpressWindowUIObject::get_state()
 
 aMap["SelectedText"] = getViewShell(mxWindow)->GetSelectionText(false);
 aMap["CurrentSlide"] = 
OUString::number(getViewShell(mxWindow)->GetCurPagePos() + 1);
+aMap["CurrentSlideName"] = 
getViewShell(mxWindow)->GetActualPage()->GetName();
 aMap["Zoom"] = OUString::number(getViewShell(mxWindow)->GetZoom());
 
 return aMap;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2021-01-25 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/export-tests-ooxml1.cxx|6 ++
 sd/source/filter/eppt/pptx-animations.cxx |   72 ++
 2 files changed, 70 insertions(+), 8 deletions(-)

New commits:
commit cf5fa358a6bf6e7c0aae2dca1e8fa3334d95ebdb
Author: Miklos Vajna 
AuthorDate: Mon Jan 25 17:34:28 2021 +0100
Commit: Miklos Vajna 
CommitDate: Mon Jan 25 19:23:59 2021 +0100

PPTX export: fix missing audio anim node for slide narrations

Once the audio node is there, it'll be possible to specify various
custom properties on it in follow-up commits.

Change-Id: I8c00de27de483687eaf76d1661baf59c52711246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109920
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index e87c04a06cbb..392aa4a8b32e 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -1347,6 +1347,12 @@ void SdOOXMLExportTest1::testNarrationMimeType()
 // i.e. '' was written instead of ''.
 assertXPath(pSlideDoc, "//p:cmd", "cmd", "playFrom(0.0)");
 
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e.  had no  children, the whole audio 
animation node was lost.
+assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode", 1);
+
 xDocShRef->DoClose();
 }
 
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index 533f4804df81..e45ed5783c30 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -652,6 +653,12 @@ public:
 PPTXAnimationExport(PowerPointExport& rExport, const FSHelperPtr& pFS);
 void WriteAnimations(const Reference& rXDrawPage);
 };
+
+/// Returns if rURL has an extension which is an audio format.
+bool IsAudioURL(const OUString& rURL)
+{
+return rURL.endsWithIgnoreAsciiCase(".wav") || 
rURL.endsWithIgnoreAsciiCase(".m4a");
+}
 }
 
 namespace oox::core
@@ -1193,14 +1200,40 @@ void PPTXAnimationExport::WriteAnimationNodeAudio()
 Reference xAudio(getCurrentNode(), UNO_QUERY);
 
 OUString sUrl;
+uno::Reference xShape;
 OUString sRelId;
 OUString sName;
 
-if (!(xAudio.is() && (xAudio->getSource() >>= sUrl) && !sUrl.isEmpty()
-  && sUrl.endsWithIgnoreAsciiCase(".wav")))
+if (!xAudio.is())
+{
 return;
+}
+
+bool bValid = false;
+if ((xAudio->getSource() >>= sUrl) && !sUrl.isEmpty() && IsAudioURL(sUrl))
+{
+bValid = true;
+}
 
-mrPowerPointExport.embedEffectAudio(mpFS, sUrl, sRelId, sName);
+if (!bValid)
+{
+if (xAudio->getSource() >>= xShape)
+{
+uno::Reference xShapeProps(xShape, 
uno::UNO_QUERY);
+if (xShapeProps->getPropertyValue("MediaURL") >>= sUrl)
+{
+bValid = IsAudioURL(sUrl);
+}
+}
+}
+
+if (!bValid)
+return;
+
+if (!xShape.is())
+{
+mrPowerPointExport.embedEffectAudio(mpFS, sUrl, sRelId, sName);
+}
 
 mpFS->startElementNS(XML_p, XML_audio);
 mpFS->startElementNS(XML_p, XML_cMediaNode);
@@ -1211,9 +1244,17 @@ void PPTXAnimationExport::WriteAnimationNodeAudio()
 mpFS->endElementNS(XML_p, XML_cTn);
 
 mpFS->startElementNS(XML_p, XML_tgtEl);
-mpFS->singleElementNS(XML_p, XML_sndTgt, FSNS(XML_r, XML_embed),
-  sax_fastparser::UseIf(sRelId, !sRelId.isEmpty()), 
XML_name,
-  sax_fastparser::UseIf(sName, !sUrl.isEmpty()));
+if (xShape.is())
+{
+sal_Int32 nShapeID = mrPowerPointExport.GetShapeID(xShape);
+mpFS->singleElementNS(XML_p, XML_spTgt, XML_spid, 
OString::number(nShapeID));
+}
+else
+{
+mpFS->singleElementNS(XML_p, XML_sndTgt, FSNS(XML_r, XML_embed),
+  sax_fastparser::UseIf(sRelId, 
!sRelId.isEmpty()), XML_name,
+  sax_fastparser::UseIf(sName, !sUrl.isEmpty()));
+}
 mpFS->endElementNS(XML_p, XML_tgtEl);
 
 mpFS->endElementNS(XML_p, XML_cMediaNode);
@@ -1377,8 +1418,23 @@ void NodeContext::initValid(bool bHasValidChild, bool 
bIsIterateChild)
 {
 Reference xAudio(mxNode, UNO_QUERY);
 OUString sURL;
-mbValid
-= xAudio.is() && (xAudio->getSource() >>= sURL) && 
sURL.endsWithIgnoreAsciiCase(".wav");
+uno::Reference xShape;
+mbValid = false;
+if (xAudio.is())
+{
+if (xAudio->getSource() >>= sURL)
+{
+mbValid = IsAudioURL(sURL);
+}
+else if (xAudio->getSource() >>= xShape)
+{
+uno::Reference xShapeProps(xShape, 
uno::UNO_QUERY);
+if (xShapeProps->getPropertyV

[Libreoffice-commits] core.git: sd/qa sd/source

2020-11-26 Thread nd101 (via logerrit)
 sd/qa/unit/data/ppt/tdf136911.ppt  |binary
 sd/qa/unit/export-tests-ooxml1.cxx |   28 
 sd/source/filter/ppt/pptin.cxx |   25 +
 3 files changed, 53 insertions(+)

New commits:
commit f516c0bd3bb69bf9f18160c03bd7309774f88057
Author: nd101 
AuthorDate: Mon Sep 21 14:07:44 2020 +0800
Commit: Noel Grandin 
CommitDate: Thu Nov 26 17:52:51 2020 +0100

tdf#136911 fix ppt hyperlink import

If the hyperlink list is not found, try the secondary approach
by searching through the record list.

Change-Id: I5b3516e1005b102fb3b79f55c2485a7c41b56057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103081
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/data/ppt/tdf136911.ppt 
b/sd/qa/unit/data/ppt/tdf136911.ppt
new file mode 100644
index ..550dc5c3a4ba
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf136911.ppt differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 861ca9517044..75222f267a58 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -99,6 +99,7 @@ public:
 void testTdf128345GradientRadial();
 void testTdf128345GradientAxial();
 void testTdf134969TransparencyOnColorGradient();
+void testTdf136911();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -147,6 +148,7 @@ public:
 CPPUNIT_TEST(testTdf128345GradientRadial);
 CPPUNIT_TEST(testTdf128345GradientAxial);
 CPPUNIT_TEST(testTdf134969TransparencyOnColorGradient);
+CPPUNIT_TEST(testTdf136911);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -646,6 +648,32 @@ void SdOOXMLExportTest1::testTextboxWithHyperlink()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest1::testTdf136911()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf136911.ppt"), PPT);
+
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, 
xDocShRef ) );
+
+// Get second paragraph
+uno::Reference const xParagraph( getParagraphFromShape( 
0, xShape ) );
+
+// first chunk of text
+uno::Reference xRun( getRunFromParagraph( 0, xParagraph 
) );
+uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW 
);
+
+uno::Reference xField;
+xPropSet->getPropertyValue("TextField") >>= xField;
+CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
+
+xPropSet.set(xField, uno::UNO_QUERY);
+OUString aURL;
+xPropSet->getPropertyValue("URL") >>= aURL;
+CPPUNIT_ASSERT_EQUAL_MESSAGE("URLs don't match", 
OUString("http://google.com";), aURL);
+
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest1::testBulletColor()
 {
 ::sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bulletColor.pptx"), PPTX );
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index d648cb4aa1ac..3883f9d50cfe 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -531,6 +531,31 @@ bool ImplSdPPTImport::Import()
 if (!aHyperE.SeekToEndOfRecord(rStCtrl))
 break;
 }
+
+if (m_aHyperList.size() == 0)
+{
+while(true)
+{
+
+DffRecordHeader aHyperE;
+if (!SeekToRec(rStCtrl, PPT_PST_ExHyperlink, 
nExObjHyperListLen, &aHyperE))
+break;
+if (!SeekToRec(rStCtrl, PPT_PST_ExHyperlinkAtom, 
nExObjHyperListLen))
+continue;
+
+SdHyperlinkEntry aHyperlink;
+
+OUString aURLText;
+OUString aURLLink;
+rStCtrl.SeekRel(8);
+rStCtrl.ReadUInt32(aHyperlink.nIndex);
+
+ReadString(aURLText);
+ReadString(aURLLink);
+aHyperlink.aTarget = aURLLink;
+m_aHyperList.push_back(aHyperlink);
+}
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2020-06-04 Thread Stephan Bergmann (via logerrit)
 sd/qa/unit/dialogs-test.cxx  |3 -
 sd/qa/unit/export-tests-ooxml2.cxx   |   28 ---
 sd/qa/unit/import-tests-smartart.cxx |3 -
 sd/qa/unit/import-tests.cxx  |6 +--
 sd/qa/unit/misc-tests.cxx|   12 ++
 sd/source/core/CustomAnimationEffect.cxx |6 +--
 sd/source/core/CustomAnimationPreset.cxx |   21 +++
 sd/source/core/stlfamily.cxx |3 -
 sd/source/filter/sdpptwrp.cxx|3 -
 sd/source/filter/xml/sdxmlwrp.cxx|3 -
 sd/source/ui/app/sdmod1.cxx  |3 -
 sd/source/ui/dlg/animobjs.cxx|3 -
 sd/source/ui/dlg/inspagob.cxx|3 -
 sd/source/ui/docshell/docshel3.cxx   |9 +---
 sd/source/ui/func/fuinsfil.cxx   |3 -
 sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx |7 +--
 sd/source/ui/table/TableDesignPane.cxx   |6 +--
 sd/source/ui/unoidl/unopage.cxx  |6 +--
 18 files changed, 41 insertions(+), 87 deletions(-)

New commits:
commit 88a5f7769ed39c976129652db7de43e69c925e3c
Author: Stephan Bergmann 
AuthorDate: Thu Jun 4 23:31:11 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 5 07:34:57 2020 +0200

Upcoming loplugin:elidestringvar: sd

Change-Id: I5eb606a68c9d1f777cbc896904db0ddce20c68f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95543
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 4eb9d9884481..b0f5ce782969 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -365,12 +365,11 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 // CreateSdInsertPagesObjsDlg(const SdDrawDocument* pDoc, 
SfxMedium* pSfxMedium, const OUString& rFileName) override;
 SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
 CPPUNIT_ASSERT(pDrawDoc);
-const OUString aFileName("foo");
 pRetval = getSdAbstractDialogFactory()->CreateSdInsertPagesObjsDlg(
 getViewShell()->GetFrameWeld(),
 pDrawDoc,
 nullptr,
-aFileName);
+"foo");
 break;
 }
 case 10:
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index c6d2f48aedde..a3ff094b7f21 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -543,10 +543,9 @@ void SdOOXMLExportTest2::testTdf123090()
 CPPUNIT_ASSERT_EQUAL(OUString("aaa"), xTextRange->getString());
 
 sal_Int32 nWidth;
-const OUString sWidth("Width");
 uno::Reference< css::table::XTableColumns > xColumns( 
xTable->getColumns(), uno::UNO_SET_THROW);
 uno::Reference< beans::XPropertySet > xRefColumn( xColumns->getByIndex(1), 
uno::UNO_QUERY_THROW );
-xRefColumn->getPropertyValue( sWidth ) >>= nWidth;
+xRefColumn->getPropertyValue( "Width" ) >>= nWidth;
 CPPUNIT_ASSERT_EQUAL( sal_Int32(9136), nWidth);
 
 xDocShRef->DoClose();
@@ -1170,11 +1169,10 @@ void SdOOXMLExportTest2::testTdf111518()
 xShell->DoClose();
 
 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, 
"ppt/slides/slide1.xml");
-OUString sExpect = "M -3.54167E-6 -4.81481E-6 L 0.39037 -0.00069 E";
 OUString sActual = getXPath(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");
-CPPUNIT_ASSERT_MOTIONPATH(sExpect, sActual);
+CPPUNIT_ASSERT_MOTIONPATH("M -3.54167E-6 -4.81481E-6 L 0.39037 -0.00069 
E", sActual);
 }
 
 void SdOOXMLExportTest2::testTdf100387()
@@ -2249,24 +2247,16 @@ void SdOOXMLExportTest2::testTdf120573()
 
 void SdOOXMLExportTest2::testTdf118825()
 {
-const OUString sPath1 = "M 0.0449285714285714 0.00368253968253968 C 
0.0575714285714285 -0.00095238095238096 0.0704264795523803 -0.00370117418637049 
0.0831071428571428 -0.00819047619047622 C 0.0953550597998766 
-0.0125265741339082 0.107821870086751 -0.010397536991717 0.120321428571429 
-0.0116 C 0.133179018681433 -0.0127467438724762 0.151318627483861 
-0.0158700272533852 0.1585 0.00539682539682542 C 0.16478291361998 
0.0240029898688431 0.15828642886492 0.0483806254341085 0.161392857142857 
0.0698412698412698 C 0.165179286017685 0.0959996731216037 0.17453898927982 
0.119735912694626 0.187142857142857 0.132634920634921 C 0.199788991845377 
0.145577185161529 0.215607110490848 0.142889773028431 0.230107142857143 
0.142857142857143 C 0.243821417584191 0.142826280916829 0.257716514999779 
0.142685979556724 

[Libreoffice-commits] core.git: sd/qa sd/source

2020-06-03 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |  104 +-
 sd/source/ui/view/Outliner.cxx|   21 -
 2 files changed, 120 insertions(+), 5 deletions(-)

New commits:
commit 7b2170f6239f0c4f16a1cbd3ec54a861405aa07a
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 13:28:36 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 4 00:43:43 2020 +0200

sd: add support to search backwards in PDF search

Change-Id: I2c7f75d16a430dcfa892d28fb6b4f64118705ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95459
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 2c1e1c0426a3..8c2a41eeca9e 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -56,6 +56,7 @@ public:
 void testSearchInPDFNonExisting();
 void testSearchInPDF();
 void testSearchInPDFInMultiplePages();
+void testSearchInPDFInMultiplePagesBackwards();
 void testSearchIn2MixedObjects();
 void testSearchIn6MixedObjects();
 
@@ -69,6 +70,7 @@ public:
 CPPUNIT_TEST(testSearchInPDFNonExisting);
 CPPUNIT_TEST(testSearchInPDF);
 CPPUNIT_TEST(testSearchInPDFInMultiplePages);
+CPPUNIT_TEST(testSearchInPDFInMultiplePagesBackwards);
 CPPUNIT_TEST(testSearchIn2MixedObjects);
 CPPUNIT_TEST(testSearchIn6MixedObjects);
 CPPUNIT_TEST_SUITE_END();
@@ -123,14 +125,14 @@ LOKitSearchTest::createDoc(const char* pName, const 
uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
 { "SearchItem.SearchString", uno::makeAny(rKey) },
-{ "SearchItem.Backward", uno::makeAny(false) },
+{ "SearchItem.Backward", uno::makeAny(bBackwards) },
 { "SearchItem.Command", uno::makeAny(sal_uInt16(eSearch)) },
 }));
 
@@ -422,6 +424,104 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages()
  mpCallbackRecorder->m_aSearchResultSelection[0]);
 }
 
+void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+mpCallbackRecorder->registerCallbacksFor(pViewShell->GetViewShellBase());
+
+SdPage* pPage = pViewShell->GetActualPage();
+CPPUNIT_ASSERT(pPage);
+
+{
+SdrObject* pObject = pPage->GetObj(0);
+CPPUNIT_ASSERT(pObject);
+
+SdrGrafObj* pGraphicObject = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pGraphicObject);
+
+Graphic aGraphic = pGraphicObject->GetGraphic();
+auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
+CPPUNIT_ASSERT(pVectorGraphicData);
+CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
+ pVectorGraphicData->getVectorGraphicDataType());
+}
+
+// Expected for backwards search is:
+// - Start with Page 1
+//   + search backwards through objects
+//   + inside objects search backwards through text
+// - Switch to Page 2
+//   + search backwards through objects
+//   + inside objects search backwards through text
+
+// Search for "him"
+lcl_search("him", /*FindAll*/ false, /*Backwards*/ true);
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
+CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1100, 499"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search for "him"
+lcl_search("him", /*FindAll*/ false, /*Backwards*/ true);
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(2, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
+CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 499"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search for "him"
+lcl_search("him", /*FindAll*/ false, /*Backwards*/ true);
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(3, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(1, mpCallbackRec

[Libreoffice-commits] core.git: sd/qa sd/source

2020-06-03 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   86 ++
 sd/qa/unit/tiledrendering/data/MixedTest1.odg |binary
 sd/source/ui/view/Outliner.cxx|2 
 3 files changed, 87 insertions(+), 1 deletion(-)

New commits:
commit 18f8340a697be7c076fe111d0bc42faf877b9202
Author: Tomaž Vajngerl 
AuthorDate: Sat May 30 15:47:35 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 4 00:41:49 2020 +0200

sd: fix issue when PDF search doesn't send a search result + test

This fixes the issue when PDF search doesn't send the search
result, because of premature exit.

Also add test which reproduces this issue and tests the behavior
of searching in multiple objects.

Change-Id: I3a676eeac36bde88c67e90a49583444b8595a346
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95454
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 8d8b11e43fa1..24037a0780ba 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -55,6 +55,7 @@ public:
 void testDontSearchInMasterPages();
 void testSearchInPDFNonExisting();
 void testSearchInPDF();
+void testSearchInMixedObject();
 
 CPPUNIT_TEST_SUITE(LOKitSearchTest);
 CPPUNIT_TEST(testSearch);
@@ -65,6 +66,7 @@ public:
 CPPUNIT_TEST(testDontSearchInMasterPages);
 CPPUNIT_TEST(testSearchInPDFNonExisting);
 CPPUNIT_TEST(testSearchInPDF);
+CPPUNIT_TEST(testSearchInMixedObject);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -317,6 +319,90 @@ void LOKitSearchTest::testSearchInPDF()
  mpCallbackRecorder->m_aSelection[0]);
 }
 
+void LOKitSearchTest::testSearchInMixedObject()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("MixedTest1.odg");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+SdDrawDocument* pDocument = pXImpressDocument->GetDocShell()->GetDoc();
+CPPUNIT_ASSERT(pDocument);
+mpCallbackRecorder->registerCallbacksFor(pViewShell->GetViewShellBase());
+
+// Check we have one page
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), 
pDocument->GetSdPageCount(PageKind::Standard));
+
+SdPage* pPage = pViewShell->GetActualPage();
+CPPUNIT_ASSERT(pPage);
+
+// Check page hase 2 objects only
+CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount());
+
+// Check Object 1
+{
+SdrObject* pObject = pPage->GetObj(0);
+CPPUNIT_ASSERT(pObject);
+
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_TEXT), 
pObject->GetObjIdentifier());
+}
+
+// Check Object 2
+{
+SdrObject* pObject = pPage->GetObj(1);
+CPPUNIT_ASSERT(pObject);
+
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_GRAF), 
pObject->GetObjIdentifier());
+
+SdrGrafObj* pGraphicObject = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pGraphicObject);
+
+Graphic aGraphic = pGraphicObject->GetGraphic();
+auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
+CPPUNIT_ASSERT(pVectorGraphicData);
+
+CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
+ pVectorGraphicData->getVectorGraphicDataType());
+}
+
+// Let's try to search now
+
+lcl_search("ABC");
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(OString("3546, 3174, 738, 402"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search next
+
+lcl_search("ABC");
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(2, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(OString("8412, 6385, 519, 174"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search next again - we should get the first object again
+
+lcl_search("ABC");
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(3, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(OString("3546, 3174, 738, 402"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(LOKitSearchTest);
 
 /* vim:set s

[Libreoffice-commits] core.git: sd/qa sd/source

2020-06-02 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   93 --
 sd/qa/unit/tiledrendering/data/PDFSearch.pdf  |binary
 sd/source/ui/view/Outliner.cxx|   15 
 3 files changed, 102 insertions(+), 6 deletions(-)

New commits:
commit a99aef3cf0a8ff3f04077d1530d1602505cecaae
Author: Tomaž Vajngerl 
AuthorDate: Fri May 29 23:06:57 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 3 07:42:36 2020 +0200

sd: fix not found case in PDF search + add PDF Search tests

When searching the PDF and the search text is not found (anymore)
in the current VectorGraphicSearch, we need to remove it and mark
that we don't currently search in a vector graphic (PDF) anymore.
This wasn't handled correctly and caused a crash.

In addition add a LOKit test for search into a PDF document, to
make sure the not-found case and usual searching case are working
correctly.

Change-Id: I663a6b2cf4879f11d62e440ea0c35ffcd205f81f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95380
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 4474bd8e4751..33257f12d4ab 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -24,10 +24,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 
 using namespace css;
@@ -38,7 +42,7 @@ private:
 static constexpr char DATA_DIRECTORY[] = 
"/sd/qa/unit/tiledrendering/data/";
 
 public:
-LOKitSearchTest() {}
+LOKitSearchTest() = default;
 
 virtual void setUp() override;
 virtual void tearDown() override;
@@ -49,6 +53,8 @@ public:
 void testSearchAllNotifications();
 void testSearchAllFollowedBySearch();
 void testDontSearchInMasterPages();
+void testSearchInPDFNonExisting();
+void testSearchInPDF();
 
 CPPUNIT_TEST_SUITE(LOKitSearchTest);
 CPPUNIT_TEST(testSearch);
@@ -57,6 +63,8 @@ public:
 CPPUNIT_TEST(testSearchAllNotifications);
 CPPUNIT_TEST(testSearchAllFollowedBySearch);
 CPPUNIT_TEST(testDontSearchInMasterPages);
+CPPUNIT_TEST(testSearchInPDFNonExisting);
+CPPUNIT_TEST(testSearchInPDF);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -96,9 +104,11 @@ LOKitSearchTest::createDoc(const char* pName, const 
uno::Sequencedispose();
+
 mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY)
-  + OUString::createFromAscii(pName),
-  
"com.sun.star.presentation.PresentationDocument");
+  + OUString::createFromAscii(pName));
+
+CPPUNIT_ASSERT(mxComponent.is());
 SdXImpressDocument* pImpressDocument = 
dynamic_cast(mxComponent.get());
 CPPUNIT_ASSERT(pImpressDocument);
 pImpressDocument->initializeForTiledRendering(rArguments);
@@ -109,15 +119,20 @@ namespace
 {
 void lcl_search(const OUString& rKey, bool bFindAll = false)
 {
+Scheduler::ProcessEventsToIdle();
+SvxSearchCmd eSearch = bFindAll ? SvxSearchCmd::FIND_ALL : 
SvxSearchCmd::FIND;
+
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
 { "SearchItem.SearchString", uno::makeAny(rKey) },
 { "SearchItem.Backward", uno::makeAny(false) },
-{ "SearchItem.Command", uno::makeAny(static_cast(
-bFindAll ? SvxSearchCmd::FIND_ALL : 
SvxSearchCmd::FIND)) },
+{ "SearchItem.Command", uno::makeAny(sal_uInt16(eSearch)) },
 }));
+
 comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
 }
-}
+
+} // end anonymous namespace
 
 void LOKitSearchTest::testSearch()
 {
@@ -228,6 +243,72 @@ void LOKitSearchTest::testDontSearchInMasterPages()
 CPPUNIT_ASSERT_EQUAL(false, mpCallbackRecorder->m_bFound);
 }
 
+void LOKitSearchTest::testSearchInPDFNonExisting()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+mpCallbackRecorder->registerCallbacksFor(pViewShell->GetViewShellBase());
+
+SdPage* pPage = pViewShell->GetActualPage();
+CPPUNIT_ASSERT(pPage);
+
+SdrObject* pObject = pPage->GetObj(0);
+CPPUNIT_ASSERT(pObject);
+
+SdrGrafObj* pGraphicObject = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pGraphicObject);
+
+Graphic aGraphic = pGraphicObject->GetGraphic();
+auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
+CPPUNIT_ASSERT(pVectorGraphicData);
+CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
+ pVectorGraphicData->getVectorGraphicDataType());
+
+lcl_search("NonExisting");
+
+CPPUNIT_ASSERT_EQUAL(false, mpCallbackRecorder->m_bFound);
+}
+
+void LOKi

[Libreoffice-commits] core.git: sd/qa sd/source slideshow/source xmloff/source

2020-04-25 Thread Regina Henschel (via logerrit)
 sd/qa/unit/data/tdf129898_faulty_DrawnInSlideshow.odp |binary
 sd/qa/unit/misc-tests.cxx |   25 
 sd/source/ui/slideshow/slideshow.cxx  |   26 +
 sd/source/ui/view/drviews5.cxx|   17 +++
 slideshow/source/engine/slideshowimpl.cxx |   27 +++---
 xmloff/source/draw/layerimp.cxx   |9 ++
 6 files changed, 94 insertions(+), 10 deletions(-)

New commits:
commit eb2d669af61b8808d5819b16157c59d3c6c3e03b
Author: Regina Henschel 
AuthorDate: Sun Apr 19 18:22:11 2020 +0200
Commit: Regina Henschel 
CommitDate: Sat Apr 25 14:49:30 2020 +0200

tdf#129898 Use layer DrawnInSlideshow in edit mode

If 'Mouse pointer as pen' is set in slideshow settings, painting in
slideshow becomes persistent. A layer DrawnInSlideshow is created
for that purpose during slideshow. But that layer was not known to
the view from where the slideshow was started.
Generating a layer had been done regardless whether such layer
already exists or not. That had produced several layers with
identical name. That may not happen, because layers are identified
by name.

Change-Id: I2ba9bad5babe5a1bba3d1fc69d028d9037d2bd47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92502
Tested-by: Jenkins
Reviewed-by: Regina Henschel 

diff --git a/sd/qa/unit/data/tdf129898_faulty_DrawnInSlideshow.odp 
b/sd/qa/unit/data/tdf129898_faulty_DrawnInSlideshow.odp
new file mode 100644
index ..796b57b2cb84
Binary files /dev/null and 
b/sd/qa/unit/data/tdf129898_faulty_DrawnInSlideshow.odp differ
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 3e23752aa477..53707a5676a2 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -82,6 +82,7 @@ public:
 void testTdf98839_ShearVFlipH();
 void testTdf130988();
 void testTdf131033();
+void testTdf129898LayerDrawnInSlideshow();
 
 CPPUNIT_TEST_SUITE(SdMiscTest);
 CPPUNIT_TEST(testTdf96206);
@@ -102,6 +103,7 @@ public:
 CPPUNIT_TEST(testTdf98839_ShearVFlipH);
 CPPUNIT_TEST(testTdf130988);
 CPPUNIT_TEST(testTdf131033);
+CPPUNIT_TEST(testTdf129898LayerDrawnInSlideshow);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -854,6 +856,29 @@ void SdMiscTest::testTdf131033()
 xDocShRef->DoClose();
 }
 
+void SdMiscTest::testTdf129898LayerDrawnInSlideshow()
+{
+// Versions LO 6.2 to 6.4 have produced files, where the layer 
DrawnInSlideshow has
+// got visible=false and printable=false attributes. Those files should be 
repaired now.
+const OUString sURL = 
"sd/qa/unit/data/tdf129898_faulty_DrawnInSlideshow.odp";
+sd::DrawDocShellRef xDocShRef = Load(m_directories.getURLFromSrc(sURL), 
ODP);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocShRef.is());
+
+// Verify model
+const OUString sName = "DrawnInSlideshow";
+SdrLayerAdmin& rLayerAdmin = xDocShRef->GetDoc()->GetLayerAdmin();
+SdrLayer* pLayer = rLayerAdmin.GetLayer(sName);
+CPPUNIT_ASSERT_MESSAGE("No layer DrawnInSlideshow", pLayer);
+CPPUNIT_ASSERT(pLayer->IsVisibleODF() && pLayer->IsPrintableODF());
+
+// Verify view
+sd::DrawViewShell* pViewShell = 
static_cast(xDocShRef->GetViewShell());
+SdrPageView* pPageView = pViewShell->GetView()->GetSdrPageView();
+CPPUNIT_ASSERT(pPageView->IsLayerVisible(sName) && 
pPageView->IsLayerPrintable(sName));
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/slideshow/slideshow.cxx 
b/sd/source/ui/slideshow/slideshow.cxx
index e43d08b960a9..1b63f0d06f14 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -35,6 +36,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -766,6 +768,30 @@ void SAL_CALL SlideShow::end()
 }
 }
 
+// In case mbMouseAsPen was set, a new layer DrawnInSlideshow 
might have been generated
+// during slideshow, which is not known to FrameView yet.
+if (any2bool(getPropertyValue("UsePen"))
+&& 
pViewShell->GetDoc()->GetLayerAdmin().GetLayer("DrawnInSlideshow"))
+{
+SdrLayerIDSet aDocLayerIDSet;
+
pViewShell->GetDoc()->GetLayerAdmin().getVisibleLayersODF(aDocLayerIDSet);
+if (pViewShell->GetFrameView()->GetVisibleLayers() != 
aDocLayerIDSet)
+{
+
pViewShell->GetFrameView()->SetVisibleLayers(aDocLayerIDSet);
+}
+
pViewShell->GetDoc()->GetLayerAdmin().getPrintableLayersODF(aDocLayerIDSet);
+if (pViewShell->GetFrameView()->GetPrintableLayers

[Libreoffice-commits] core.git: sd/qa sd/source svx/sdi

2020-04-23 Thread Pranam Lashkari (via logerrit)
 sd/qa/unit/uiimpress.cxx   |   32 
 sd/source/ui/view/drviews7.cxx |   24 +---
 svx/sdi/svx.sdi|2 +-
 3 files changed, 50 insertions(+), 8 deletions(-)

New commits:
commit 23a3727dc6bdb1a3266f71a58cca0bea8f70ac04
Author: Pranam Lashkari 
AuthorDate: Tue Apr 21 18:19:44 2020 +0530
Commit: Szymon Kłos 
CommitDate: Thu Apr 23 13:22:16 2020 +0200

Added parameter to FillPageGradient command

Change-Id: Ife435fc25e8e3114e66461af22ac9e0ef8c9d011
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92235
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index ee9012bc465a..93a76ac2597d 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -313,6 +314,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillColor)
 Color aColor = rPageAttr.GetItem(XATTR_FILLCOLOR)->GetColorValue();
 CPPUNIT_ASSERT_EQUAL(OUString("ff"), aColor.AsRGBHexString());
 }
+
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillGradient)
+{
+// Load the document and create two new windows.
+mxComponent = 
loadFromDesktop(m_directories.getURLFromSrc("sd/qa/unit/data/tdf126197.odp"));
+auto pImpressDocument = 
dynamic_cast(mxComponent.get());
+sd::ViewShell* pViewShell = 
pImpressDocument->GetDocShell()->GetViewShell();
+
+// Set FillPageColor
+
+uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
+{ "FillPageGradientJSON",
+  uno::makeAny(
+  
OUString("{\"style\":\"LINEAR\",\"startcolor\":\"ff\",\"endcolor\":\"ff\","
+   
"\"angle\":\"300\",\"border\":\"0\",\"x\":\"0\",\"y\":\"0\",\"intensstart\":"
+   "\"100\",\"intensend\":\"100\",\"stepcount\":\"0\"}")) 
},
+}));
+
+dispatchCommand(mxComponent, ".uno:FillPageGradient", aPropertyValues);
+
+SdPage* pPage = pViewShell->getCurrentPage();
+const SfxItemSet& rPageAttr = pPage->getSdrPageProperties().GetItemSet();
+
+const XFillStyleItem* pFillStyle = rPageAttr.GetItem(XATTR_FILLSTYLE);
+drawing::FillStyle eXFS = pFillStyle->GetValue();
+CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, eXFS);
+
+XGradient aGradient = 
rPageAttr.GetItem(XATTR_FILLGRADIENT)->GetGradientValue();
+CPPUNIT_ASSERT_EQUAL(OUString("ff"), 
aGradient.GetStartColor().AsRGBHexString());
+CPPUNIT_ASSERT_EQUAL(OUString("ff"), 
aGradient.GetEndColor().AsRGBHexString());
+}
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 3b65b9a62108..a0841616946f 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1804,15 +1804,25 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
 
 case SID_ATTR_PAGE_GRADIENT:
 {
-XFillGradientItem aGradientItem( pArgs->Get( 
XATTR_FILLGRADIENT ) );
+if (SfxItemState::SET == 
pArgs->GetItemState(SID_FILL_GRADIENT_JSON, false, &pItem))
+{
+const SfxStringItem* pJSON = static_cast(pItem);
+XFillGradientItem aGradient( 
XGradient::fromJSON(pJSON->GetValue()) );
+rPageProperties.PutItem( XFillStyleItem( 
drawing::FillStyle_GRADIENT ) );
+rPageProperties.PutItem( aGradient );
+}
+else
+{
+XFillGradientItem aGradientItem( pArgs->Get( 
XATTR_FILLGRADIENT ) );
 
-// MigrateItemSet guarantees unique gradient names
-SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), 
svl::Items{} );
-aMigrateSet.Put( aGradientItem );
-SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), 
mpDrawView->GetModel() );
+// MigrateItemSet guarantees unique gradient names
+SfxItemSet aMigrateSet( 
mpDrawView->GetModel()->GetItemPool(), svl::Items{} );
+aMigrateSet.Put( aGradientItem );
+SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), 
mpDrawView->GetModel() );
 
-rPageProperties.PutItemSet( *pTempSet );
-rPageProperties.PutItem( XFillStyleItem( 
drawing::FillStyle_GRADIENT ) );
+rPageProperties.PutItemSet( *pTempSet );
+rPageProperties.PutItem( XFillStyleItem( 
drawing::FillStyle_GRADIENT ) );
+}
 }
 break;
 
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index cb02b6c7816c..f7925c5c376d 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -2667,7 +2667,7 @@ XFillGradientItem FillGradient SID_ATTR_FILL_GRADIENT
 ]
 
 XFillGradientItem FillPageGr

[Libreoffice-commits] core.git: sd/qa sd/source

2020-04-06 Thread Noel Grandin (via logerrit)
 sd/qa/unit/import-tests.cxx  |3 +--
 sd/source/core/EffectMigration.cxx   |4 +---
 sd/source/filter/eppt/pptx-text.cxx  |1 -
 sd/source/ui/app/sdpopup.cxx |2 --
 sd/source/ui/dlg/dlgfield.cxx|8 
 sd/source/ui/sidebar/MasterPageContainer.cxx |4 
 6 files changed, 2 insertions(+), 20 deletions(-)

New commits:
commit 971db8196fee933fffb4cd4613383026a747b92f
Author: Noel Grandin 
AuthorDate: Mon Apr 6 15:47:24 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Apr 6 18:03:04 2020 +0200

loplugin:unusedvariableplus in sd

Change-Id: I86ac16689360e79ab109cd548b55848522a0553f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91754
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index e47c8e3cbe10..d3670d167ff5 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -879,7 +879,7 @@ void SdImportTest::testStrictOOXML()
 
 SdDrawDocument *pDoc = xDocShRef->GetDoc();
 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != nullptr );
-uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, 
xDocShRef ) );
+getShapeFromPage( 0, 0, xDocShRef );
 
 xDocShRef->DoClose();
 }
@@ -2592,7 +2592,6 @@ void SdImportTest::testTdf114488()
 uno::Reference xGraphic;
 xShape->getPropertyValue("Graphic") >>= xGraphic;
 CPPUNIT_ASSERT(xGraphic.is());
-Graphic aGraphic(xGraphic);
 OUString 
sMimeType(comphelper::GraphicMimeTypeHelper::GetMimeTypeForXGraphic(xGraphic));
 CPPUNIT_ASSERT_EQUAL(OUString("image/x-wmf"), sMimeType);
 
diff --git a/sd/source/core/EffectMigration.cxx 
b/sd/source/core/EffectMigration.cxx
index 7ca5fcee2c92..1aa52dfe0c68 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -656,8 +656,6 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* 
pShape, AnimationEffect
 }
 else
 {
-CustomAnimationPresetPtr pShapePreset( 
rPresets.getEffectDescriptor( "ooo-entrance-appear" ) );
-
 Reference< XAnimationNode > xNode( pPreset->create( "" ) );
 DBG_ASSERT( xNode.is(), 
"EffectMigration::SetTextAnimationEffect(), could not create preset!" );
 if( xNode.is() )
@@ -1281,7 +1279,7 @@ void EffectMigration::SetAnimationPath( SvxShape* pShape, 
SdrPathObj const * pPa
 {
 std::shared_ptr< sd::MainSequence > pMainSequence( 
pPage->getMainSequence() );
 if( pMainSequence.get() )
-CustomAnimationEffectPtr pCreated( pMainSequence->append( 
*pPathObj, makeAny( xShape ), -1.0, "" ) );
+pMainSequence->append( *pPathObj, makeAny( xShape ), -1.0, "" 
);
 }
 }
 }
diff --git a/sd/source/filter/eppt/pptx-text.cxx 
b/sd/source/filter/eppt/pptx-text.cxx
index 5180051ecc2c..46311702b3e4 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -877,7 +877,6 @@ void ParagraphObj::ImplGetNumberingLevel( 
PPTExBulletProvider* pBuProv, sal_Int1
 {
 if ( aBuGraSize.Width() && aBuGraSize.Height() )
 {
-Graphic aGraphic(xGraphic);
 nBulletId = pBuProv->GetId(xGraphic, aBuGraSize );
 if ( nBulletId != 0x )
 bExtendedBulletsUsed = true;
diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx
index 89cf3ea5a4b8..eeadaef35bf9 100644
--- a/sd/source/ui/app/sdpopup.cxx
+++ b/sd/source/ui/app/sdpopup.cxx
@@ -254,8 +254,6 @@ SvxFieldData* SdFieldPopup::GetField()
 
 if( pDocSh )
 {
-SvxExtFileField aFileField( *pFileField );
-
 OUString aName;
 if( pDocSh->HasName() )
 aName = pDocSh->GetMedium()->GetName();
diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx
index 164fbac3b753..9a7bc1d0b2b0 100644
--- a/sd/source/ui/dlg/dlgfield.cxx
+++ b/sd/source/ui/dlg/dlgfield.cxx
@@ -101,7 +101,6 @@ SvxFieldData* SdModifyFieldDlg::GetField()
 }
 else if( dynamic_cast< const SvxExtFileField *>( m_pField ) !=  
nullptr )
 {
-const SvxExtFileField* pFileField = static_cast( m_pField );
 SvxFileType   eType;
 SvxFileFormat eFormat;
 
@@ -116,8 +115,6 @@ SvxFieldData* SdModifyFieldDlg::GetField()
 
 if( pDocSh )
 {
-SvxExtFileField aFileField( *pFileField );
-
 OUString aName;
 if( pDocSh->HasName() )
 aName = pDocSh->GetMedium()->GetName();
@@ -214,7 +211,6 @@ void SdModifyFieldDlg::FillFormatList()
 else if( dynamic_cast< const SvxExtFileField *>( m_pField ) !=  nullptr )
 {
 const SvxExtFileField*

[Libreoffice-commits] core.git: sd/qa sd/source

2020-04-01 Thread Caolán McNamara (via logerrit)
 sd/qa/unit/data/ppt/pass/ofz21531-1.ppt |binary
 sd/source/core/sdpage2.cxx  |4 +++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 57229c65dc4ee811fb620e66173e6a4fa57fa401
Author: Caolán McNamara 
AuthorDate: Tue Mar 31 13:53:29 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 1 20:26:05 2020 +0200

ofz#21531 limit to ord number under total obj count

which fails recently since...

commit b74798941dccd8fbe05c472c868f6c9a9c9a3f4f
Author: Julien Nabet 
Date:   Mon Mar 30 09:42:08 2020 +0200

Simplify SdrObjList::GetObj (svx/svdpage)

commit 8bbd58eca1ead1ec2360497e0d0d1d8125815f83
Date:   Sun Mar 29 22:44:52 2020 +0200

Replace OSL_ASSERT by assert in GetObj (svx/svdpage)

Change-Id: Ieaafe4af370ecb83a95246010f2a973f503d12c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91422
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sd/qa/unit/data/ppt/pass/ofz21531-1.ppt 
b/sd/qa/unit/data/ppt/pass/ofz21531-1.ppt
new file mode 100644
index ..0d93e5b845ff
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/ofz21531-1.ppt differ
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 35dd423e2372..d6b29fa96594 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -367,9 +367,11 @@ void SdPage::lateInit(const SdPage& rSrcPage)
 
 // use shape list directly to preserve constness of rSrcPage
 const std::list< SdrObject* >& rShapeList = 
rSrcPage.maPresentationShapeList.getList();
+const size_t nObjCount = GetObjCount();
 for( SdrObject* pObj : rShapeList )
 {
-InsertPresObj(GetObj(pObj->GetOrdNum()), 
rSrcPage.GetPresObjKind(pObj));
+size_t nOrdNum = pObj->GetOrdNum();
+InsertPresObj(nOrdNum < nObjCount ? GetObj(nOrdNum) : nullptr, 
rSrcPage.GetPresObjKind(pObj));
 }
 
 // header footer
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2020-01-14 Thread Noel Grandin (via logerrit)
 sd/qa/unit/import-tests.cxx
 |4 ++--
 sd/source/core/annotations/Annotation.cxx  
 |2 +-
 sd/source/core/drawdoc.cxx 
 |4 ++--
 sd/source/core/drawdoc4.cxx
 |2 +-
 sd/source/core/text/textapi.cxx
 |2 +-
 sd/source/core/undoanim.cxx
 |2 +-
 sd/source/filter/eppt/pptx-animations.cxx  
 |5 +
 sd/source/filter/eppt/pptx-epptooxml.cxx   
 |5 +
 sd/source/ui/animations/SlideTransitionPane.cxx
 |5 +
 sd/source/ui/framework/configuration/ChangeRequestQueue.cxx
 |4 ++--
 sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx   
 |4 ++--
 sd/source/ui/framework/configuration/Configuration.cxx 
 |4 ++--
 sd/source/ui/framework/configuration/ConfigurationClassifier.cxx   
 |4 ++--
 sd/source/ui/framework/configuration/ConfigurationController.cxx   
 |4 ++--
 sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx
 |4 ++--
 
sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx 
|4 ++--
 sd/source/ui/framework/configuration/ConfigurationTracer.cxx   
 |4 ++--
 sd/source/ui/framework/configuration/ConfigurationUpdater.cxx  
 |4 ++--
 sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx 
 |4 ++--
 sd/source/ui/framework/configuration/ResourceFactoryManager.cxx
 |4 ++--
 sd/source/ui/framework/configuration/ResourceId.cxx
 |4 ++--
 sd/source/ui/framework/configuration/UpdateRequest.cxx 
 |4 ++--
 sd/source/ui/framework/factories/BasicPaneFactory.cxx  
 |4 ++--
 sd/source/ui/framework/factories/BasicToolBarFactory.cxx   
 |4 ++--
 sd/source/ui/framework/factories/BasicViewFactory.cxx  
 |4 ++--
 sd/source/ui/framework/factories/ChildWindowPane.cxx   
 |4 ++--
 sd/source/ui/framework/factories/FrameWindowPane.cxx   
 |4 ++--
 sd/source/ui/framework/factories/FullScreenPane.cxx
 |4 ++--
 sd/source/ui/framework/factories/Pane.cxx  
 |4 ++--
 sd/source/ui/framework/factories/PresentationFactory.cxx   
 |4 ++--
 sd/source/ui/framework/factories/ViewShellWrapper.cxx  
 |4 ++--
 sd/source/ui/framework/module/CenterViewFocusModule.cxx
 |4 ++--
 sd/source/ui/framework/module/DrawModule.cxx   
 |4 ++--
 sd/source/ui/framework/module/ImpressModule.cxx
 |4 ++--
 sd/source/ui/framework/module/ModuleController.cxx 
 |4 ++--
 sd/source/ui/framework/module/PresentationModule.cxx   
 |4 ++--
 sd/source/ui/framework/module/ShellStackGuard.cxx  
 |4 ++--
 sd/source/ui/framework/module/SlideSorterModule.cxx
 |4 ++--
 sd/source/ui/framework/module/ToolBarModule.cxx
 |4 ++--
 sd/source/ui/framework/module/ViewTabBarModule.cxx 
 |4 ++--
 sd/source/ui/framework/tools/FrameworkHelper.cxx   
 |4 ++--
 sd/source/ui/presenter/CanvasUpdateRequester.cxx   
 |4 ++--
 sd/source/ui/presenter/PresenterCanvas.cxx 
 |4 ++--
 sd/source/ui/presenter/PresenterHelper.cxx 
 |4 ++--
 sd/source/ui/presenter/PresenterPreviewCache.cxx   
 |6 +++---
 sd/source/ui/presenter/PresenterTextView.cxx   
 |4 ++--
 sd/source/ui/presenter/SlideRenderer.cxx   
 |4 ++--
 sd/source/ui/sidebar/AllMasterPagesSelector.cxx
 |4 ++--
 sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
 |4 ++--
 sd/source/ui/sidebar/CustomAnimationPanel.cxx  
 |4 ++--
 sd/source/ui/sidebar/DocumentHelper.cxx
 |4 ++--
 sd/source/ui/sidebar/LayoutMenu.cxx
 |4 ++--
 sd/source/ui/sidebar/MasterPageContainer.cxx   
 |4 ++--
 sd/source/ui/sideb

[Libreoffice-commits] core.git: sd/qa sd/source

2019-10-05 Thread Noel Grandin (via logerrit)
 sd/qa/unit/dialogs-test.cxx|8 
 sd/source/ui/dlg/dlgsnap.cxx   |2 +-
 sd/source/ui/dlg/tpaction.cxx  |5 +++--
 sd/source/ui/func/fuoaprms.cxx |   33 +
 sd/source/ui/func/fusnapln.cxx |2 +-
 sd/source/ui/view/drviewsd.cxx |2 +-
 6 files changed, 27 insertions(+), 25 deletions(-)

New commits:
commit 96ccf745fb212f85a81afb4b9d17fa0f7667b935
Author: Noel Grandin 
AuthorDate: Fri Oct 4 18:34:54 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 5 13:16:19 2019 +0200

Convert some SID in sd to SfxUInt16Item

Some, like SID_NAVIGATOR_PAGE were incorrectly using
SfxAllEnumItem, and others did not need to use SfxAllEnumItem.

Change-Id: I0f61dcdda8bbc021667db3cf78141778f7b85087
Reviewed-on: https://gerrit.libreoffice.org/80252
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 102d6f8af58e..231870815657 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -501,8 +501,8 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 CPPUNIT_ASSERT(pDrawDoc);
 SfxItemSet aSet(pDrawDoc->GetItemPool(), 
svl::Items{});
 aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, false));
-aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, 
sal_uInt16(presentation::AnimationEffect_NONE)));
-aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, 
sal_uInt16(presentation::AnimationEffect_NONE)));
+aSet.Put(SfxUInt16Item(ATTR_ANIMATION_EFFECT, 
sal_uInt16(presentation::AnimationEffect_NONE)));
+aSet.Put(SfxUInt16Item(ATTR_ANIMATION_TEXTEFFECT, 
sal_uInt16(presentation::AnimationEffect_NONE)));
 aSet.InvalidateItem(ATTR_ANIMATION_SPEED);
 aSet.Put(SfxBoolItem(ATTR_ANIMATION_FADEOUT, false));
 aSet.Put(SvxColorItem(COL_LIGHTGRAY, ATTR_ANIMATION_COLOR));
@@ -510,9 +510,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 aSet.Put(SfxBoolItem(ATTR_ANIMATION_SOUNDON, false));
 aSet.InvalidateItem(ATTR_ANIMATION_SOUNDFILE);
 aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, false));
-aSet.Put(SfxAllEnumItem(ATTR_ACTION, 
sal_uInt16(presentation::ClickAction_NONE)));
+aSet.Put(SfxUInt16Item(ATTR_ACTION, 
sal_uInt16(presentation::ClickAction_NONE)));
 aSet.InvalidateItem(ATTR_ACTION_FILENAME);
-aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, 
sal_uInt16(presentation::AnimationEffect_NONE)));
+aSet.Put(SfxUInt16Item(ATTR_ACTION_EFFECT, 
sal_uInt16(presentation::AnimationEffect_NONE)));
 aSet.InvalidateItem(ATTR_ACTION_EFFECTSPEED);
 aSet.Put(SfxBoolItem(ATTR_ACTION_SOUNDON, false));
 aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, false));
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index db5328edb471..c07fa83552e4 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -126,7 +126,7 @@ void SdSnapLineDlg::GetAttr(SfxItemSet& rOutAttrs)
 nXValue = sal_Int32(GetCoreValue(*m_xMtrFldX, MapUnit::Map100thMM) * 
aUIScale);
 nYValue = sal_Int32(GetCoreValue(*m_xMtrFldY, MapUnit::Map100thMM) * 
aUIScale);
 
-rOutAttrs.Put(SfxAllEnumItem(ATTR_SNAPLINE_KIND, 
static_cast(eKind)));
+rOutAttrs.Put(SfxUInt16Item(ATTR_SNAPLINE_KIND, 
static_cast(eKind)));
 rOutAttrs.Put(SfxInt32Item(ATTR_SNAPLINE_X, nXValue));
 rOutAttrs.Put(SfxInt32Item(ATTR_SNAPLINE_Y, nYValue));
 }
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 6fc4c2b8e998..a908348123b8 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -249,7 +250,7 @@ bool SdTPAction::FillItemSet( SfxItemSet* rAttrs )
 
 if( m_xLbAction->get_value_changed_from_saved() )
 {
-rAttrs->Put( SfxAllEnumItem( ATTR_ACTION, static_cast(eCA) 
) );
+rAttrs->Put( SfxUInt16Item( ATTR_ACTION, static_cast(eCA) 
) );
 bModified = true;
 }
 else
@@ -290,7 +291,7 @@ void SdTPAction::Reset( const SfxItemSet* rAttrs )
 // m_xLbAction
 if( rAttrs->GetItemState( ATTR_ACTION ) != SfxItemState::DONTCARE )
 {
-eCA = static_cast(static_cast( rAttrs->
+eCA = static_cast(static_cast( rAttrs->
 Get( ATTR_ACTION ) ).GetValue());
 SetActualClickAction( eCA );
 }
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index 7f8b9302f23e..38bb2b032d82 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -347,21 +348,21 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& 
rReq )
 aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, f

[Libreoffice-commits] core.git: sd/qa sd/source

2019-09-05 Thread Tamás Zolnai (via logerrit)
 sd/qa/unit/data/odp/tdf127379.odp|binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   28 
 sd/source/filter/eppt/pptx-epptooxml.cxx |1 -
 3 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit ced915bf4c4dfc890193bbea269ef74995ecc888
Author: Tamás Zolnai 
AuthorDate: Thu Sep 5 19:22:35 2019 +0200
Commit: Tamás Zolnai 
CommitDate: Fri Sep 6 08:00:02 2019 +0200

tdf#127379: PPTX: Gradient background fill of a slide is lost during RT.

Change-Id: I149bf161f53d566d461347e00d04fc45394bc051
Reviewed-on: https://gerrit.libreoffice.org/78670
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/sd/qa/unit/data/odp/tdf127379.odp 
b/sd/qa/unit/data/odp/tdf127379.odp
new file mode 100644
index ..91602c79623f
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf127379.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index b006cbdc9c68..3944a8e3538b 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -178,6 +178,7 @@ public:
 void testTdf126234();
 void testTdf126741();
 void testTdf127372();
+void testTdf127379();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -274,6 +275,7 @@ public:
 CPPUNIT_TEST(testTdf126234);
 CPPUNIT_TEST(testTdf126741);
 CPPUNIT_TEST(testTdf127372);
+CPPUNIT_TEST(testTdf127379);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2552,6 +2554,32 @@ void SdOOXMLExportTest2::testTdf127372()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00), aTransparenceGradient.EndColor);
 }
 
+void SdOOXMLExportTest2::testTdf127379()
+{
+::sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf127379.odp"), ODP);
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+uno::Reference< drawing::XDrawPagesSupplier > xDoc(
+xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDoc->getDrawPages()->getCount() );
+
+uno::Reference< drawing::XDrawPage > xPage( getPage( 0, xDocShRef ) );
+uno::Reference< beans::XPropertySet > xPropSet( xPage, uno::UNO_QUERY );
+
+uno::Any aAny = xPropSet->getPropertyValue( "Background" );
+CPPUNIT_ASSERT_MESSAGE("Slide background is missing", aAny.hasValue());
+uno::Reference< beans::XPropertySet > aXBackgroundPropSet;
+aAny >>= aXBackgroundPropSet;
+
+drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
+aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
+CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle);
+
+awt::Gradient aGradient;
+CPPUNIT_ASSERT(aXBackgroundPropSet->getPropertyValue("FillGradient") >>= 
aGradient);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF), aGradient.StartColor);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2A6099), aGradient.EndColor);
+}
+
 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 b2b8512267f7..47cf5be5b1d2 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -464,7 +464,6 @@ void PowerPointExport::ImplWriteBackground(const 
FSHelperPtr& pFS, const Referen
 mAny >>= aFillStyle;
 
 if (aFillStyle == FillStyle_NONE ||
-aFillStyle == FillStyle_GRADIENT ||
 aFillStyle == FillStyle_HATCH)
 return;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sd/qa sd/source

2019-08-28 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/tiledrendering/tiledrendering.cxx |6 +-
 sd/source/ui/docshell/docshell.cxx   |   15 ++-
 2 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 52d7c6be46663d4a28745a0cfa2ced5493637230
Author: Miklos Vajna 
AuthorDate: Fri Jul 26 15:26:40 2019 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 28 18:04:47 2019 +0200

sd lok: extend language status with BCP 47 language tag info in here as well

This brings Impress in sync with Calc, which does this since commit
47025060e4474d23e3bd97053a77b3943eeae724 (Send Bcp47 codes with region,
2019-08-28).

Change-Id: I04b92c85b6627e145b5271a6f84780257e8f0d55
Reviewed-on: https://gerrit.libreoffice.org/78231
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index af443317b94e..e5783a1731b3 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1891,7 +1891,11 @@ void SdTiledRenderingTest::testLanguageStatus()
 std::unique_ptr xItem2;
 pView1->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, 
xItem1);
 pView2->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, 
xItem2);
-CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(xItem1.get()));
+auto pStringItem = dynamic_cast(xItem1.get());
+CPPUNIT_ASSERT(pStringItem);
+
+CPPUNIT_ASSERT_EQUAL(OUString("English (USA);en-US"), 
pStringItem->GetValue());
+
 CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(xItem2.get()));
 }
 }
diff --git a/sd/source/ui/docshell/docshell.cxx 
b/sd/source/ui/docshell/docshell.cxx
index 5b5ddfdce17e..ad0ce701bdfe 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -60,6 +60,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace sd;
 #define ShellClass_DrawDocShell
@@ -284,7 +285,19 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
 eLanguage = mpDoc->GetLanguage( EE_CHAR_LANGUAGE );
 }
 
-rSet.Put(SfxStringItem(nWhich, 
SvtLanguageTable::GetLanguageString(eLanguage)));
+OUString aLanguage = 
SvtLanguageTable::GetLanguageString(eLanguage);
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (eLanguage == LANGUAGE_DONTKNOW)
+{
+aLanguage += ";-";
+}
+else
+{
+aLanguage += ";" + 
LanguageTag(eLanguage).getBcp47(false);
+}
+}
+rSet.Put(SfxStringItem(nWhich, aLanguage));
 }
 break;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sd/qa sd/source

2019-07-19 Thread Noel Grandin (via logerrit)
 sd/qa/unit/export-tests-ooxml1.cxx|4 -
 sd/qa/unit/export-tests-ooxml2.cxx|2 
 sd/qa/unit/export-tests.cxx   |   18 +++
 sd/qa/unit/import-tests-smartart.cxx  |   15 ++---
 sd/qa/unit/import-tests.cxx   |5 -
 sd/qa/unit/misc-tests.cxx |2 
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |6 +-
 sd/source/core/CustomAnimationEffect.cxx  |   36 ++
 sd/source/core/sdpage.cxx |2 
 sd/source/filter/eppt/pptexanimations.cxx |6 +-
 sd/source/filter/eppt/pptx-animations.cxx |4 -
 sd/source/filter/eppt/pptx-epptbase.cxx   |4 -
 sd/source/filter/eppt/pptx-epptooxml.cxx  |   17 ++
 sd/source/filter/ppt/pptinanimations.cxx  |2 
 sd/source/filter/xml/sdxmlwrp.cxx |9 +--
 sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx |2 
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx |   10 +--
 sd/source/ui/dlg/PhotoAlbumDialog.cxx |5 -
 sd/source/ui/dlg/sdtreelb.cxx |5 -
 sd/source/ui/dlg/tpaction.cxx |7 +-
 sd/source/ui/dlg/tpoption.cxx |4 -
 sd/source/ui/framework/factories/BasicViewFactory.cxx |5 -
 sd/source/ui/framework/factories/ViewShellWrapper.cxx |2 
 sd/source/ui/func/fuinsert.cxx|   12 +---
 sd/source/ui/presenter/PresenterCanvas.cxx|2 
 sd/source/ui/presenter/PresenterHelper.cxx|3 -
 sd/source/ui/remotecontrol/Communicator.cxx   |2 
 sd/source/ui/remotecontrol/ImagePreparer.cxx  |   11 +---
 sd/source/ui/sidebar/DocumentHelper.cxx   |4 -
 sd/source/ui/sidebar/MasterPageContainer.cxx  |4 -
 sd/source/ui/sidebar/SlideBackground.cxx  |6 +-
 sd/source/ui/slideshow/slideshowimpl.cxx  |2 
 sd/source/ui/slidesorter/controller/SlsListener.cxx   |   10 +--
 sd/source/ui/slidesorter/model/SlideSorterModel.cxx   |4 -
 sd/source/ui/tools/EventMultiplexer.cxx   |   15 ++---
 sd/source/ui/unoidl/SdUnoDrawView.cxx |4 -
 sd/source/ui/unoidl/UnoDocumentSettings.cxx   |3 -
 sd/source/ui/unoidl/randomnode.cxx|2 
 sd/source/ui/unoidl/unomodel.cxx  |   12 +---
 sd/source/ui/unoidl/unosrch.cxx   |9 +--
 sd/source/ui/view/outlview.cxx|2 
 sd/source/ui/view/sdview3.cxx |2 
 42 files changed, 125 insertions(+), 156 deletions(-)

New commits:
commit 775c8a76d61f5692c54f524725b369cfd2a91539
Author: Noel Grandin 
AuthorDate: Fri Jul 19 20:10:21 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 20 07:57:28 2019 +0200

loplugin:referencecasting in sd

Change-Id: Ief0d02006afd6cb9cd6da1da9208e374df644a42
Reviewed-on: https://gerrit.libreoffice.org/75977
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index a3df821e1bf0..de21002e9796 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -465,7 +465,7 @@ void SdOOXMLExportTest1::testFdo83751()
 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != nullptr );
 
 uno::Reference 
xDocumentPropertiesSupplier( xDocShRef->GetModel(), uno::UNO_QUERY );
-uno::Reference xProps( 
xDocumentPropertiesSupplier->getDocumentProperties(), uno::UNO_QUERY );
+uno::Reference xProps = 
xDocumentPropertiesSupplier->getDocumentProperties();
 uno::Reference xUDProps( 
xProps->getUserDefinedProperties(), uno::UNO_QUERY );
 OUString propValue;
 xUDProps->getPropertyValue("Testing") >>= propValue;
@@ -492,7 +492,7 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/Table_with_Cell_Fill.odp"),
 ODP);
 
 // Export the document and import again for a check
-uno::Reference< lang::XComponent > xComponent(xDocShRef->GetModel(), 
uno::UNO_QUERY);
+uno::Reference< lang::XComponent > xComponent = xDocShRef->GetModel();
 uno::Reference xStorable(xComponent, uno::UNO_QUERY);
 utl::MediaDescriptor aMediaDescriptor;
 aMediaDescriptor["FilterName"] <<= 
OStringToOUString(OString(aFileFormats[PPTX].pFilterName), 
RTL_TEXTENCODING_UTF8);
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index ea41ec84a47a..ac274d631a2a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-oo

[Libreoffice-commits] core.git: sd/qa sd/source

2019-07-04 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/data/tdf126197.odp  |binary
 sd/qa/unit/uiimpress.cxx   |   31 +++
 sd/source/ui/view/drviewse.cxx |5 +
 3 files changed, 36 insertions(+)

New commits:
commit 80db66c4f345ac469943f871308b14b7f5ed0a11
Author: Xisco Fauli 
AuthorDate: Tue Jul 2 17:36:50 2019 +0200
Commit: Xisco Faulí 
CommitDate: Thu Jul 4 14:25:03 2019 +0200

tdf#126197: EndTextEdit on all views before delete/cut shape

Change-Id: I3da93e5c72ee6f6f99120758e870d654e01a0ec7
Reviewed-on: https://gerrit.libreoffice.org/75001
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sd/qa/unit/data/tdf126197.odp b/sd/qa/unit/data/tdf126197.odp
new file mode 100644
index ..cbe5b074464f
Binary files /dev/null and b/sd/qa/unit/data/tdf126197.odp differ
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index b8d9017b2cf9..2125820c7c50 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -120,6 +120,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf111522)
 pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_UNDO, 
SfxCallMode::SYNCHRON);
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf126197)
+{
+// Load the document and create two new windows.
+mxComponent = 
loadFromDesktop(m_directories.getURLFromSrc("sd/qa/unit/data/tdf126197.odp"));
+auto pImpressDocument = 
dynamic_cast(mxComponent.get());
+sd::ViewShell* pViewShell = 
pImpressDocument->GetDocShell()->GetViewShell();
+pViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_NEWWINDOW, 
SfxCallMode::SYNCHRON);
+sd::ViewShell* pViewShell1 = 
pImpressDocument->GetDocShell()->GetViewShell();
+pViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_NEWWINDOW, 
SfxCallMode::SYNCHRON);
+sd::ViewShell* pViewShell2 = 
pImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell1 != pViewShell2);
+
+// Start text edit in window 1.
+SdPage* pPage1 = pViewShell1->GetActualPage();
+SdrObject* pShape1 = pPage1->GetObj(0);
+SdrView* pView1 = pViewShell1->GetView();
+pView1->MarkObj(pShape1, pView1->GetSdrPageView());
+pView1->SdrBeginTextEdit(pShape1);
+CPPUNIT_ASSERT(pView1->IsTextEdit());
+
+SdPage* pPage2 = pViewShell2->GetActualPage();
+CPPUNIT_ASSERT_EQUAL(pPage1, pPage2);
+SdrObject* pShape2 = pPage2->GetObj(0);
+CPPUNIT_ASSERT_EQUAL(pShape1, pShape2);
+SdrView* pView2 = pViewShell2->GetView();
+pView2->MarkObj(pShape2, pView2->GetSdrPageView());
+
+// Without the accompanying fix in place, this test would have failed with 
an assertion failure
+// in SdrObjEditView::SdrEndTextEdit()
+pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, 
SfxCallMode::SYNCHRON);
+}
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 0c9ee3867fec..9cebd8c4f0d8 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -824,6 +824,10 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 }
 else
 {
+//tdf#126197: EndTextEdit in all views if current one is not 
in TextEdit
+if ( !mpDrawView->IsTextEdit() )
+mpDrawView->EndTextEditAllViews();
+
 if(HasCurrentFunction())
 {
 GetCurrentFunction()->DoCut();
@@ -998,6 +1002,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 }
 else
 {
+mpDrawView->EndTextEditAllViews();
 FuDeleteSelectedObjects();
 }
 rReq.Ignore ();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sd/qa sd/source

2019-05-24 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/tiledrendering/data/language-all-text.odp |binary
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   31 +++
 sd/source/ui/docshell/docshel3.cxx   |   14 
 3 files changed, 45 insertions(+)

New commits:
commit 863533ee2c00db3dde1f078b9f21f7e8e1d1333e
Author: Miklos Vajna 
AuthorDate: Fri May 24 13:44:38 2019 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 24 14:33:38 2019 +0200

sd: make Tools -> Language -> For All Text affect shape text

The problem was that in case the shape text has an explicit language
set, then the shape language will have no effect on shape text language;
need to clear those attributes explicitly.

The const_cast<> for the EditTextObject should be OK, since we change
the shape's item set anyway, so we don't omit any needed notifications.

Change-Id: I721e3f0aefa103a6bfa320a671da2ee1e039fa38
Reviewed-on: https://gerrit.libreoffice.org/72904
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/qa/unit/tiledrendering/data/language-all-text.odp 
b/sd/qa/unit/tiledrendering/data/language-all-text.odp
new file mode 100644
index ..a484a6310e51
Binary files /dev/null and 
b/sd/qa/unit/tiledrendering/data/language-all-text.odp differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 6e38741acd7d..80bd4e155cd3 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -121,6 +121,7 @@ public:
 void testTdf115873Group();
 void testCutSelectionChange();
 void testRegenerateDiagram();
+void testLanguageAllText();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -168,6 +169,7 @@ public:
 CPPUNIT_TEST(testTdf115873Group);
 CPPUNIT_TEST(testCutSelectionChange);
 CPPUNIT_TEST(testRegenerateDiagram);
+CPPUNIT_TEST(testLanguageAllText);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1966,6 +1968,35 @@ void SdTiledRenderingTest::testLanguageStatus()
 comphelper::LibreOfficeKit::setActive(false);
 }
 
+void SdTiledRenderingTest::testLanguageAllText()
+{
+// Load the document, which has a single shape, with Hungarian text.
+comphelper::LibreOfficeKit::setActive();
+createDoc("language-all-text.odp");
+
+// Set tha language to English for all text.
+uno::Sequence aArgs = 
comphelper::InitPropertySequence({
+{ "Language", uno::makeAny(OUString("Default_English (USA)")) },
+});
+comphelper::dispatchCommand(".uno:LanguageStatus", aArgs);
+Scheduler::ProcessEventsToIdle();
+
+// Assert that the shape text language was changed.
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape(xPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xRun(
+getRunFromParagraph(0, getParagraphFromShape(0, xShape)), 
uno::UNO_QUERY);
+lang::Locale aLocale;
+xRun->getPropertyValue("CharLocale") >>= aLocale;
+// Without the accompanying fix in place, this test would have failed with 
'Expected: en;
+// Actual: hu', as the shape text language was not set.
+CPPUNIT_ASSERT_EQUAL(OUString("en"), aLocale.Language);
+
+comphelper::LibreOfficeKit::setActive(false);
+}
+
 void SdTiledRenderingTest::testDefaultView()
 {
 // Load the document with notes view.
diff --git a/sd/source/ui/docshell/docshel3.cxx 
b/sd/source/ui/docshell/docshel3.cxx
index 5cbb20d429ea..f93681c6c2a3 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -34,6 +34,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -84,6 +86,18 @@ static void lcl_setLanguageForObj( SdrObject *pObj, 
LanguageType nLang, bool bLa
 return;
 }
 pObj->SetMergedItem( SvxLanguageItem( nLang, nLangWhichId ) );
+
+// Reset shape text language to default, so it inherits the shape 
language set above.
+OutlinerParaObject* pOutliner = pObj->GetOutlinerParaObject();
+if (pOutliner)
+{
+EditTextObject& rEditTextObject
+= const_cast(pOutliner->GetTextObject());
+for (sal_uInt16 n : aLangWhichId_EE)
+{
+rEditTextObject.RemoveCharAttribs(n);
+}
+}
 }
 }
 else// Reset to default
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sd/qa sd/source

2019-04-30 Thread Mark Hung (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx|   15 ---
 sd/source/filter/eppt/pptx-animations.cxx |   39 +++---
 sd/source/filter/eppt/pptx-epptooxml.cxx  |5 ++-
 3 files changed, 50 insertions(+), 9 deletions(-)

New commits:
commit b593634d3cfbb2fc8522d99ce1c3f2a11445ea59
Author: Mark Hung 
AuthorDate: Sat Apr 27 19:02:25 2019 +0800
Commit: Mark Hung 
CommitDate: Tue Apr 30 15:03:19 2019 +0200

tdf#124230 pptx: make exported animation sound work.

1. Fix target path for the embedded media. Move the media
file to /ppt/media ( was /media ) and use the relative path
../media for the target path when adding the relation. This
is necessary for MSO to play the sound.

2. Write timenode id for the start or end conditions if the
animation node for the begin event or the end event is
available. Events like BEGIN or END has to refer a timenode.
Without specifying referred timenode in start and end
condition, Impress will not activate the audio node after
importing the document.

Change-Id: I6027be2e836e2f86061e401c8af806b2b1993a49
Reviewed-on: https://gerrit.libreoffice.org/71427
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 7c27e0a315cc..66c6154f1da2 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -2087,31 +2087,38 @@ void SdOOXMLExportTest2::testTdf44223()
 = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf44223.pptx"), 
PPTX);
 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
 
-std::shared_ptr const pStream1(parseExportStream(tempFile, 
"media/audio1.wav"));
+std::shared_ptr const pStream1(parseExportStream(tempFile, 
"ppt/media/audio1.wav"));
 CPPUNIT_ASSERT_EQUAL(sal_uInt64(11140), pStream1->remainingSize());
 
-std::shared_ptr const pStream2(parseExportStream(tempFile, 
"media/audio2.wav"));
+std::shared_ptr const pStream2(parseExportStream(tempFile, 
"ppt/media/audio2.wav"));
 CPPUNIT_ASSERT_EQUAL(sal_uInt64(28074), pStream2->remainingSize());
 
 xmlDocPtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml");
 assertXPath(pXmlContentType,
-
"/ContentType:Types/ContentType:Override[@PartName='/media/audio1.wav']",
+
"/ContentType:Types/ContentType:Override[@PartName='/ppt/media/audio1.wav']",
 "ContentType",
 "audio/x-wav");
 
 assertXPath(pXmlContentType,
-
"/ContentType:Types/ContentType:Override[@PartName='/media/audio2.wav']",
+
"/ContentType:Types/ContentType:Override[@PartName='/ppt/media/audio2.wav']",
 "ContentType",
 "audio/x-wav");
 
 xmlDocPtr pDoc1 = parseExport(tempFile, "ppt/slides/slide1.xml");
 
+// Start condition: 0s after timenode id 5 begins.
 assertXPath(pDoc1 , "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", 
"evt", "begin");
 assertXPath(pDoc1 , "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", 
"delay", "0");
+assertXPath(pDoc1 , 
"//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond/p:tn", "val", "5");
 
 xmlDocPtr pDoc2 = parseExport(tempFile, "ppt/slides/slide2.xml");
 assertXPath(pDoc2 , "//p:transition/p:sndAc/p:stSnd/p:snd[@r:embed]", 2);
 
+xmlDocPtr pRels1 = parseExport(tempFile, 
"ppt/slides/_rels/slide1.xml.rels");
+assertXPath(pRels1, "//rels:Relationship[@Id='rId1']", "Type",
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio";);
+assertXPath(pRels1, "//rels:Relationship[@Id='rId1']", "Target", 
"../media/audio1.wav");
+
 xDocShRef->DoClose();
 }
 
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index a8c062b5c7df..da5223c50ec7 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -59,6 +59,7 @@
 #include "pptexanimations.hxx"
 #include "pptx-animations.hxx"
 #include "../ppt/pptanimations.hxx"
+#include 
 
 using namespace ::com::sun::star::animations;
 using namespace ::com::sun::star::container;
@@ -569,6 +570,7 @@ struct Cond
 OString msDelay;
 const char* mpEvent;
 Reference mxShape;
+Reference mxNode;
 
 Cond(const Any& rAny, bool bIsMainSeqChild);
 
@@ -596,7 +598,8 @@ Cond::Cond(const Any& rAny, bool bIsMainSeqChild)
 else
 {
 mpEvent = convertEventTrigger(aEvent.Trigger);
-aEvent.Source >>= mxShape;
+if (!(aEvent.Source >>= mxShape))
+aEvent.Source >>= mxNode;
 
 if (aEvent.Offset >>= fDelay)
 bHasFDelay = true;
@@ -632,6 +635,11 @@ class PPTXAnimationExport
 const FSHelperPtr& mpFS;
 const NodeContext* mpContext;
 
+std::map, sal_Int32, 
::comphelper::OInterfaceCompare>
+maAnimationNodeIdMap;
+

[Libreoffice-commits] core.git: sd/qa sd/source

2019-03-04 Thread Libreoffice Gerrit user
 sd/qa/unit/export-tests-ooxml2.cxx|   37 +++
 sd/qa/unit/import-tests.cxx   |   27 ---
 sd/source/filter/eppt/epptooxml.hxx   |3 +
 sd/source/filter/eppt/pptx-animations.cxx |   47 ++-
 sd/source/filter/eppt/pptx-epptooxml.cxx  |   73 ++
 5 files changed, 158 insertions(+), 29 deletions(-)

New commits:
commit d98d3e2a0bc087ec9157e8e32e9f0ea4207d36e2
Author: Mark Hung 
AuthorDate: Fri Mar 1 10:09:30 2019 +0800
Commit: Mark Hung 
CommitDate: Mon Mar 4 14:32:15 2019 +0100

tdf#44223: Export the audio of effects and transitions.

This will allow to round trip the test case for the slide
transition and the animation effect audio.

Change-Id: Iac524e6bbcdb0a29491cfeba63121c845685fd11
Reviewed-on: https://gerrit.libreoffice.org/68540
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index ae60952752fc..eda6827a6869 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -198,6 +198,7 @@ public:
 void testTdf119118();
 void testTdf99213();
 void testPotxExport();
+void testTdf44223();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -278,6 +279,7 @@ public:
 CPPUNIT_TEST(testTdf119118);
 CPPUNIT_TEST(testTdf99213);
 CPPUNIT_TEST(testPotxExport);
+CPPUNIT_TEST(testTdf44223);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -297,6 +299,7 @@ public:
 { "wp", 
"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"; },
 { "p", 
"http://schemas.openxmlformats.org/presentationml/2006/main"; },
 { "p14", 
"http://schemas.microsoft.com/office/powerpoint/2010/main"; },
+{ "r", 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships"; },
 { "w", 
"http://schemas.openxmlformats.org/wordprocessingml/2006/main"; },
 { "a14", "http://schemas.microsoft.com/office/drawing/2010/main"; },
 { "wps", 
"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"; },
@@ -2066,6 +2069,40 @@ void SdOOXMLExportTest2::testPotxExport()
 assertXPath(pContentTypes, 
"/ContentType:Types/ContentType:Override[@PartName='/ppt/presentation.xml']",
 "ContentType", 
"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml");
 }
+
+void SdOOXMLExportTest2::testTdf44223()
+{
+utl::TempFile tempFile;
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf44223.pptx"), 
PPTX);
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+std::shared_ptr const pStream1(parseExportStream(tempFile, 
"media/audio1.wav"));
+CPPUNIT_ASSERT_EQUAL(sal_uInt64(11140), pStream1->remainingSize());
+
+std::shared_ptr const pStream2(parseExportStream(tempFile, 
"media/audio2.wav"));
+CPPUNIT_ASSERT_EQUAL(sal_uInt64(28074), pStream2->remainingSize());
+
+xmlDocPtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml");
+assertXPath(pXmlContentType,
+
"/ContentType:Types/ContentType:Override[@PartName='/media/audio1.wav']",
+"ContentType",
+"audio/x-wav");
+
+assertXPath(pXmlContentType,
+
"/ContentType:Types/ContentType:Override[@PartName='/media/audio2.wav']",
+"ContentType",
+"audio/x-wav");
+
+xmlDocPtr pDoc1 = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pDoc1 , "//p:audio/p:cMediaNode/p:tgtEl/p:sndTgt[@r:embed]", 
1);
+
+xmlDocPtr pDoc2 = parseExport(tempFile, "ppt/slides/slide2.xml");
+assertXPath(pDoc2 , "//p:transition/p:sndAc/p:stSnd/p:snd[@r:embed]", 2);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 684dacbb7a84..44464e2559a2 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -44,8 +44,6 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -194,7 +192,6 @@ public:
 void testTdf123090();
 void testTdf120028();
 void testTdf120028b();
-void testTdf44223();
 void testDescriptionImport();
 void testTdf83247();
 void testTdf47365();
@@ -282,7 +279,6 @@ public:
 CPPUNIT_TEST(testTdf123090);
 CPPUNIT_TEST(testTdf120028);
 CPPUNIT_TEST(testTdf120028b);
-CPPUNIT_TEST(testTdf44223);
 CPPUNIT_TEST(testDescriptionImport);
 CPPUNIT_TEST(testTdf83247);
 CPPUNIT_TEST(testTdf47365);
@@ -2632,29 +2628,6 @@ void SdImportTest::testTdf120028b()
 xDocShRef->DoClose();
 }
 
-void SdImportTest::testTdf44223()
-{
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf44223.pptx"), 
PPTX);
-uno::Reference 

[Libreoffice-commits] core.git: sd/qa sd/source

2019-02-22 Thread Libreoffice Gerrit user
 sd/qa/unit/data/odp/loopNoPause.odp |binary
 sd/qa/unit/data/odp/loopPause10.odp |binary
 sd/qa/unit/data/ppt/loopNoPause.ppt |binary
 sd/qa/unit/import-tests.cxx |   28 
 sd/source/core/drawdoc.cxx  |2 +-
 5 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit bde5a8623262e50c12a073eb5a78c95211a650a3
Author: Mike Kaganski 
AuthorDate: Fri Feb 22 11:45:56 2019 +0300
Commit: Mike Kaganski 
CommitDate: Fri Feb 22 13:15:47 2019 +0100

tdf#61679 tdf#83247: default presentation pause should be 0 s

OpenDocument Version 1.2 [1] requires that missing presentation:pause
attribute be treated as if 0 s duration was set.

Changing the default here in PresentationSettings ctor will (1) allow LO
to conform to the standard reading ODF; (2) not introduce the 10-s pause
when importing external formats (such as PPT, which has no pause, and
should work as if the pause is 0 s); and (3) change the default pause
value for the newly created presentation (if no template is used).

[1] 
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1417722_253892949

Change-Id: I6df2e83d07980b679574ec81fae001ca40f116fd
Reviewed-on: https://gerrit.libreoffice.org/68190
Reviewed-by: Heiko Tietze 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sd/qa/unit/data/odp/loopNoPause.odp 
b/sd/qa/unit/data/odp/loopNoPause.odp
new file mode 100644
index ..d9be1c2dcac4
Binary files /dev/null and b/sd/qa/unit/data/odp/loopNoPause.odp differ
diff --git a/sd/qa/unit/data/odp/loopPause10.odp 
b/sd/qa/unit/data/odp/loopPause10.odp
new file mode 100644
index ..0e3e316db314
Binary files /dev/null and b/sd/qa/unit/data/odp/loopPause10.odp differ
diff --git a/sd/qa/unit/data/ppt/loopNoPause.ppt 
b/sd/qa/unit/data/ppt/loopNoPause.ppt
new file mode 100644
index ..d82879a5247e
Binary files /dev/null and b/sd/qa/unit/data/ppt/loopNoPause.ppt differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 56f7a11cc267..c47982d39066 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -195,6 +196,7 @@ public:
 void testTdf120028b();
 void testTdf44223();
 void testDescriptionImport();
+void testTdf83247();
 
 CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -281,6 +283,7 @@ public:
 CPPUNIT_TEST(testTdf120028b);
 CPPUNIT_TEST(testTdf44223);
 CPPUNIT_TEST(testDescriptionImport);
+CPPUNIT_TEST(testTdf83247);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2666,6 +2669,31 @@ void SdImportTest::testDescriptionImport()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf83247()
+{
+auto GetPause = [this](const OUString& sSrc, sal_Int32 nFormat) {
+sd::DrawDocShellRef xDocShRef
+= loadURL(m_directories.getURLFromSrc(sSrc), nFormat);
+uno::Reference 
xPresentationSupplier(
+xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
+uno::Reference xPresentationProps(
+xPresentationSupplier->getPresentation(), uno::UNO_QUERY_THROW);
+
+auto retVal = xPresentationProps->getPropertyValue("Pause");
+xDocShRef->DoClose();
+return retVal.get();
+};
+
+// 1. Check that presentation:pause attribute is imported correctly
+CPPUNIT_ASSERT_EQUAL(sal_Int32(10), 
GetPause("/sd/qa/unit/data/odp/loopPause10.odp", ODP));
+
+// 2. ODF compliance: if presentation:pause attribute is absent, it must 
be treated as 0
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), 
GetPause("/sd/qa/unit/data/odp/loopNoPause.odp", ODP));
+
+// 3. Import PPT: pause should be 0
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), 
GetPause("/sd/qa/unit/data/ppt/loopNoPause.ppt", PPT));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 58c8a404b144..1ff77f1283c3 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -105,7 +105,7 @@ PresentationSettings::PresentationSettings()
 mbAlwaysOnTop( false ),
 mbFullScreen( true ),
 mbAnimationAllowed( true ),
-mnPauseTimeout( 10 ),
+mnPauseTimeout( 0 ),
 mbShowPauseLogo( false )
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sd/qa sd/source

2018-12-18 Thread Libreoffice Gerrit user
 sd/qa/unit/export-tests-ooxml1.cxx |   17 --
 sd/qa/unit/import-tests.cxx|   32 +---
 sd/source/core/CustomAnimationEffect.cxx   |  100 
 sd/source/core/CustomAnimationPreset.cxx   |6 
 sd/source/core/EffectMigration.cxx |  193 +
 sd/source/core/annotations/Annotation.cxx  |9 -
 sd/source/core/drawdoc.cxx |   12 -
 sd/source/core/drawdoc2.cxx|8 -
 sd/source/core/drawdoc3.cxx|   91 ---
 sd/source/core/drawdoc4.cxx|   10 -
 sd/source/core/sdpage.cxx  |  108 ++---
 sd/source/core/sdpage2.cxx |   20 --
 sd/source/core/shapelist.cxx   |9 -
 sd/source/core/stlfamily.cxx   |   14 -
 sd/source/core/stlpool.cxx |   68 +++-
 sd/source/filter/eppt/eppt.cxx |   29 +--
 sd/source/filter/eppt/epptso.cxx   |   11 -
 sd/source/filter/eppt/pptexanimations.cxx  |   23 --
 sd/source/filter/eppt/pptexsoundcollection.cxx |   25 +--
 sd/source/filter/html/buttonset.cxx|5 
 sd/source/filter/html/htmlex.cxx   |4 
 sd/source/filter/html/pubdlg.cxx   |   22 --
 sd/source/filter/ppt/ppt97animations.cxx   |5 
 sd/source/filter/ppt/pptin.cxx |9 -
 sd/source/filter/ppt/pptinanimations.cxx   |   10 -
 sd/source/filter/ppt/propread.cxx  |   42 ++---
 26 files changed, 340 insertions(+), 542 deletions(-)

New commits:
commit 31bd7e8c531a9a8e470d96540d730a98da0e81b7
Author: Arkadiy Illarionov 
AuthorDate: Sat Dec 15 20:47:43 2018 +0300
Commit: Noel Grandin 
CommitDate: Wed Dec 19 07:08:04 2018 +0100

Simplify containers iterations in sd/*

Use range-based loop or replace with STL functions

Change-Id: I29ccc94be73ec3ab22c4915f4a18ad0247038cc4
Reviewed-on: https://gerrit.libreoffice.org/65204
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index f649d2723044..1a3a818f929d 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -345,18 +345,11 @@ void SdOOXMLExportTest1::testN828390()
 CPPUNIT_ASSERT( pTxtObj );
 const EditTextObject& aEdit = 
pTxtObj->GetOutlinerParaObject()->GetTextObject();
 aEdit.GetCharAttribs(0, rLst);
-for( std::vector::reverse_iterator it = rLst.rbegin(); 
it!=rLst.rend(); ++it)
-{
-const SvxEscapementItem *pFontEscapement = dynamic_cast((*it).pAttr);
-if(pFontEscapement)
-{
-if( pFontEscapement->GetEsc() == -25 )
-{
-bPassed = true;
-break;
-}
-}
-}
+bPassed = std::any_of(rLst.rbegin(), rLst.rend(),
+[](const EECharAttrib& rCharAttr) {
+const SvxEscapementItem *pFontEscapement = dynamic_cast(rCharAttr.pAttr);
+return pFontEscapement && (pFontEscapement->GetEsc() == -25);
+});
 }
 CPPUNIT_ASSERT_MESSAGE("Subscript not exported properly", bPassed);
 
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 7323fd300718..e8827df1b946 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -393,16 +393,14 @@ void SdImportTest::testN759180()
 CPPUNIT_ASSERT(pULSpace);
 CPPUNIT_ASSERT_EQUAL_MESSAGE( "Para bottom spacing is wrong!", 
static_cast(0), pULSpace->GetLower());
 aEdit.GetCharAttribs(1, rLst);
-for( std::vector::reverse_iterator it = rLst.rbegin(); 
it!=rLst.rend(); ++it)
+auto it = std::find_if(rLst.rbegin(), rLst.rend(),
+[](const EECharAttrib& rCharAttr) { return dynamic_cast(rCharAttr.pAttr) != nullptr; });
+if (it != rLst.rend())
 {
 const SvxFontHeightItem * pFontHeight = dynamic_cast((*it).pAttr);
-if(pFontHeight)
-{
-// nStart == 9
-// font height = 5 => 5*2540/72
-CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font height is wrong", 
static_cast(176), pFontHeight->GetHeight() );
-break;
-}
+// nStart == 9
+// font height = 5 => 5*2540/72
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font height is wrong", 
static_cast(176), pFontHeight->GetHeight() );
 }
 }
 
@@ -486,7 +484,6 @@ void SdImportTest::testN828390_2()
 
 void SdImportTest::testN828390_3()
 {
-bool bPassed = true;
 sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/n828390_3.pptx"), PPTX );
 const SdrPage *pPage = GetPage( 1, xDocShRef );
 
@@ -496,18 +493,11 @@ void SdImportTest::testN828390_3()
 const EditTextObject& aEdit = 
p

[Libreoffice-commits] core.git: sd/qa sd/source

2018-10-18 Thread Libreoffice Gerrit user
 sd/qa/unit/export-tests-ooxml1.cxx  |2 +-
 sd/qa/unit/export-tests-ooxml2.cxx  |2 +-
 sd/qa/unit/export-tests.cxx |2 +-
 sd/qa/unit/import-tests.cxx |2 +-
 sd/qa/unit/misc-tests.cxx   |2 +-
 sd/source/filter/eppt/epptbase.hxx  |4 ++--
 sd/source/filter/eppt/pptx-epptbase.cxx |6 +++---
 sd/source/filter/xml/sdxmlwrp.cxx   |8 
 sd/source/ui/unoidl/UnoDocumentSettings.cxx |2 +-
 9 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit d6da34186866aa5b373cb7ca6d22f67b36aea43c
Author: Noel Grandin 
AuthorDate: Thu Oct 18 09:32:50 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 18 11:40:14 2018 +0200

loplugin:staticvar in sd

Change-Id: I2a0b7e70db0d244627a462a5da5de7eeba8db940
Reviewed-on: https://gerrit.libreoffice.org/61907
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 98e6dcc57335..f649d2723044 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -136,7 +136,7 @@ public:
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
 {
-struct { char const * pPrefix; char const * pURI; } namespaces[] =
+static const struct { char const * pPrefix; char const * pURI; } 
namespaces[] =
 {
 // OOXML
 { "ContentType", 
"http://schemas.openxmlformats.org/package/2006/content-types"; },
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 3fa01dd159e2..f1765c1f9d4e 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -278,7 +278,7 @@ public:
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
 {
-struct { char const * pPrefix; char const * pURI; } namespaces[] =
+static const struct { char const * pPrefix; char const * pURI; } 
namespaces[] =
 {
 // OOXML
 { "ContentType", 
"http://schemas.openxmlformats.org/package/2006/content-types"; },
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index e34de2d9d141..c5120a610c00 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -138,7 +138,7 @@ public:
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
 {
-struct { char const * pPrefix; char const * pURI; } namespaces[] =
+static const struct { char const * pPrefix; char const * pURI; } 
namespaces[] =
 {
 // ODF
 { "anim", "urn:oasis:names:tc:opendocument:xmlns:animation:1.0" },
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index cff2292aaca0..9dc6226b36d5 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -317,7 +317,7 @@ the test, and re-running; it should break.
 */
 void SdImportTest::testDocumentLayout()
 {
-struct { const char *pInput, *pDump; sal_Int32 nFormat; sal_Int32 
nExportType; } aFilesToCompare[] =
+static const struct { const char *pInput, *pDump; sal_Int32 nFormat; 
sal_Int32 nExportType; } aFilesToCompare[] =
 {
 { "odp/shapes-test.odp", "xml/shapes-test_page", ODP, -1 },
 { "fdo47434.pptx", "xml/fdo47434_", PPTX, -1 },
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 2bfd5789407a..a0e62f15788a 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -95,7 +95,7 @@ public:
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
 {
-struct { char const * pPrefix; char const * pURI; } namespaces[] =
+static const struct { char const * pPrefix; char const * pURI; } 
namespaces[] =
 {
 // ODF
 { "config", "urn:oasis:names:tc:opendocument:xmlns:config:1.0"},
diff --git a/sd/source/filter/eppt/epptbase.hxx 
b/sd/source/filter/eppt/epptbase.hxx
index d57ecfee00ed..8e4ec04a34e3 100644
--- a/sd/source/filter/eppt/epptbase.hxx
+++ b/sd/source/filter/eppt/epptbase.hxx
@@ -395,8 +395,8 @@ public:
 
 bool GetPresObj() { return mbPresObj; }
 
-static PHLayout& GetLayout( const css::uno::Reference< 
css::beans::XPropertySet >& rXPropSet );
-static PHLayout& GetLayout( sal_Int32 nOffset );
+static PHLayout const & GetLayout( const css::uno::Reference< 
css::beans::XPropertySet >& rXPropSet );
+static PHLayout const & GetLayout( sal_Int32 nOffset );
 static sal_Int32 GetLayoutOffset( const css::uno::Reference< 
css::beans::XPropertySet >& rXPropSet );
 static sal_Int32 GetLayoutOffsetFixed( const css::uno::Reference< 
css::beans::XPropertySet >& rXPropSet );
 
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx 
b/sd/source/filter/eppt/pptx-epptbase.cxx
index 4940bf855754..3642629a936b 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx

[Libreoffice-commits] core.git: sd/qa sd/source

2018-10-16 Thread Libreoffice Gerrit user
 sd/qa/unit/data/tdf119956.odg|binary
 sd/qa/unit/misc-tests.cxx|   92 ++-
 sd/qa/unit/sdmodeltestbase.hxx   |3 -
 sd/source/ui/inc/DrawViewShell.hxx   |3 -
 sd/source/ui/inc/GraphicDocShell.hxx |3 -
 sd/source/ui/inc/LayerTabBar.hxx |   10 ++-
 sd/source/ui/inc/ViewShell.hxx   |2 
 7 files changed, 94 insertions(+), 19 deletions(-)

New commits:
commit c8b68f7d63df9335ab4ef90441d3d2815bb4ddd6
Author: Regina Henschel 
AuthorDate: Mon Oct 8 19:42:56 2018 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Oct 16 19:21:49 2018 +0200

tdf#119956 unit test, LayerTabBar, adapt focus if Alt+Click

The test simulates Alt+Click and checks which tab is current.
Some methods have been exported, so that they can be used in
the test. The test classes have been changed to get an odg
document really opened in Draw.

Change-Id: I6ece8594f297c48c862693ead049e6e1f9edbc31
Reviewed-on: https://gerrit.libreoffice.org/61545
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/sd/qa/unit/data/tdf119956.odg b/sd/qa/unit/data/tdf119956.odg
new file mode 100644
index ..eb1104035f1a
Binary files /dev/null and b/sd/qa/unit/data/tdf119956.odg differ
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index df038e5fde65..2bfd5789407a 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 
@@ -46,10 +47,17 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
 
 using namespace ::com::sun::star;
 
@@ -68,6 +76,7 @@ public:
 void testTdf101242_settings();
 void testTdf119392();
 void testTdf67248();
+void testTdf119956();
 
 CPPUNIT_TEST_SUITE(SdMiscTest);
 CPPUNIT_TEST(testTdf96206);
@@ -81,6 +90,7 @@ public:
 CPPUNIT_TEST(testTdf101242_settings);
 CPPUNIT_TEST(testTdf119392);
 CPPUNIT_TEST(testTdf67248);
+CPPUNIT_TEST(testTdf119956);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -118,6 +128,17 @@ sd::DrawDocShellRef SdMiscTest::Load(const OUString& rURL, 
sal_Int32 nFormat)
 uno::Reference< frame::XFrame > xTargetFrame = 
xDesktop->findFrame("_blank", 0);
 CPPUNIT_ASSERT(xTargetFrame.is());
 
+// This ContainerWindow corresponds to the outermost window of a running 
LibreOffice.
+// It needs a non-zero size and must be shown. Otherwise visible elements 
like the
+// LayerTabBar in Draw have zero size and cannot get mouse events.
+// The here used size is freely chosen.
+uno::Reference xContainerWindow = 
xTargetFrame->getContainerWindow();
+CPPUNIT_ASSERT(xContainerWindow.is());
+xContainerWindow->setPosSize(0, 0, 1024, 768, awt::PosSize::SIZE);
+VclPtr pContainerWindow = 
VCLUnoHelper::GetWindow(xContainerWindow);
+CPPUNIT_ASSERT(pContainerWindow);
+pContainerWindow->Show(true);
+
 // 1. Open the document
 sd::DrawDocShellRef xDocSh = loadURL(rURL, nFormat);
 CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.is());
@@ -137,16 +158,27 @@ sd::DrawDocShellRef SdMiscTest::Load(const OUString& 
rURL, sal_Int32 nFormat)
 
 sd::ViewShell *pViewShell = xDocSh->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
-sd::slidesorter::SlideSorterViewShell* pSSVS = nullptr;
-for (int i = 0; i < 1000; i++)
+
+// Draw has no slidesorter, Impress never shows a LayerTabBar
+if (sd::ViewShell::ST_DRAW == pViewShell->GetShellType())
 {
-// Process all Tasks - slide sorter is created here
-while (Scheduler::ProcessTaskScheduling());
-if ((pSSVS = 
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase()))
 != nullptr)
-break;
-osl::Thread::wait(std::chrono::milliseconds(100));
+sd::LayerTabBar* pLayerTabBar = 
static_cast(pViewShell)->GetLayerTabControl();
+CPPUNIT_ASSERT(pLayerTabBar);
+pLayerTabBar->StateChanged(StateChangedType::InitShow);
+}
+else
+{
+sd::slidesorter::SlideSorterViewShell* pSSVS = nullptr;
+for (int i = 0; i < 1000; i++)
+{
+// Process all Tasks - slide sorter is created here
+while (Scheduler::ProcessTaskScheduling());
+if ((pSSVS = 
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase()))
 != nullptr)
+break;
+osl::Thread::wait(std::chrono::milliseconds(100));
+}
+CPPUNIT_ASSERT(pSSVS);
 }
-CPPUNIT_ASSERT(pSSVS);
 
 return xDocSh;
 }
@@ -497,7 +529,7 @@ void SdMiscTest::testTdf119392()
 // Loads a document which has two user layers "V--" and "V-L". Inserts a 
new layer "

[Libreoffice-commits] core.git: sd/qa sd/source

2018-09-07 Thread Libreoffice Gerrit user
 sd/qa/unit/data/odp/tdf99213-target-missing.odp |binary
 sd/qa/unit/export-tests-ooxml2.cxx  |   15 ++
 sd/source/filter/eppt/pptx-animations.cxx   |  143 ++--
 3 files changed, 126 insertions(+), 32 deletions(-)

New commits:
commit 612db6877a73e6f9b142b81697291f02c0adb95f
Author: Mark Hung 
AuthorDate: Sat Sep 1 11:11:38 2018 +0800
Commit: Mark Hung 
CommitDate: Fri Sep 7 13:11:41 2018 +0200

tdf#99213: don't export invalid child nodes.

Create NodeContext for all child nodes at beginning and
check if they are valid, either it has a valid target or
it contains valid nodes, so that we only export valid
node later.

Change-Id: I660d99011eb57ddc79f727455fce0be8876e8b17
Reviewed-on: https://gerrit.libreoffice.org/59892
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/data/odp/tdf99213-target-missing.odp 
b/sd/qa/unit/data/odp/tdf99213-target-missing.odp
new file mode 100644
index ..3bc8c7260c8c
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf99213-target-missing.odp 
differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 6920531af778..fa994f219d6a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -193,6 +193,7 @@ public:
 void testTdf116350TextEffects();
 void testTdf118825();
 void testTdf119118();
+void testTdf99213();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -269,6 +270,7 @@ public:
 CPPUNIT_TEST(testTdf116350TextEffects);
 CPPUNIT_TEST(testTdf118825);
 CPPUNIT_TEST(testTdf119118);
+CPPUNIT_TEST(testTdf99213);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1987,6 +1989,19 @@ void SdOOXMLExportTest2::testTdf119118()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf99213()
+{
+::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc( 
"sd/qa/unit/data/odp/tdf99213-target-missing.odp" ), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+// Number of nodes with p:attrNameLst was 3, including one that missed 
tgtEl
+assertXPath(pXmlDocContent, "//p:attrNameLst", 2);
+// Timenode that miss its target element should be filtered.
+assertXPath(pXmlDocContent, "//p:attrNameLst/preceding-sibling::p:tgtEl", 
2);
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index 7a64828ddfd1..b02ccdcc4cb7 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -410,6 +410,21 @@ void WriteAnimationAttributeName(const FSHelperPtr& pFS, 
const OUString& rAttrib
 pFS->endElementNS(XML_p, XML_attrNameLst);
 }
 
+bool isValidTarget(const Any& rTarget)
+{
+Reference xShape;
+
+if ((rTarget >>= xShape) && xShape.is())
+return true;
+
+ParagraphTarget aParagraphTarget;
+
+if ((rTarget >>= aParagraphTarget) && aParagraphTarget.Shape.is())
+return true;
+
+return false;
+}
+
 /// convert animation node type to corresponding ooxml element.
 sal_Int32 convertNodeType(sal_Int16 nType)
 {
@@ -575,9 +590,13 @@ typedef std::unique_ptr NodeContextPtr;
 
 class NodeContext
 {
-const Reference& mxNode;
+const Reference mxNode;
 const bool mbMainSeqChild;
 
+std::vector maChildNodes;
+// if the node has valid target or contains at least one valid target.
+bool mbValid;
+
 // Attributes initialized from mxNode->getUserData().
 sal_Int16 mnEffectNodeType;
 sal_Int16 mnEffectPresetClass;
@@ -587,14 +606,23 @@ class NodeContext
 /// constructor helper for initializing user datas.
 void initUserData();
 
+/// constructor helper to initialize maChildNodes.
+/// return true if at least one childnode is valid.
+bool initChildNodes();
+
+/// constructor helper to initialize mbValid
+void initValid(bool bHasValidChild, bool bIsIterateChild);
+
 public:
-NodeContext(const Reference& xNode, bool bMainSeqChild);
+NodeContext(const Reference& xNode, bool bMainSeqChild, 
bool bIsIterateChild);
 const Reference& getNode() const { return mxNode; }
 bool isMainSeqChild() const { return mbMainSeqChild; }
 sal_Int16 getEffectNodeType() const { return mnEffectNodeType; }
 sal_Int16 getEffectPresetClass() const { return mnEffectPresetClass; }
 const OUString& getEffectPresetId() const { return msEffectPresetId; }
 const OUString& getEffectPresetSubType() const { return 
msEffectPresetSubType; }
+bool isValid() const { return mbValid; }
+const std::vector& getChildNodes() const { return 
maChildNodes; };
 };
 
 class PPTXAnimationExport
@@ -1014,34 +1042,17 @@ void 
PPTXAnimationExport::WriteAnimatio

[Libreoffice-commits] core.git: sd/qa sd/source

2018-09-04 Thread Libreoffice Gerrit user
 sd/qa/unit/data/ppt/tdf119629.ppt|binary
 sd/qa/unit/export-tests.cxx  |   22 ++
 sd/source/filter/ppt/pptanimations.hxx   |4 
 sd/source/filter/ppt/pptinanimations.cxx |5 -
 4 files changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 6db1448eaa30ac7e2ebc64ad561b1d4a2c6e4ff2
Author: Mark Hung 
AuthorDate: Mon Sep 3 21:56:07 2018 +0800
Commit: Mark Hung 
CommitDate: Tue Sep 4 18:15:34 2018 +0200

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: Mark Hung 

diff --git a/sd/qa/unit/data/ppt/tdf119629.ppt 
b/sd/qa/unit/data/ppt/tdf119629.ppt
new file mode 100644
index ..b9c90e916fff
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf119629.ppt differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index b17fb213c5b1..3e5bd8ef3bfb 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -102,6 +102,7 @@ public:
 void testTdf115394PPT();
 void testBulletsAsImage();
 void testTdf113818();
+void testTdf119629();
 void testTdf113822();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
@@ -130,6 +131,7 @@ public:
 CPPUNIT_TEST(testTdf115394PPT);
 CPPUNIT_TEST(testBulletsAsImage);
 CPPUNIT_TEST(testTdf113818);
+CPPUNIT_TEST(testTdf119629);
 CPPUNIT_TEST(testTdf113822);
 
 CPPUNIT_TEST_SUITE_END();
@@ -1137,6 +1139,26 @@ void SdExportTest::testTdf113818()
 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);
 
diff --git a/sd/source/filter/ppt/pptanimations.hxx 
b/sd/source/filter/ppt/pptanimations.hxx
index 8de13b56d090..f9d5fa5479a3 100644
--- a/sd/source/filter/ppt/pptanimations.hxx
+++ b/sd/source/filter/ppt/pptanimations.hxx
@@ -125,11 +125,15 @@ namespace ppt
 #define DFF_ANIM_PRESS_CLASS_OLE_ACTION 5
 #define DFF_ANIM_PRESS_CLASS_MEDIACALL  6
 
+// Effect node type.
 #define DFF_ANIM_NODE_TYPE_ON_CLICK 1
 #define DFF_ANIM_NODE_TYPE_WITH_PREVIOUS2
 #define DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS   3
 #define DFF_ANIM_NODE_TYPE_MAIN_SEQUENCE4
 #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
 
 /* constants for fill entry in AnimationNode */
diff --git a/sd/source/filter/ppt/pptinanimations.cxx 
b/sd/source/filter/ppt/pptinanimations.cxx
index 18c3b82988f4..8e553159d968 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -673,8 +673,11 @@ void AnimationImporter::fillNode( Reference< 
XAnimationNode > const & xNode, con
 sal_Int16 nNodeType = css::presentation::EffectNodeType::DEFAULT;
 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_WITH_GROUP: SAL_FALLTHROUGH;
 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_MAIN_SEQUENCE:  nNodeType = 
css::presentation::EffectNodeType::MAIN_SEQUENCE; break;
 case DFF_ANIM_NODE_TYPE_TIMING_ROOT:nNodeType = 
css::present

[Libreoffice-commits] core.git: sd/qa sd/source

2018-08-16 Thread Libreoffice Gerrit user
 sd/qa/unit/export-tests.cxx  |3 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   43 ---
 2 files changed, 37 insertions(+), 9 deletions(-)

New commits:
commit 6e03d7ee5734c94d245aea5900c0924fbef2a246
Author: Mark Hung 
AuthorDate: Sun Aug 12 23:29:55 2018 +0800
Commit: Mark Hung 
CommitDate: Thu Aug 16 18:17:16 2018 +0200

tdf#99213 handle iterate container.

Export iterate container as p:par with iterate element, which has
'type' attribute and p:tmAbs element. Note that child animation
node would not have target so it has to use the target of the
iterate container.

Testcase of testTdf113822 is used, PowerPointExport::
WriteAnimationAttributeName is tuned to prevent data loss
there. Deciding an Any is a RGB color by converting
to sal_Int32 doesn't work and has been done
AnimationExporter::convertAnimateValue, so we can remove
them securely and make the roundtrip test case work.

Change-Id: I04a66f004df291c04c1f6e4a8fb7da34b924d922
Reviewed-on: https://gerrit.libreoffice.org/58998
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 0e5b8f563df9..b17fb213c5b1 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1105,6 +1105,9 @@ void SdExportTest::testTdf113822()
 utl::TempFile tempFile;
 sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf113822underline.pptx"),
 PPTX);
 
+// Was unable to export iterate container (tdf#99213).
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+// Was unable to import iterate container (tdf#113822).
 xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
 
 xmlDocPtr pXmlDoc = parseExport(tempFile, "content.xml");
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 7b64a3f271a5..69624d1c0752 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -60,6 +60,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -76,6 +77,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1027,14 +1029,7 @@ void PowerPointExport::WriteAnimateTo(const FSHelperPtr& 
pFS, const Any& rValue,
 
 SAL_INFO("sd.eppt", "to attribute name: " << USS(rAttributeName));
 
-sal_uInt32 nColor;
-if (rValue >>= nColor)
-{
-// RGB color
-WriteAnimationProperty(pFS, rValue, XML_to);
-}
-else
-WriteAnimationProperty(pFS, 
AnimationExporter::convertAnimateValue(rValue, rAttributeName), XML_to);
+WriteAnimationProperty(pFS, AnimationExporter::convertAnimateValue(rValue, 
rAttributeName), XML_to);
 }
 
 void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, 
const OUString& rAttributeName)
@@ -1351,7 +1346,10 @@ void 
PowerPointExport::WriteAnimationNodeAnimateInside(const FSHelperPtr& pFS, c
 XML_additive, pAdditive,
 FSEND);
 WriteAnimationNodeCommonPropsStart(pFS, rXNode, true, bMainSeqChild);
-WriteAnimationTarget(pFS, rXAnimate->getTarget());
+
+Reference xIterate(rXNode->getParent(), UNO_QUERY);
+WriteAnimationTarget(pFS, xIterate.is() ?
+xIterate->getTarget() : rXAnimate->getTarget());
 
 Reference xTransform(rXNode, UNO_QUERY);
 
@@ -1687,6 +1685,32 @@ void 
PowerPointExport::WriteAnimationNodeCommonPropsStart(const FSHelperPtr& pFS
 WriteAnimationCondition(pFS, aAny, false, bMainSeqChild, 
XML_endCondLst);
 }
 
+if (rXNode->getType() == AnimationNodeType::ITERATE)
+{
+Reference xIterate(rXNode, UNO_QUERY);
+if (xIterate.is())
+{
+const char *sType = nullptr;
+switch(xIterate->getIterateType())
+{
+case TextAnimationType::BY_PARAGRAPH:
+sType = "el";
+break;
+case TextAnimationType::BY_LETTER:
+sType = "lt";
+break;
+case TextAnimationType::BY_WORD:
+default:
+sType = "wd";
+break;
+
+}
+pFS->startElementNS(XML_p, XML_iterate, XML_type, sType, FSEND);
+pFS->singleElementNS(XML_p, XML_tmAbs, XML_val, 
I32S(xIterate->getIterateInterval() * 1000), FSEND);
+pFS->endElementNS(XML_p, XML_iterate);
+}
+}
+
 Reference< XEnumerationAccess > xEnumerationAccess(rXNode, UNO_QUERY);
 if (xEnumerationAccess.is())
 {
@@ -1794,6 +1818,7 @@ void PowerPointExport::WriteAnimationNode(const 
FSHelperPtr& pFS, const Referenc
 
 switch (rXNode->getType())
 {
+case AnimationNodeType::ITERATE:
 case AnimationNodeType::PAR:
 xmlNodeType = XML_par;
 break;
___

[Libreoffice-commits] core.git: sd/qa sd/source

2018-07-31 Thread Libreoffice Gerrit user
 sd/qa/unit/export-tests.cxx  |3 ++-
 sd/source/filter/ppt/pptinanimations.cxx |   31 ---
 2 files changed, 6 insertions(+), 28 deletions(-)

New commits:
commit 696cbec5c6db783d3dd91d3f7d46f83dcc00b3cc
Author: Mark Hung 
AuthorDate: Sat Jul 28 10:56:38 2018 +0800
Commit: Mark Hung 
CommitDate: Tue Jul 31 13:44:48 2018 +0200

tdf#118080 fix formula importing of ppt animation.

Change-Id: I5f56e0d70a13418b0bde45c2fc65f56fdb365263
Reviewed-on: https://gerrit.libreoffice.org/58209
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index b34cbb9aca9f..e92d95f934c8 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1117,7 +1117,8 @@ void SdExportTest::testTdf113818()
 {
 utl::TempFile tempFile;
 sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf113818-swivel.pptx"),
 PPTX);
-
+xDocShRef = saveAndReload(xDocShRef.get(), PPT);
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
 xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
 
 xmlDocPtr pXmlDoc = parseExport(tempFile, "content.xml");
diff --git a/sd/source/filter/ppt/pptinanimations.cxx 
b/sd/source/filter/ppt/pptinanimations.cxx
index 4b0c9b95a860..60a59688d6c3 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -2149,35 +2149,12 @@ void AnimationImporter::importAnimateKeyPoints( const 
Atom* pAtom, const Referen
 {
 pValue = Atom::findNextChildAtom(pValue);
 if( pValue && pValue->getType() == 
DFF_msofbtAnimAttributeValue )
-(void)importAttributeValue( pValue, aValue2 );
-
-bool bCouldBeFormula = false;
-bool bHasValue = aValue2.hasValue();
-if( bHasValue )
-{
-if( aValue2.getValueType() == 
cppu::UnoType::get() )
-{
-OUString aTest;
-aValue2 >>= aTest;
-bHasValue = !aTest.isEmpty();
-bCouldBeFormula = true;
-}
-}
-
-if( bHasValue && bCouldBeFormula && 
(aValue1.getValueType() == cppu::UnoType::get() ))
-{
-aValue2 >>= aFormula;
-bHasValue = false;
-}
-
-if( bHasValue )
-{
-aValues[nKeyTime] <<= ValuePair( aValue1, aValue2 
);
-}
-else
 {
-aValues[nKeyTime] = aValue1;
+// Any occurence of the formula becomes the 
formula of the whole list.
+if (importAttributeValue(pValue, aValue2))
+aValue2 >>= aFormula;
 }
+aValues[nKeyTime] = aValue1;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2018-07-25 Thread Libreoffice Gerrit user
 sd/qa/unit/data/odp/tdf118836.odp|binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   14 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   30 +-
 3 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 7ff086c9141429e32c733f38d288cf67d6e9e3c9
Author: Mark Hung 
AuthorDate: Tue Jul 17 18:58:27 2018 +0800
Commit: Mark Hung 
CommitDate: Wed Jul 25 15:00:10 2018 +0200

tdf#118836: fix grow-shrink animation in saved pptx.

Convert AnimeTransform with transform type SCALE to animScale.

Change-Id: I39dfbdb814afa78ca981238bb1876f4af0995791
Reviewed-on: https://gerrit.libreoffice.org/57790
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/data/odp/tdf118836.odp 
b/sd/qa/unit/data/odp/tdf118836.odp
new file mode 100644
index ..50857b79deb7
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf118836.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index e33f02f82103..6201053df0ad 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -150,6 +150,7 @@ public:
 void testOpenDocumentAsReadOnly();
 void testTdf118835();
 void testTdf118768();
+void testTdf118836();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -221,6 +222,7 @@ public:
 CPPUNIT_TEST(testOpenDocumentAsReadOnly);
 CPPUNIT_TEST(testTdf118835);
 CPPUNIT_TEST(testTdf118768);
+CPPUNIT_TEST(testTdf118836);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1776,6 +1778,18 @@ void SdOOXMLExportTest2::testTdf118768()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf118836()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118836.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDocContent, "//p:animScale/p:by", "x", "25");
+assertXPath(pXmlDocContent, "//p:animScale/p:by", "y", "25");
+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 80e87fa1db0c..e23af1110080 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -918,6 +918,27 @@ void PowerPointExport::WriteAnimationProperty(const 
FSHelperPtr& pFS, const Any&
 if (!rAny.hasValue())
 return;
 
+ValuePair aPair;
+
+if (rAny >>= aPair)
+{
+double x, y;
+if ((aPair.First >>= x) && (aPair.Second >>= y))
+{
+if (nToken == XML_by)
+{
+// MS needs ending values but we have offset values.
+x += 1.0;
+y += 1.0;
+}
+pFS->singleElementNS(XML_p, nToken,
+XML_x, OString::number(x*10).getStr(),
+XML_y, OString::number(y*10).getStr(),
+FSEND);
+}
+return;
+}
+
 sal_uInt32 nRgb;
 double fDouble;
 
@@ -1345,6 +1366,12 @@ void 
PowerPointExport::WriteAnimationNodeAnimateInside(const FSHelperPtr& pFS, c
 WriteAnimateColorColor(pFS, xColor->getFrom(), XML_from);
 WriteAnimateColorColor(pFS, xColor->getTo(), XML_to);
 }
+else if (xTransform.is() && xTransform->getTransformType() == 
AnimationTransformType::SCALE)
+{
+WriteAnimationProperty(pFS, rXAnimate->getBy(), XML_by);
+WriteAnimationProperty(pFS, rXAnimate->getFrom(), XML_from);
+WriteAnimationProperty(pFS, rXAnimate->getTo(), XML_to);
+}
 else if (bWriteTo)
 WriteAnimateTo(pFS, rXAnimate->getTo(), rXAnimate->getAttributeName());
 }
@@ -1781,7 +1808,8 @@ void PowerPointExport::WriteAnimationNode(const 
FSHelperPtr& pFS, const Referenc
 {
 if (xTransform->getTransformType() == 
AnimationTransformType::SCALE)
 {
-SAL_WARN("sd.eppt", "SCALE transform type not handled");
+xmlNodeType = XML_animScale;
+pMethod = &PowerPointExport::WriteAnimationNodeAnimate;
 }
 else if (xTransform->getTransformType() == 
AnimationTransformType::ROTATE)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2018-07-24 Thread Libreoffice Gerrit user
 sd/qa/unit/data/odp/tdf118835.odp|binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   30 
 sd/source/filter/eppt/epptooxml.hxx  |2 
 sd/source/filter/eppt/pptx-epptooxml.cxx |   73 ++-
 4 files changed, 103 insertions(+), 2 deletions(-)

New commits:
commit 6a79db85be2520de3ca5d2c52eacdb58bc17fec8
Author: Mark Hung 
AuthorDate: Sat Jul 21 10:20:51 2018 +0800
Commit: Mark Hung 
CommitDate: Tue Jul 24 12:12:01 2018 +0200

tdf#118835 export animClr element. ( handle AnimateColor ).

Implement PowerPointExport::WriteAnimateColorColor to export
to, from, by elements of the animClr element.

Change-Id: I0fb81f8838656c127610a9a10654e3e51106bea8
Reviewed-on: https://gerrit.libreoffice.org/57820
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/data/odp/tdf118835.odp 
b/sd/qa/unit/data/odp/tdf118835.odp
new file mode 100644
index ..c3e15a6dcac9
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf118835.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 6756f86e9ab7..e33f02f82103 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -148,6 +148,7 @@ public:
 void testTdf118783();
 void testTdf104789();
 void testOpenDocumentAsReadOnly();
+void testTdf118835();
 void testTdf118768();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -218,6 +219,7 @@ public:
 CPPUNIT_TEST(testTdf118783);
 CPPUNIT_TEST(testTdf104789);
 CPPUNIT_TEST(testOpenDocumentAsReadOnly);
+CPPUNIT_TEST(testTdf118835);
 CPPUNIT_TEST(testTdf118768);
 
 CPPUNIT_TEST_SUITE_END();
@@ -1726,6 +1728,34 @@ void SdOOXMLExportTest2::testOpenDocumentAsReadOnly()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf118835()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118835.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDocContent, "(//p:animClr)[1]", "clrSpc", "rgb");
+assertXPathContent(pXmlDocContent, "(//p:animClr)[1]//p:attrName", 
"style.color");
+assertXPath(pXmlDocContent, "(//p:animClr)[1]//p:to/a:srgbClr", "val", 
"ed1c24");
+
+assertXPath(pXmlDocContent, "(//p:animClr)[2]", "clrSpc", "rgb");
+assertXPathContent(pXmlDocContent, "(//p:animClr)[2]//p:attrName", 
"stroke.color");
+assertXPath(pXmlDocContent, "(//p:animClr)[2]//p:to/a:srgbClr", "val", 
"99");
+
+assertXPath(pXmlDocContent, "(//p:animClr)[3]", "clrSpc", "rgb");
+assertXPathContent(pXmlDocContent, "(//p:animClr)[3]//p:attrName", 
"fillcolor");
+assertXPath(pXmlDocContent, "(//p:animClr)[3]//p:to/a:srgbClr", "val", 
"fcd3c1");
+
+assertXPath(pXmlDocContent, "(//p:animClr)[5]", "clrSpc", "hsl");
+assertXPathContent(pXmlDocContent, "(//p:animClr)[5]//p:attrName", 
"fillcolor");
+assertXPath(pXmlDocContent, "(//p:animClr)[5]//p:by/p:hsl", "h", 
"1080");
+assertXPath(pXmlDocContent, "(//p:animClr)[5]//p:by/p:hsl", "s", "0");
+assertXPath(pXmlDocContent, "(//p:animClr)[5]//p:by/p:hsl", "l", "0");
+
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest2::testTdf118768()
 {
 sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118768-brake.odp"), 
ODP);
diff --git a/sd/source/filter/eppt/epptooxml.hxx 
b/sd/source/filter/eppt/epptooxml.hxx
index ee5520f590b5..8784ae49c18a 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -112,6 +112,8 @@ private:
 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 WriteAnimateColorColor(const ::sax_fastparser::FSHelperPtr& 
pFS, const css::uno::Any& rAny, sal_Int32 nToken);
 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 );
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 5811334ddff7..80e87fa1db0c 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.

[Libreoffice-commits] core.git: sd/qa sd/source

2018-07-19 Thread Libreoffice Gerrit user
 sd/qa/unit/data/odp/tdf118783.odp|binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   16 
 sd/source/filter/eppt/pptx-epptooxml.cxx |   11 ++-
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 71f7ecae6e0ef45730db4e288108cc4a3994612a
Author: Mark Hung 
AuthorDate: Sun Jul 15 21:04:43 2018 +0800
Commit: Mark Hung 
CommitDate: Thu Jul 19 15:10:20 2018 +0200

tdf#118783 sd:fix spin animation in saved pptx file.

The attribute name of the AnimateTransform is "Transform"
but we expect "r" for "Rotate". We need to fix it so that PowerPoint
recognize it.

Change-Id: I47590d80d28af0a0ac92ef0892b40643f1de3643
Reviewed-on: https://gerrit.libreoffice.org/57579
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/data/odp/tdf118783.odp 
b/sd/qa/unit/data/odp/tdf118783.odp
new file mode 100755
index ..719db63d1d42
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf118783.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 49f43fe0b8ed..74129e88aecf 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -145,6 +145,7 @@ public:
 void testTdf104792();
 void testTdf90627();
 void testTdf104786();
+void testTdf118783();
 void testTdf104789();
 void testOpenDocumentAsReadOnly();
 void testTdf118768();
@@ -214,6 +215,7 @@ public:
 CPPUNIT_TEST(testTdf104792);
 CPPUNIT_TEST(testTdf90627);
 CPPUNIT_TEST(testTdf104786);
+CPPUNIT_TEST(testTdf118783);
 CPPUNIT_TEST(testTdf104789);
 CPPUNIT_TEST(testOpenDocumentAsReadOnly);
 CPPUNIT_TEST(testTdf118768);
@@ -1687,6 +1689,20 @@ void SdOOXMLExportTest2::testTdf104786()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf118783()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118783.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+// check that transition attribute didn't change from 'out' to 'in'
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+OUString sAttributeName = getXPathContent(pXmlDocContent, 
"//p:animRot/p:cBhvr/p:attrNameLst/p:attrName");
+CPPUNIT_ASSERT_EQUAL(OUString("r"), sAttributeName);
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest2::testTdf104789()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104789.pptx"), 
PPTX);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a1348e3e29c0..17d7c4f6835d 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1298,7 +1298,16 @@ void 
PowerPointExport::WriteAnimationNodeAnimateInside(const FSHelperPtr& pFS, c
 FSEND);
 WriteAnimationNodeCommonPropsStart(pFS, rXNode, true, bMainSeqChild);
 WriteAnimationTarget(pFS, rXAnimate->getTarget());
-WriteAnimationAttributeName(pFS, rXAnimate->getAttributeName());
+
+Reference xTransform(rXNode, UNO_QUERY);
+
+// The attribute name of AnimateTransform is "Transform", we have to fix 
it.
+OUString sNewAttr;
+if (xTransform.is() && xTransform->getTransformType() == 
AnimationTransformType::ROTATE)
+sNewAttr = "Rotate";
+
+WriteAnimationAttributeName(pFS, xTransform.is() ? sNewAttr : 
rXAnimate->getAttributeName());
+
 pFS->endElementNS(XML_p, XML_cBhvr);
 WriteAnimateValues(pFS, rXAnimate);
 if (bWriteTo)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2018-07-18 Thread Libreoffice Gerrit user
 sd/qa/unit/data/odp/tdf118806.odp|binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   14 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |1 +
 3 files changed, 15 insertions(+)

New commits:
commit 0197a2ca1602c3ea13fecabd9de7499971830e21
Author: Mark Hung 
AuthorDate: Wed Jul 18 00:28:06 2018 +0800
Commit: Mark Hung 
CommitDate: Wed Jul 18 14:59:45 2018 +0200

tdf#118806 sd: specify the motion path origin for pptx.

Motion path animation created by Impress always take the
position of the shape as the origin, so set origin=layout.

Change-Id: I8b4b579f3a2fc282b41a68c4c8d7573d01ad1aa9
Reviewed-on: https://gerrit.libreoffice.org/57583
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/data/odp/tdf118806.odp 
b/sd/qa/unit/data/odp/tdf118806.odp
new file mode 100755
index ..7120fd968542
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf118806.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index b18810b232db..49f43fe0b8ed 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -139,6 +139,7 @@ public:
 int testTdf115005_FallBack_Images(bool bAddReplacementImages);
 void testTdf115005_FallBack_Images_On();
 void testTdf115005_FallBack_Images_Off();
+void testTdf118806();
 void testTdf111789();
 /// SmartArt animated elements
 void testTdf104792();
@@ -208,6 +209,7 @@ public:
 CPPUNIT_TEST(testTdf115005);
 CPPUNIT_TEST(testTdf115005_FallBack_Images_On);
 CPPUNIT_TEST(testTdf115005_FallBack_Images_Off);
+CPPUNIT_TEST(testTdf118806);
 CPPUNIT_TEST(testTdf111789);
 CPPUNIT_TEST(testTdf104792);
 CPPUNIT_TEST(testTdf90627);
@@ -1597,6 +1599,18 @@ void 
SdOOXMLExportTest2::testTdf115005_FallBack_Images_Off()
 CPPUNIT_ASSERT_EQUAL(0, nPNGFiles);
 }
 
+void SdOOXMLExportTest2::testTdf118806()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118806.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDocContent, "//p:animMotion", "origin", "layout");
+
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest2::testTdf111789()
 {
 // Shadow properties were not exported for text shapes.
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index c8b530ea35a0..a1348e3e29c0 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1186,6 +1186,7 @@ void PowerPointExport::WriteAnimationNodeAnimate(const 
FSHelperPtr& pFS, const R
 xMotion->getPath() >>= aPath;
 
 pFS->startElementNS(XML_p, nXmlNodeType,
+XML_origin, "layout",
 XML_path, OUStringToOString(aPath, 
RTL_TEXTENCODING_UTF8),
 FSEND);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2018-07-18 Thread Libreoffice Gerrit user
 sd/qa/unit/data/odp/tdf118768-brake.odp   |binary
 sd/qa/unit/export-tests-ooxml2.cxx|   23 ++
 sd/source/filter/eppt/pptexanimations.cxx |1 
 sd/source/filter/eppt/pptx-epptooxml.cxx  |   37 +++---
 4 files changed, 43 insertions(+), 18 deletions(-)

New commits:
commit 70674228f3afd1019da7314b368a121a9afaa5d2
Author: Mark Hung 
AuthorDate: Sun Jul 15 19:36:00 2018 +0800
Commit: Mark Hung 
CommitDate: Wed Jul 18 14:56:19 2018 +0200

tdf#118768 fix pptx export of put on the brake animation.

1. Convert to, by, from based on attribute name for Animate.
2. Export auto reverse (autoRev) attribute.

Change-Id: I11ae9997de29a5b0992889eed2eb58d48d81fbb5
Reviewed-on: https://gerrit.libreoffice.org/57554
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sd/qa/unit/data/odp/tdf118768-brake.odp 
b/sd/qa/unit/data/odp/tdf118768-brake.odp
new file mode 100755
index ..1f3abbcc0d58
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf118768-brake.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 6ca55d72a4e3..b18810b232db 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -146,6 +146,7 @@ public:
 void testTdf104786();
 void testTdf104789();
 void testOpenDocumentAsReadOnly();
+void testTdf118768();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -213,6 +214,7 @@ public:
 CPPUNIT_TEST(testTdf104786);
 CPPUNIT_TEST(testTdf104789);
 CPPUNIT_TEST(testOpenDocumentAsReadOnly);
+CPPUNIT_TEST(testTdf118768);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1694,6 +1696,27 @@ void SdOOXMLExportTest2::testOpenDocumentAsReadOnly()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf118768()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118768-brake.odp"), 
ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+// check that transition attribute didn't change from 'out' to 'in'
+xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDocContent, "//p:anim[1]", "from", "(-#ppt_w/2)");
+assertXPath(pXmlDocContent, "//p:anim[1]", "to", "(#ppt_x)");
+assertXPath(pXmlDocContent, "//p:anim[2]", "from", "0");
+
+assertXPath(pXmlDocContent, "//p:anim[2]", "to", "-1");
+assertXPath(pXmlDocContent, "//p:anim[2]/p:cBhvr/p:cTn", "autoRev", "1");
+
+assertXPath(pXmlDocContent, "//p:anim[3]", "by", "(#ppt_h/3+#ppt_w*0.1)");
+assertXPath(pXmlDocContent, "//p:anim[3]/p:cBhvr/p:cTn", "autoRev", "1");
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptexanimations.cxx 
b/sd/source/filter/eppt/pptexanimations.cxx
index 169dc83c202e..70a2286eb031 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1401,6 +1401,7 @@ Any AnimationExporter::convertAnimateValue( const Any& 
rSourceValue, const OUStr
 else if ( rAttributeName == "Rotate" // "r" or "style.rotation" ?
 || rAttributeName == "Opacity"
 || rAttributeName == "CharHeight"
+|| rAttributeName == "SkewX"
 )
 {
 double fNumber = 0.0;
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 212821d7b56b..c8b530ea35a0 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1236,28 +1236,26 @@ void PowerPointExport::WriteAnimationNodeAnimate(const 
FSHelperPtr& pFS, const R
 }
 else
 {
-OUString sTo;
+OUString sFrom, sTo, sBy;
 if (rXAnimate.is() && nXmlNodeType == XML_anim)
 {
-rXAnimate->getTo() >>= sTo;
+OUString sAttributeName = rXAnimate->getAttributeName();
+Any aFrom = 
AnimationExporter::convertAnimateValue(rXAnimate->getFrom(), sAttributeName);
+aFrom >>= sFrom;
+Any aTo = 
AnimationExporter::convertAnimateValue(rXAnimate->getTo(), sAttributeName);
+aTo >>= sTo;
+Any aBy = 
AnimationExporter::convertAnimateValue(rXAnimate->getBy(), sAttributeName);
+aBy >>= sBy;
 }
-if (!sTo.isEmpty())
-{
-pFS->startElementNS(XML_p, nXmlNodeType,
-XML_calcmode, pCalcMode,
-XML_valueType, pValueType,
-XML_to, USS(sTo),
-FSEND);
 
-bTo = false;
-}
-else
-{
-pFS->startElementNS(XML_p, nXmlNodeType,
-XML_calcmode, pCalcMode,
-XML_valueType, pValueType,
-FSEND);
-}
+pFS->startElementNS(XML_p, nXmlNodeType,
+   

[Libreoffice-commits] core.git: sd/qa sd/source

2018-05-17 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 4e207c2e17d75a3cb7b6b72690375279be40d64a
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)

Change-Id: I67a3b83f1f1832fade5df7908c58032bcb9b73ce
Reviewed-on: https://gerrit.libreoffice.org/53284
Tested-by: Jenkins 
Reviewed-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 c92ef5f7782c..28474a88d4bb 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -180,6 +180,7 @@ public:
 void testTdf115394PPT();
 void testTdf51340();
 void testTdf115639();
+void testTdf116899();
 void testTdf77747();
 void testTdf116266();
 
@@ -263,6 +264,7 @@ public:
 CPPUNIT_TEST(testTdf115394PPT);
 CPPUNIT_TEST(testTdf51340);
 CPPUNIT_TEST(testTdf115639);
+CPPUNIT_TEST(testTdf116899);
 CPPUNIT_TEST(testTdf77747);
 CPPUNIT_TEST(testTdf116266);
 
@@ -2519,6 +2521,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] );
+}
+
 void SdImportTest::testTdf77747()
 {
 sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf77747.ppt"), PPT);
diff --git a/sd/source/filter/ppt/pptinanimations.cxx 
b/sd/source/filter/ppt/pptinanimations.cxx
index 1a8ab6ea6ebf..d1e00b043f7a 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -2384,15 +2384,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 = static_cast(nTemp) / 1000.0;
 aKeyTimes[nKeyTime] = fTemp;
+if( fTemp == -1 )
+bToNormalize = true;
 
 const Atom* pValue = Atom::findNextChildAtom(pIter);
 if( pValue && pValue->getType() == 
DFF_msofbtAnimAttributeValue )
@@ -2489,7 +2491,14 @@ void AnimationImporter::importAnimateKeyPoints( const 
Atom* pAtom, const Referen
 }
 dump( "\"" );
 #endif
-
+if( bToNormalize && nKeyTimes >= 2 )
+{
+// if TimeAnimationValueList contains time -1000, key points must 
be evenly distributed between 0 and 1 ([MS-PPT] 2.8.31)
+for( int nKeyTime = 0; nKeyTime < nKeyTimes; ++nKeyTime )
+{
+aKeyTimes[nKeyTime] = static_cast(nKeyTime) / 
static_cast(nKeyTimes - 1);
+}
+}
 xAnim->setKeyTimes( aKeyT

[Libreoffice-commits] core.git: sd/qa sd/source sd/uiconfig sd/UIConfig_sdraw.mk

2018-05-11 Thread Caolán McNamara
 sd/UIConfig_sdraw.mk  |1 
 sd/qa/unit/data/dialogs-test.txt  |1 
 sd/source/ui/table/TableDesignPane.cxx|   20 --
 sd/source/ui/table/TableDesignPane.hxx|   16 --
 sd/source/ui/table/tablefunction.cxx  |   18 --
 sd/uiconfig/sdraw/ui/tabledesigndialog.ui |  201 --
 6 files changed, 5 insertions(+), 252 deletions(-)

New commits:
commit 6776a3ba00cf9ba304cd4e158d09b3cc03f68ac9
Author: Caolán McNamara 
Date:   Thu May 10 17:46:08 2018 +0100

draw has a sidebar, so impress/draw can use same table properties pane

Change-Id: I6f2178bf005fea4885af1359ce07722f17e87ba8
Reviewed-on: https://gerrit.libreoffice.org/54099
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk
index 1d2d6e9f2a1e..0091db50ddd8 100644
--- a/sd/UIConfig_sdraw.mk
+++ b/sd/UIConfig_sdraw.mk
@@ -113,7 +113,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\
sd/uiconfig/sdraw/ui/namedesign \
sd/uiconfig/sdraw/ui/paranumberingtab \
sd/uiconfig/sdraw/ui/queryunlinkimagedialog \
-   sd/uiconfig/sdraw/ui/tabledesigndialog \
sd/uiconfig/sdraw/ui/vectorize \
 ))
 
diff --git a/sd/qa/unit/data/dialogs-test.txt b/sd/qa/unit/data/dialogs-test.txt
index eb70982b92c5..63ee21c9550c 100644
--- a/sd/qa/unit/data/dialogs-test.txt
+++ b/sd/qa/unit/data/dialogs-test.txt
@@ -55,7 +55,6 @@ modules/simpress/ui/headerfooterdialog.ui
 
 modules/sdraw/ui/paranumberingtab.ui
 modules/sdraw/ui/namedesign.ui
-modules/sdraw/ui/tabledesigndialog.ui
 
 # currently deactivated, leads to problems and the test to not work
 # This is typically a hint that these should be hard-coded in the
diff --git a/sd/source/ui/table/TableDesignPane.cxx 
b/sd/source/ui/table/TableDesignPane.cxx
index 71f331b43eb8..5e1114ea5e51 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -769,20 +769,6 @@ void TableDesignWidget::FillDesignPreviewControl()
 m_pValueSet->SelectItem(nSelectedItem);
 }
 
-short TableDesignDialog::Execute()
-{
-if( ModalDialog::Execute() )
-{
-if( aImpl.isStyleChanged() )
-aImpl.ApplyStyle();
-
-if( aImpl.isOptionsChanged() )
-aImpl.ApplyOptions();
-return RET_OK;
-}
-return RET_CANCEL;
-}
-
 VclPtr createTableDesignPanel( vcl::Window* pParent, 
ViewShellBase& rBase )
 {
 VclPtr pRet = nullptr;
@@ -796,12 +782,6 @@ VclPtr createTableDesignPanel( vcl::Window* 
pParent, ViewShellBase&
 return pRet;
 }
 
-void showTableDesignDialog( vcl::Window* pParent, ViewShellBase& rBase )
-{
-ScopedVclPtrInstance< TableDesignDialog > xDialog( pParent, rBase );
-xDialog->Execute();
-}
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/table/TableDesignPane.hxx 
b/sd/source/ui/table/TableDesignPane.hxx
index 6450674e60c5..347e4ed980c2 100644
--- a/sd/source/ui/table/TableDesignPane.hxx
+++ b/sd/source/ui/table/TableDesignPane.hxx
@@ -126,22 +126,6 @@ public:
 }
 };
 
-class TableDesignDialog : public ModalDialog
-{
-private:
-TableDesignWidget aImpl;
-public:
-TableDesignDialog( vcl::Window* pParent, ViewShellBase& rBase )
-: ModalDialog(pParent, "TableDesignDialog",
-"modules/sdraw/ui/tabledesigndialog.ui")
-, aImpl(this, rBase, true)
-{
-}
-virtual short Execute() override;
-};
-
-void showTableDesignDialog( vcl::Window*, ViewShellBase& );
-
 }
 
 #endif // _SD_TABLEFORMATPANE_HXX
diff --git a/sd/source/ui/table/tablefunction.cxx 
b/sd/source/ui/table/tablefunction.cxx
index 4a998e0dc8ad..818cde2f7c57 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -227,19 +227,11 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
 }
 case SID_TABLEDESIGN:
 {
-if( GetDoc() && (GetDoc()->GetDocumentType() == DocumentType::Draw) )
-{
-// in draw open a modal dialog since we have no tool pane yet
-showTableDesignDialog( GetActiveWindow(), GetViewShellBase() );
-}
-else
-{
-// First make sure that the sidebar is visible
-GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
-::sfx2::sidebar::Sidebar::ShowPanel(
-"SdTableDesignPanel",
-GetViewFrame()->GetFrame().GetFrameInterface());
-}
+// First make sure that the sidebar is visible
+GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
+::sfx2::sidebar::Sidebar::ShowPanel(
+"SdTableDesignPanel",
+GetViewFrame()->GetFrame().GetFrameInterface());
 
 Cancel();
 rReq.Done ();
diff --git a/sd/uiconfig/sdraw/ui/tabledesigndialog.ui 
b/sd/uiconfig/sdraw/ui/tabledesigndialog.ui
deleted file mode 100644
index ecac4ed7f255..
--- a/sd/uiconfig/sdraw/ui/tabledesigndialog.ui
+++ /dev/null
@@ -1,201 +0

[Libreoffice-commits] core.git: sd/qa sd/source

2018-05-08 Thread Tomaž Vajngerl
 sd/qa/unit/export-tests-ooxml2.cxx  |   28 
 sd/qa/unit/export-tests.cxx |   42 
 sd/source/filter/eppt/pptx-text.cxx |4 +--
 3 files changed, 44 insertions(+), 30 deletions(-)

New commits:
commit 711c2e49dd3c51877263148267344e2eb4ca7c0d
Author: Tomaž Vajngerl 
Date:   Tue May 8 19:45:36 2018 +0900

tdf#116272 use correct property name when exporting to PPT

Change-Id: Ic1f5fb0e00531f9e36f05cbdf68b4c2fa7e98989
Reviewed-on: https://gerrit.libreoffice.org/53987
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 4840940274f2..739560b0b74d 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -132,7 +132,6 @@ public:
 void testFontScale();
 void testTdf115394();
 void testTdf115394Zero();
-void testBulletsAsImage();
 void testTdf115005();
 int testTdf115005_FallBack_Images(bool bAddReplacementImages);
 void testTdf115005_FallBack_Images_On();
@@ -200,7 +199,6 @@ public:
 CPPUNIT_TEST(testFontScale);
 CPPUNIT_TEST(testTdf115394);
 CPPUNIT_TEST(testTdf115394Zero);
-CPPUNIT_TEST(testBulletsAsImage);
 CPPUNIT_TEST(testTdf115005);
 CPPUNIT_TEST(testTdf115005_FallBack_Images_On);
 CPPUNIT_TEST(testTdf115005_FallBack_Images_Off);
@@ -1505,32 +1503,6 @@ void SdOOXMLExportTest2::testTdf115394Zero()
 xDocShRef->DoClose();
 }
 
-void SdOOXMLExportTest2::testBulletsAsImage()
-{
-::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/BulletsAsImage.odp"), 
ODP);
-utl::TempFile tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
-
-uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
-uno::Reference const xParagraph(getParagraphFromShape(0, 
xShape));
-uno::Reference xPropSet(xParagraph, 
uno::UNO_QUERY_THROW);
-
-uno::Reference 
xLevels(xPropSet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
-uno::Sequence aProperties;
-xLevels->getByIndex(0) >>= aProperties; // 1st level
-uno::Reference xBitmap;
-for (const beans::PropertyValue& rProperty : aProperties)
-{
-if (rProperty.Name == "GraphicBitmap")
-{
-xBitmap = rProperty.Value.get>();
-}
-}
-CPPUNIT_ASSERT_MESSAGE("No bitmap for the bullets", xBitmap.is());
-
-xDocShRef->DoClose();
-}
-
 void SdOOXMLExportTest2::testTdf115005()
 {
 sd::DrawDocShellRef xDocShRefOriginal = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf115005.odp"), ODP);
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index f5c7c4e97d15..c6dd4a70741f 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -95,6 +95,7 @@ public:
 void testPageWithTransparentBackground();
 void testTextRotation();
 void testTdf115394PPT();
+void testBulletsAsImage();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -117,6 +118,7 @@ public:
 CPPUNIT_TEST(testPageWithTransparentBackground);
 CPPUNIT_TEST(testTextRotation);
 CPPUNIT_TEST(testTdf115394PPT);
+CPPUNIT_TEST(testBulletsAsImage);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -915,6 +917,46 @@ void SdExportTest::testTdf115394PPT()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testBulletsAsImage()
+{
+for (sal_Int32 nExportFormat : {ODP, PPTX, PPT})
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/BulletsAsImage.odp"), 
ODP);
+const OString sFailedMessageBase = OString("Failed on filter '") + 
OString(aFileFormats[nExportFormat].pFilterName) + OString("': ");
+
+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[nExportFormat].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(), nExportFormat);
+
+uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const 
xParagraph(getParagraphFromShape(0, xShape));
+uno::Reference xPropSet(xParagraph, 
uno::UNO_QUERY_THROW);
+
+uno::Reference 
xLevels(xPropSet->getPropertyValue("NumberingRules"), uno::UNO_QUERY_THROW);
+uno::Sequence aProperties;
+xLevels->getByIndex(0) >>= aProperties; // 1st level
+uno::Reference xBitmap;
+for (const beans::PropertyValue& rProperty : aProperties)
+{
+if (rProperty.Na

[Libreoffice-commits] core.git: sd/qa sd/source

2018-03-17 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 e673a47767cbd272d206ac50f2ac879d5ba71176
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 

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 4c564953aa47..d2c1cdc33256 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -123,6 +123,7 @@ public:
 void testGroupsPosition();
 void testGroupsRotatedPosition();
 void testAccentColor();
+void testThemeColors();
 void testTdf114848();
 void testTdf68759();
 void testTdf90626();
@@ -186,6 +187,7 @@ public:
 CPPUNIT_TEST(testGroupsPosition);
 CPPUNIT_TEST(testGroupsRotatedPosition);
 CPPUNIT_TEST(testAccentColor);
+CPPUNIT_TEST(testThemeColors);
 CPPUNIT_TEST(testTdf114848);
 CPPUNIT_TEST(testTdf68759);
 CPPUNIT_TEST(testTdf90626);
@@ -1329,6 +1331,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, &tempFile);
+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 e4aced1ef9cf..6b7c3f307bd2 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2737,8 +2737,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: sd/qa sd/source

2018-03-16 Thread Pranav Kant
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   20 
 sd/source/ui/inc/ViewShell.hxx   |2 ++
 sd/source/ui/unoidl/unomodel.cxx |   14 --
 sd/source/ui/view/viewshe2.cxx   |   12 
 4 files changed, 46 insertions(+), 2 deletions(-)

New commits:
commit 21f56ccbd22ffa347edf931b7ed93c99988fbb8a
Author: Pranav Kant 
Date:   Thu Mar 15 20:09:26 2018 +0530

sd lok: Set the view size to full page size + fix unit tests

... such that during insertion of objects when sd calculates the center
of the view to place the object, it is the center of the whole slide,
not the center of the default rectangle of 800x600.

It's also important to hide rulers, scrollbars so that correct center is
calculated; we don't need them anyways in LOK.

Change-Id: I2d1577bc963d324959b272ed3174571ab197d014
Reviewed-on: https://gerrit.libreoffice.org/51416
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index b0ea2340574a..94f5e1b52e0d 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -339,6 +339,7 @@ xmlDocPtr SdTiledRenderingTest::parseXmlDump()
 
 void SdTiledRenderingTest::testRegisterCallback()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback,
 this);
@@ -354,6 +355,7 @@ void SdTiledRenderingTest::testRegisterCallback()
 CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
 ::tools::Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, 
assuming 96 DPI.
 CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft));
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPostKeyEvent()
@@ -423,6 +425,7 @@ void SdTiledRenderingTest::testPostMouseEvent()
 
 void SdTiledRenderingTest::testSetTextSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
@@ -447,10 +450,12 @@ void SdTiledRenderingTest::testSetTextSelection()
 pXImpressDocument->setTextSelection(LOK_SETTEXTSELECTION_END, aEnd.getX(), 
aEnd.getY());
 // The new selection must include the ending dot, too -- but not the first 
word.
 CPPUNIT_ASSERT_EQUAL(OUString("bbb."), rEditView.GetSelected());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testGetTextSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
@@ -471,10 +476,12 @@ void SdTiledRenderingTest::testGetTextSelection()
 
 // Make sure returned RTF is not empty.
 CPPUNIT_ASSERT(!pXImpressDocument->getTextSelection("text/rtf", 
aUsedFormat).isEmpty());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSetGraphicSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 SdPage* pPage = pViewShell->GetActualPage();
@@ -504,10 +511,13 @@ void SdTiledRenderingTest::testSetGraphicSelection()
 // Check that a resize happened, but aspect ratio is not kept.
 CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth());
 CPPUNIT_ASSERT(aShapeBefore.getHeight() < aShapeAfter.getHeight());
+
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testUndoShells()
 {
+comphelper::LibreOfficeKit::setActive();
 // Load a document and set the page size.
 SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
@@ -525,10 +535,12 @@ void SdTiledRenderingTest::testUndoShells()
 sal_Int32 nView1 = SfxLokHelper::getView();
 // This was -1, SdUndoGroup did not track what view shell created it.
 CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), 
pUndoManager->GetUndoAction()->GetViewShellId());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testResetSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UN

[Libreoffice-commits] core.git: sd/qa sd/source

2018-03-16 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 |   59 +--
 3 files changed, 40 insertions(+), 34 deletions(-)

New commits:
commit 064ad89c0e929cab771c6bda38bad5637db00575
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 

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 27a09e86a856..4c564953aa47 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -137,6 +137,7 @@ public:
 void testTdf104792();
 void testTdf90627();
 void testTdf104786();
+void testTdf104789();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -198,6 +199,7 @@ public:
 CPPUNIT_TEST(testTdf104792);
 CPPUNIT_TEST(testTdf90627);
 CPPUNIT_TEST(testTdf104786);
+CPPUNIT_TEST(testTdf104789);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1584,6 +1586,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, &tempFile);
+
+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 c41e4fb0e129..e4aced1ef9cf 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1004,23 +1004,19 @@ void 
PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
 
 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")
 {
@@ -1034,57 +1030,52 @@ void 
PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
 }
 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 if (rAttributeName == "FillColor")
 {
-pFS->startElementNS(XML_p, XML_attrName, FSEND);
-pFS->writeEscaped("fillcolor");
-pFS->endElementNS(XML_p, XML_attrName);
+pAttribute = "fillcolor";
 }
 

[Libreoffice-commits] core.git: sd/qa sd/source

2018-03-16 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 |   22 +++---
 4 files changed, 31 insertions(+), 8 deletions(-)

New commits:
commit 4f90f35c6f95787cef1e8acb66cfc58f884be8dc
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 

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 8a0f858d903a..27a09e86a856 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -136,6 +136,7 @@ public:
 /// SmartArt animated elements
 void testTdf104792();
 void testTdf90627();
+void testTdf104786();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -196,6 +197,7 @@ public:
 CPPUNIT_TEST(testTdf111789);
 CPPUNIT_TEST(testTdf104792);
 CPPUNIT_TEST(testTdf90627);
+CPPUNIT_TEST(testTdf104786);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1569,6 +1571,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, &tempFile);
+
+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 d2cbbd9a4052..d9289b2bedcf 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -114,7 +114,7 @@ private:
 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 f40ea69470c4..c41e4fb0e129 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -894,7 +894,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;
@@ -902,6 +902,15 @@ void PowerPointExport::WriteAnimationProperty(const 
FSHelperPtr& pFS, const Any&
 sal_uInt32 nRgb;
 double fDouble;
 
+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())
 {
 case TypeClass_LONG:
@@ -924,6 +933,9 @@ void PowerPointExport::WriteAnimationProperty(const 
FSHelperPtr& pFS, const Any&
 default:
 break;
 }
+
+if (bWriteToken)
+pFS->endElementNS(XML_p, nToken);
 }
 
 void PowerPointExport::WriteAnimateValues(const FSHelperPtr

[Libreoffice-commits] core.git: sd/qa sd/source

2018-03-16 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 |   31 +--
 4 files changed, 30 insertions(+), 20 deletions(-)

New commits:
commit 4f1fa172a830ee3da43a7cfc01c38a4aa11d9337
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 

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 765ca29269ea..8a0f858d903a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -135,6 +135,7 @@ public:
 void testTdf111789();
 /// SmartArt animated elements
 void testTdf104792();
+void testTdf90627();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -194,6 +195,7 @@ public:
 CPPUNIT_TEST(testBulletsAsImage);
 CPPUNIT_TEST(testTdf111789);
 CPPUNIT_TEST(testTdf104792);
+CPPUNIT_TEST(testTdf90627);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1554,6 +1556,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, &tempFile);
+
+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 a43ecb4a6930..d2cbbd9a4052 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -103,8 +103,8 @@ private:
 
 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 const & 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 fd0d586556bf..f40ea69470c4 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1291,10 +1291,12 @@ void 
PowerPointExport::WriteAnimationNodeAnimateInside(const FSHelperPtr& pFS, c
 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)
 {
+pFS->startElementNS(XML_p, nToken, FSEND);
+
 if (!pEvent)
 pFS->singleElementNS(XML_p, XML_cond,
  XML_delay, bHasFDelay ? 
I64S(static_cast(fDelay*1000.0)) : pDelay,
@@ -1312,10 +1314,12 @@ void PowerPointExport::WriteAnimationCondition(const 
FSHelperPtr& pFS, const cha
 
 pFS->endElementNS(XML_p, XML_cond);
 }
+
+pFS->endE

[Libreoffice-commits] core.git: sd/qa sd/source

2018-03-10 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 a8fc81d478f4dcf8600ed9a2b4e0f7adff4a17ee
Author: Mike Kaganski 
Date:   Sun Mar 11 07:04:23 2018 +0300

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

Change-Id: Ie0e218ea83d34aa7ee22fea1f32b2851a942544f
Reviewed-on: https://gerrit.libreoffice.org/51069
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 3d3c2c9064bb..c22b35b88435 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -60,6 +61,7 @@ public:
 void testTdf99396();
 void testTdf99396TextEdit();
 void testFillGradient();
+void testTdf44774();
 
 CPPUNIT_TEST_SUITE(SdMiscTest);
 CPPUNIT_TEST(testTdf96206);
@@ -67,6 +69,7 @@ public:
 CPPUNIT_TEST(testTdf99396);
 CPPUNIT_TEST(testTdf99396TextEdit);
 CPPUNIT_TEST(testFillGradient);
+CPPUNIT_TEST(testTdf44774);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -298,6 +301,33 @@ void SdMiscTest::testFillGradient()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(Color(0, 255, 0)),aGradient2.EndColor);
 }
 
+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 042512f05b8e..a304bd36f65d 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -873,7 +873,7 @@ OUString SAL_CALL SdStyleSheet::getParentStyle()
 {
 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: sd/qa sd/source

2018-03-06 Thread Noel Grandin
 sd/qa/unit/import-tests.cxx|4 +-
 sd/source/core/EffectMigration.cxx |2 -
 sd/source/core/drawdoc4.cxx|2 -
 sd/source/filter/eppt/epptbase.hxx |2 -
 sd/source/filter/eppt/pptx-stylesheet.cxx  |   13 +++
 sd/source/filter/html/htmlex.cxx   |   10 ++---
 sd/source/filter/html/pubdlg.cxx   |   10 ++---
 sd/source/filter/ppt/ppt97animations.cxx   |6 ++-
 sd/source/filter/ppt/ppt97animations.hxx   |5 +-
 sd/source/filter/ppt/pptin.cxx |2 -
 sd/source/filter/ppt/pptinanimations.cxx   |4 +-
 sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx |4 +-
 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx   |4 +-
 sd/source/ui/animations/CustomAnimationDialog.cxx  |   10 ++---
 sd/source/ui/animations/motionpathtag.cxx  |2 -
 sd/source/ui/dlg/copydlg.cxx   |6 +--
 sd/source/ui/slideshow/slideshowimpl.cxx   |4 +-
 sd/source/ui/slidesorter/shell/SlideSorterService.cxx  |8 ++--
 sd/source/ui/slidesorter/view/SlideSorterView.cxx  |4 +-
 sd/source/ui/slidesorter/view/SlsTheme.cxx |   22 ++---
 sd/source/ui/unoidl/unoobj.cxx |2 -
 21 files changed, 64 insertions(+), 62 deletions(-)

New commits:
commit 1a41c0711d10bcfa45c7cd7d56c1e7f0055fa310
Author: Noel Grandin 
Date:   Tue Mar 6 13:18:13 2018 +0200

use more Color in sd

Change-Id: Iefd544a70730dfb760b7a89ff697a86ab4fae685
Reviewed-on: https://gerrit.libreoffice.org/50818
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 4fcc325b2370..bc343af65ba5 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -993,11 +993,11 @@ void SdImportTest::testBnc584721_4()
 // Get first run of the paragraph
 uno::Reference xRun( getRunFromParagraph (0, xParagraph 
) );
 uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW 
);
-sal_Int32 nCharColor;
+Color nCharColor;
 xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
 
 // Color should be black
-CPPUNIT_ASSERT_EQUAL( sal_Int32(COL_BLACK), nCharColor );
+CPPUNIT_ASSERT_EQUAL( COL_BLACK, nCharColor );
 
 xDocShRef->DoClose();
 }
diff --git a/sd/source/core/EffectMigration.cxx 
b/sd/source/core/EffectMigration.cxx
index 62b10a680f23..59f60cb21323 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -1019,7 +1019,7 @@ void EffectMigration::SetDimPrevious( SvxShape* pShape, 
bool bDimPrevious )
 Any aColor;
 
 if( bDimPrevious )
-aColor <<= static_cast(COL_LIGHTGRAY);
+aColor <<= COL_LIGHTGRAY;
 
 sd::MainSequencePtr pMainSequence = 
static_cast(pObj->GetPage())->getMainSequence();
 
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 7fda9ef61e67..bf9686b5a777 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -550,7 +550,7 @@ void SdDrawDocument::CreateDefaultCellStyles()
 XHatchaNullHatch(aNullCol);
 
 rISet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
-rISet.Put(XFillColorItem(OUString(), 0x00ff));
+rISet.Put(XFillColorItem(OUString(), Color(0x00ff)));
 
 vcl::Font aLatinFont, aCJKFont, aCTLFont;
 
diff --git a/sd/source/filter/eppt/epptbase.hxx 
b/sd/source/filter/eppt/epptbase.hxx
index b47d1a44fb4a..76f45a490da4 100644
--- a/sd/source/filter/eppt/epptbase.hxx
+++ b/sd/source/filter/eppt/epptbase.hxx
@@ -229,7 +229,7 @@ struct PPTExCharLevel
 sal_uInt16  mnAsianOrComplexFont;
 sal_uInt16  mnFontHeight;
 sal_uInt16  mnEscapement;
-sal_uInt32  mnFontColor;
+Color   mnFontColor;
 };
 
 struct PPTExCharSheet
diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx 
b/sd/source/filter/eppt/pptx-stylesheet.cxx
index e848deb77820..1dbd28ee8a11 100644
--- a/sd/source/filter/eppt/pptx-stylesheet.cxx
+++ b/sd/source/filter/eppt/pptx-stylesheet.cxx
@@ -102,8 +102,8 @@ void PPTExCharSheet::Write( SvStream& rSt, sal_uInt16 nLev, 
bool bSimpleText,
.WriteUInt16( rLev.mnFlags )
.WriteUInt16( rLev.mnFont );
 
-sal_uInt32 nFontColor = rLev.mnFontColor;
-if ( nFontColor == sal_uInt32(COL_AUTO) )
+Color nFontColor = rLev.mnFontColor;
+if ( nFontColor == COL_AUTO )
 {
 bool bIsDark = false;
 css::uno::Any aAny;
@@ -111,12 +111,11 @@ void PPTExCharSheet::Write( SvStream& rSt, sal_uInt16 
nLev, bool bSimpleText,
 aAny >>= bIsDark;
 nFontColor = bIsDark ? 0xff : 0x00;
 }
-nFontColor &= 0xff;
-nFontColor |= 0xfe00;
+nFontC

[Libreoffice-commits] core.git: sd/qa sd/source

2018-02-23 Thread Miklos Vajna
 sd/qa/unit/tiledrendering/data/tdf115873-group.fodp |   36 
 sd/qa/unit/tiledrendering/tiledrendering.cxx|   17 
 sd/source/ui/dlg/sdtreelb.cxx   |   82 +++-
 sd/source/ui/inc/sdtreelb.hxx   |3 
 4 files changed, 104 insertions(+), 34 deletions(-)

New commits:
commit 1f159a4df7dcf9c4b1a35d16aee2303b8fa34b27
Author: Miklos Vajna 
Date:   Fri Feb 23 12:30:02 2018 +0100

tdf#115873 sd navigator: adapt IsEqualToDoc() to Fill() further

SdPageObjsTLB::Fill() populates the navigator tree list box,
SdPageObjsTLB::IsEqualToDoc() determintes if it has to be refreshed or
not.

Commit f3c68cdf8f6a0273c62b493552f78af0138a44e8 (tdf#115873 sd
navigator: allow selecting but not focusing on objects, 2018-02-21)
already brought IsEqualToDoc() closer to Fill() with using the same
iteration mode for the SdrObjects, but that's not enough.

Fill() uses flat iteration, then checks for group shapes explicitly and
visits them recursively. Change IsEqualToDoc() to do the same, this way
selecting "Rectangle 3" in the testcase won't result in a jump back to
"Slide 1" (as an effect of IsEqualToDoc() returning false for an up to
date tree list box).

Change-Id: If2543cbc282af06ba43d4804e7ed455c8b9828cd
Reviewed-on: https://gerrit.libreoffice.org/50234
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sd/qa/unit/tiledrendering/data/tdf115873-group.fodp 
b/sd/qa/unit/tiledrendering/data/tdf115873-group.fodp
new file mode 100644
index ..603ec4c7e5b2
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/tdf115873-group.fodp
@@ -0,0 +1,36 @@
+
+http://www.w3.org/1999/xlink"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:scr
 ipt="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" 
xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xml
 ns:calcext:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:css3t="http://www.w3.org/TR/css3-text/"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.presentation">
+  
+
+
+
+  
+
+
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+
+
+  
+  
+
+
+  
+
+
+  
+  
+
+  
+
+  
+
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index ab3dd0de15b0..7c95dede1b90 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -113,6 +113,7 @@ public:
 void testTdf115783();
 void testPasteTextOnSlide();
 void testTdf115873();
+void testTdf115873Group();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -157,6 +158,7 @@ public:
 CPPUNIT_TEST(testTdf115783);
 CPPUNIT_TEST(testPasteTextOnSlide);
 CPPUNIT_TEST(testTdf115873);
+CPPUNIT_TEST(testTdf115873Group);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2160,6 +2162,21 @@ void SdTiledRenderingTest::testTdf115873()
 CPPUNIT_ASSERT_EQUAL(static_cast(1), rMarkList.GetMarkCount());
 }
 
+void SdTiledRenderingTest::testTdf115873Group()
+{
+// Initialize the navigator.
+SdXImpressDocument* pXImpressDocum

[Libreoffice-commits] core.git: sd/qa sd/source

2018-02-22 Thread Miklos Vajna
 sd/qa/unit/tiledrendering/data/tdf115873.fodp |   29 +++
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |   38 ++
 sd/source/ui/dlg/navigatr.cxx |   27 ++
 sd/source/ui/dlg/sdtreelb.cxx |   18 +++-
 sd/source/ui/inc/navigatr.hxx |3 +-
 sd/source/ui/inc/sdtreelb.hxx |   12 
 6 files changed, 125 insertions(+), 2 deletions(-)

New commits:
commit f3c68cdf8f6a0273c62b493552f78af0138a44e8
Author: Miklos Vajna 
Date:   Wed Feb 21 17:27:53 2018 +0100

tdf#115873 sd navigator: allow selecting but not focusing on objects

There were also two cases here:

- changing the selection with the keyboard or single-click only updated
  the selection in the navigator
- pressing enter or double-click also selected the shape in the main
  window and gave the focus away

Introduce a 3rd case for single-click: update the shape selection but
doesn't give the focus away. This way double-click is not needed to sync
navigator -> main doc selection but keyboard navigation should still
work.

An additional trick is to make sure that the current shell is the draw
shell (and not the slide sorter) after navigation, so follow-up
operations work with the selected object and not with the whole slide.

Finally, a third related problem was that the selection jumped back to
the item of the slide after clicking on a shape in the navigator. The
reason for this was the navigator list was constantly cleared and
re-filled in SdNavigatorWin::InitTreeLB(), as
SdPageObjsTLB::IsEqualToDoc() returned false (even if the list was up to
date) in case of shapes which had children but no name. Fix this by
using the same SdrIterMode::Flat iteration mode that
SdPageObjsTLB::AddShapeList() does, so the fill and the equality check
of the navigator iterates the same way.

Change-Id: I0bfc3e8b49f7ef01d5797a68284616dcd2a81c5d
Reviewed-on: https://gerrit.libreoffice.org/50118
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sd/qa/unit/tiledrendering/data/tdf115873.fodp 
b/sd/qa/unit/tiledrendering/data/tdf115873.fodp
new file mode 100644
index ..1633a0471440
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/tdf115873.fodp
@@ -0,0 +1,29 @@
+
+http://www.w3.org/1999/xlink"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:scr
 ipt="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" 
xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xml
 ns:calcext:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:css3t="http://www.w3.org/TR/css3-text/"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.presentation">
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index b938800a12c3..ab3dd0de15b0 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -111,6 +112,7 @@ public:
 void testIMESupp

[Libreoffice-commits] core.git: 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 e86fb2edfdca48b92b11c149002ab2b06a630b94
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.

Change-Id: Ie0c3717d22da6b6a988ab8d566bd9759e03f86c8
Reviewed-on: https://gerrit.libreoffice.org/50074
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

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 162c2f8c2e4f..b7dd2d05d097 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -110,6 +110,7 @@ public:
 void testDefaultView();
 void testIMESupport();
 void testTdf115783();
+void testPasteTextOnSlide();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -152,6 +153,7 @@ public:
 CPPUNIT_TEST(testDefaultView);
 CPPUNIT_TEST(testIMESupport);
 CPPUNIT_TEST(testTdf115783);
+CPPUNIT_TEST(testPasteTextOnSlide);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2055,6 +2057,70 @@ void SdTiledRenderingTest::testTdf115783()
 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(&ViewCallback::callback,
 &aView1);
+
+// 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 pasted 
text
+SdrObject* pObject = 
pXImpressDocument->GetDocShell()->GetViewShell()->GetActualPage()->GetObj(2);
+SdrTextObj* pTextObj = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pTextObj);
+CPPUNIT_ASSERT_EQUAL(static_cast(OBJ_TEXT), 
pTextObj->GetObjIdentifier());
+Point aPos = pTextObj->GetLastBoundRe

[Libreoffice-commits] core.git: sd/qa sd/source

2018-02-07 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|   24 +--
 sd/source/filter/ppt/pptin.cxx|6 ++---
 5 files changed, 89 insertions(+), 5 deletions(-)

New commits:
commit ba9a42009a6e712aea8646956bd711afb058db24
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 

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 b27c55b55ba8..73d8bb5c49c6 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -93,6 +93,7 @@ public:
 void testTdf100926();
 void testPageWithTransparentBackground();
 void testTextRotation();
+void testTdf115394PPT();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -113,6 +114,7 @@ public:
 CPPUNIT_TEST(testTdf100926);
 CPPUNIT_TEST(testPageWithTransparentBackground);
 CPPUNIT_TEST(testTextRotation);
+CPPUNIT_TEST(testTdf115394PPT);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -843,6 +845,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 652b6ace8626..101131de259b 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -175,6 +175,7 @@ public:
 void testTdf114913();
 void testTdf114821();
 void testTdf115394();
+void testTdf115394PPT();
 
 bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, 
std::vector& rExpected);
 void testPatternImport();
@@ -253,6 +254,7 @@ public:
 CPPUNIT_TEST(testTdf114913);
 CPPUNIT_TEST(testTdf114821);
 CPPUNIT_TEST(testTdf115394);
+CPPUNIT_TEST(testTdf115394PPT);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2414,6 +2416,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);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 81938bc66ecf..217bb4221317 10064

[Libreoffice-commits] core.git: sd/qa sd/source

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

New commits:
commit fa85592c0efba65f4a1b09fea950ec1c311bdd4c
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 

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index b530790b038a..6b2f34f49a05 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -128,6 +128,7 @@ public:
 void testTdf90626();
 void testTdf107608();
 void testTdf111786();
+void testTdf115394();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -181,6 +182,7 @@ public:
 CPPUNIT_TEST(testTdf90626);
 CPPUNIT_TEST(testTdf107608);
 CPPUNIT_TEST(testTdf111786);
+CPPUNIT_TEST(testTdf115394);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1402,6 +1404,40 @@ void SdOOXMLExportTest2::testTdf111786()
 xDocShRef->DoClose();
 }
 
+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, &tempFile);
+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 6b0c8fc5d0d5..bcf9b0e145ea 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -650,7 +650,42 @@ 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;
 
@@ -670,50 +705,12 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& 
pFS)
 
 if (GETA(Change))
 mAny >>= changeType;
+bool isAdvanceTimingSet = advanceTiming != -1;
 
 // 1 means automatic, 2 half automatic - not sure what it means - at least 
I don't see it in UI
 if (changeType == 1 && GETA(Duration))
 mAny >>= advanceTiming;
 
-if (nTransition14 || pPresetTransition)
-{
-const char* pRequiresNS = nTransition14 ? "p14" : "p15";
-
-pFS->startElement(FSNS(XML_mc, XML_AlternateContent), FSEND);
-pFS->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, pRequiresNS, 
FSEND);
-
-
-pFS->startElementNS(XML_p, XML_transition,
-

[Libreoffice-commits] core.git: sd/qa sd/source

2018-01-05 Thread Szymon Kłos
 sd/qa/unit/data/pptx/tdf114848.pptx  |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   15 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |3 +++
 3 files changed, 18 insertions(+)

New commits:
commit 6a91b67b1fe98f114e95649fb7484e22cc3a313b
Author: Szymon Kłos 
Date:   Fri Jan 5 18:12:08 2018 +0100

tdf#114848 Don't save empty themes

Change-Id: I7136f5c0bc884a2f9ea945b4e0bc093a5ef2d8df
Reviewed-on: https://gerrit.libreoffice.org/47481
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 

diff --git a/sd/qa/unit/data/pptx/tdf114848.pptx 
b/sd/qa/unit/data/pptx/tdf114848.pptx
new file mode 100644
index ..5b8b6c3fad7f
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf114848.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 1a6d3b1e4adc..2c499bf77528 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -123,6 +123,7 @@ public:
 void testGroupsPosition();
 void testGroupsRotatedPosition();
 void testAccentColor();
+void testTdf114848();
 void testTdf68759();
 void testTdf90626();
 
@@ -173,6 +174,7 @@ public:
 CPPUNIT_TEST(testGroupsPosition);
 CPPUNIT_TEST(testGroupsRotatedPosition);
 CPPUNIT_TEST(testAccentColor);
+CPPUNIT_TEST(testTdf114848);
 CPPUNIT_TEST(testTdf68759);
 CPPUNIT_TEST(testTdf90626);
 
@@ -1304,6 +1306,19 @@ void SdOOXMLExportTest2::testAccentColor()
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
 }
 
+void SdOOXMLExportTest2::testTdf114848()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114848.pptx"), 
PPTX);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocPtr pXmlDocTheme1 = parseExport(tempFile, "ppt/theme/theme1.xml");
+assertXPath(pXmlDocTheme1, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
+xmlDocPtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
+assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
+}
+
 void SdOOXMLExportTest2::testTdf68759()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf68759.odp"), ODP);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 295d2c043aa8..cb404b1fd8d9 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2604,6 +2604,9 @@ bool PowerPointExport::WriteColorSchemes(FSHelperPtr pFS, 
const OUString& rTheme
 
 aGrabBag.getValue(rThemePath) >>= aCurrentTheme;
 
+if (!aCurrentTheme.getLength())
+return false;
+
 // Order is important
 for (int nId = PredefinedClrSchemeId::dk2; nId != 
PredefinedClrSchemeId::Count; nId++)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2017-11-29 Thread Noel Grandin
 sd/qa/unit/filters-test.cxx|2 +-
 sd/qa/unit/misc-tests.cxx  |2 +-
 sd/qa/unit/sdmodeltestbase.hxx |2 +-
 sd/source/core/drawdoc3.cxx|4 ++--
 sd/source/filter/cgm/sdcgmfilter.cxx   |2 +-
 sd/source/filter/ppt/pptin.cxx |2 +-
 sd/source/filter/xml/sdxmlwrp.cxx  |2 +-
 sd/source/ui/animations/motionpathtag.cxx  |2 +-
 sd/source/ui/annotations/annotationtag.cxx |2 +-
 sd/source/ui/app/sdmod1.cxx|2 +-
 sd/source/ui/dlg/sdtreelb.cxx  |2 +-
 sd/source/ui/inc/DrawDocShell.hxx  |6 +++---
 sd/source/ui/inc/GraphicDocShell.hxx   |4 ++--
 sd/source/ui/inc/smarttag.hxx  |4 ++--
 sd/source/ui/view/sdview3.cxx  |2 +-
 sd/source/ui/view/viewoverlaymanager.cxx   |2 +-
 16 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit 084ba859b42c2b6ef6d812f3cc432b87e4385e7c
Author: Noel Grandin 
Date:   Tue Nov 28 17:08:25 2017 +0200

loplugin:countusersofdefaultparams in sd

Change-Id: I6eb55d450d02615526e78fb69337c66c840ef8a3
Reviewed-on: https://gerrit.libreoffice.org/45463
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx
index 5e2a7a05eeac..e9ddadfd8806 100644
--- a/sd/qa/unit/filters-test.cxx
+++ b/sd/qa/unit/filters-test.cxx
@@ -69,7 +69,7 @@ bool SdFiltersTest::load(const OUString &rFilter, const 
OUString &rURL,
 rUserData, OUString() ));
 const_cast(pFilter.get())->SetVersion(nFilterVersion);
 
-::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false);
+::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress);
 SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ);
 pSrcMed->SetFilter(pFilter);
 bool bLoaded = xDocShRef->DoLoad(pSrcMed);
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 78cf97a95361..bdd7a3f7ac8f 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -267,7 +267,7 @@ void SdMiscTest::testTdf99396TextEdit()
 
 void SdMiscTest::testFillGradient()
 {
-::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false);
+::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress);
 uno::Reference xDrawPagesSupplier = getDoc( 
xDocShRef );
 uno::Reference xDrawPages = 
xDrawPagesSupplier->getDrawPages();
 // Insert a new page.
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 49aa48e2a552..cacd3d676f49 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -140,7 +140,7 @@ protected:
 pFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
 std::shared_ptr pFilt(pFilter);
 
-::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false);
+::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress);
 SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ, pFilt, 
pParams);
 if ( !xDocShRef->DoLoad(pSrcMed) || !xDocShRef.is() )
 {
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index cceadbf80654..dfb48c863ffe 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -226,10 +226,10 @@ SdDrawDocument* 
SdDrawDocument::OpenBookmarkDoc(SfxMedium* pMedium)
 // If that wasn't the case, we could load the model directly.
 if ( bCreateGraphicShell )
 // Draw
-mxBookmarkDocShRef = new 
::sd::GraphicDocShell(SfxObjectCreateMode::STANDARD, true);
+mxBookmarkDocShRef = new 
::sd::GraphicDocShell(SfxObjectCreateMode::STANDARD, true, DocumentType::Draw);
 else
 // Impress
-mxBookmarkDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true);
+mxBookmarkDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true, DocumentType::Impress);
 
 bOK = mxBookmarkDocShRef->DoLoad(pMedium);
 if( bOK )
diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx 
b/sd/source/filter/cgm/sdcgmfilter.cxx
index 9989b3f2a891..e2cbdb930f6f 100644
--- a/sd/source/filter/cgm/sdcgmfilter.cxx
+++ b/sd/source/filter/cgm/sdcgmfilter.cxx
@@ -128,7 +128,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL 
TestImportCGM(SvStream &rStream)
 {
 SdDLL::Init();
 
-::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false);
+::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress);
 
 CGMPointer aPointer;
 
diff --git a/sd/sour

[Libreoffice-commits] core.git: sd/qa sd/source sd/uiconfig

2017-11-17 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  |   15 +++
 sd/uiconfig/simpress/statusbar/statusbar.xml |1 
 5 files changed, 41 insertions(+), 36 deletions(-)

New commits:
commit 44badb1175dbe7906aec993e8f2cc90c81ae71fd
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 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 9622946a4743..b4110b79a4aa 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1856,8 +1856,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 ab1cb41a1668..b7e1c5b33feb 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -314,8 +314,6 @@ void DrawDocShell::Execute( SfxRequest& rReq )
 else
 lcl_setLanguage( pDoc, aNewLangTxt );
 
-mpViewShell->GetFrame()->GetBindings().Invalidate( 
SID_LANGUAGE_STATUS );
-
 if ( pDoc->GetOnlineSpell() )
 {
 pDoc->StartOnlineSpelling();
@@ -323,6 +321,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
 }
 }
 }
+Broadcast(SfxHint(SfxHintId::LanguageChanged));
 }
 break;
 
diff --git a/sd/source/ui/docshell/docshell.cxx 
b/sd/source/ui/docshell/docshell.cxx
index 94a66e9bb18d..967f22552eaa 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -275,47 +275,37 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
 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(&mpDoc->GetPool(), 
OutlinerMode::TextObject);
-aOutliner.SetText(*pParaObj);
-eLanguage = aOutliner.GetLanguage(0, 0);
-bLanguageFound = eLanguage != 
LANGUAGE_DONTKNOW;
-}
+SdrOutliner aOutliner(&mpDoc->GetPool(), 
OutlinerMode::TextObject);
+   

[Libreoffice-commits] core.git: sd/qa sd/source

2017-11-14 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|4 ++-
 4 files changed, 32 insertions(+), 5 deletions(-)

New commits:
commit 831dca83f073bca9ad6242f1b96183eb4a49af69
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 

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 6d5c0bc84af2..37ded6498370 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 
@@ -104,6 +105,7 @@ public:
 void testMultiViewInsertDeletePage();
 void testDisableUndoRepair();
 void testLanguageStatus();
+void testDefaultView();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -142,6 +144,7 @@ public:
 CPPUNIT_TEST(testMultiViewInsertDeletePage);
 CPPUNIT_TEST(testDisableUndoRepair);
 CPPUNIT_TEST(testLanguageStatus);
+CPPUNIT_TEST(testDefaultView);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1836,6 +1839,8 @@ void SdTiledRenderingTest::testDisableUndoRepair()
 CPPUNIT_ASSERT(pUInt32Item);
 CPPUNIT_ASSERT_EQUAL(static_cast(SID_REPAIRPACKAGE), 
pUInt32Item->GetValue());
 }
+
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testLanguageStatus()
@@ -1854,6 +1859,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 4cd01e61acff..ab16b1b1419f 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2413,10 +2413,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 6cc5cd504f19..6c6c95acbb8a 100644
--- a/sd/source/ui/view/ImpressViewShellBase.cxx
+++ b/sd/source/ui/view/ImpressViewShellBase.cxx
@@ -25,10 +25,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 namespace sd {
 
@@ -41,7 +43,7 @@ SfxViewShell* ImpressViewShellBase::CreateInstance (
 SfxViewFrame *pFrame, SfxViewShell *pOldView)
 {
 ImpressViewShellBase* pBase = new ImpressViewShellBase(pFrame, pOldView);
-pBase->LateInit("");
+pBase->LateInit(comphelper::LibreOfficeKit::isActive() ? 
framework::FrameworkHelper::msImpressViewURL : "");
 return pBase;
 }
 void ImpressViewShellBase::RegisterFactory( SfxInterfaceId nPrio )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source svx/source

2017-11-14 Thread Andrea Gelmini
 sd/qa/unit/dialogs-test.cxx|4 ++--
 sd/source/ui/annotations/annotationtag.cxx |2 +-
 svx/source/form/fmexpl.cxx |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 4598e59cfb4c504719c7a8c78021ac47a5d671f5
Author: Andrea Gelmini 
Date:   Tue Nov 14 12:13:46 2017 +0100

Fix typos

Change-Id: Id8df807bb96e036f0cef07cd1095b2d3336efe36
Reviewed-on: https://gerrit.libreoffice.org/44711
Tested-by: Jenkins 
Reviewed-by: Mark Page 

diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 3e0b4d11cec7..3263cc715a02 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -466,7 +466,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 {
 // CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, 
vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, 
PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override;
 // use STR_PSEUDOSHEET_TITLE configuration, see futempl.cxx for 
more possible configurations
-// may be nicer on the long run to take a configuration whch 
represents a selected SdrObject
+// may be nicer on the long run to take a configuration which 
represents a selected SdrObject
 SfxStyleSheetBasePool* pStyleSheetPool = 
getDocShell()->GetStyleSheetPool();
 CPPUNIT_ASSERT(pStyleSheetPool);
 SfxStyleSheetBase* pStyleSheet = pStyleSheetPool->First();
@@ -492,7 +492,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 {
 // CreateSdTabTemplateDlg(const SfxObjectShell* pDocShell, 
SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) override;
 // pretty similar to CreateSdPresLayoutTemplateDlg, see above
-// may be nicer on the long run to take a configuration whch 
represents a selected SdrObject
+// may be nicer on the long run to take a configuration which 
represents a selected SdrObject
 SfxStyleSheetBasePool* pStyleSheetPool = 
getDocShell()->GetStyleSheetPool();
 CPPUNIT_ASSERT(pStyleSheetPool);
 SfxStyleSheetBase* pStyleSheet = pStyleSheetPool->First();
diff --git a/sd/source/ui/annotations/annotationtag.cxx 
b/sd/source/ui/annotations/annotationtag.cxx
index d1adeefb4505..68d2f165c147 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -641,7 +641,7 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, 
VclWindowEvent&, rEvent, void)
 break;
 case VclEventId::WindowMouseMove:
 {
-// if we move the mouse after a button down we wan't 
to start draging
+// if we move the mouse after a button down we want to 
start dragging
 mpListenWindow->RemoveEventListener( LINK(this, 
AnnotationTag, WindowEventHandler));
 mpListenWindow = nullptr;
 
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index c798bd28b9fd..96166a275440 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -254,7 +254,7 @@ FmFormData::FmFormData(const Reference< XForm >& _rxForm, 
FmFormData* _pParent)
 // set images
 m_aNormalImage = Image(RID_SVXBMP_FORM);
 
-// set titel
+// set title
 if (m_xForm.is())
 {
 Reference< XPropertySet >  xSet(m_xForm, UNO_QUERY);
@@ -307,7 +307,7 @@ FmControlData::FmControlData(const Reference< 
XFormComponent >& _rxComponent, Fm
 m_aNormalImage = GetImage();
 
 
-// set titel
+// set title
 Reference< XPropertySet >  xSet(m_xFormComponent, UNO_QUERY);
 if( xSet.is() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2017-10-03 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  |   42 +-
 5 files changed, 55 insertions(+), 9 deletions(-)

New commits:
commit 42c9be63a309fa0d7506ada9cf759dbe023c4a0f
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 

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 fa28714b4f27..1ba4f1362d23 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -118,6 +118,7 @@ public:
 void testTdf112086();
 void testTdf112647();
 void testGroupRotation();
+void testTdf104788();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -161,6 +162,7 @@ public:
 CPPUNIT_TEST(testTdf112086);
 CPPUNIT_TEST(testTdf112647);
 CPPUNIT_TEST(testGroupRotation);
+CPPUNIT_TEST(testTdf104788);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1219,6 +1221,23 @@ void SdOOXMLExportTest2::testGroupRotation()
 assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[2]/p:spPr/a:xfrm", "rot", "2040");
 }
 
+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, &tempFile);
+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 2780767230d6..1d98b541a688 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 30653a9a02f9..620e6eecc4d9 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1399,7 +1399,6 @@ Any AnimationExporter::convertAnimateValue( const Any& 
rSourceValue, const OUStr
 }
 }
 else if ( rAttributeName == "Rotate" // "r" or "style.rotation" ?
-|| rAttributeName == "SkewX"
 || rAttr

[Libreoffice-commits] core.git: sd/qa sd/source

2017-09-22 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 238cfa9efa21f08514703ea6cc181ce02d8feb12
Author: Tamás Zolnai 
Date:   Fri Sep 22 01:57:18 2017 +0200

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

Change-Id: I26680ecdb5f0db4f27180c221de062341af0265c
Reviewed-on: https://gerrit.libreoffice.org/42611
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

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 512a4dc32b73..0135e52ab9db 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -110,6 +110,7 @@ public:
 void testTdf112088();
 void testTdf112333();
 void testTdf112552();
+void testTdf112557();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -147,6 +148,7 @@ public:
 CPPUNIT_TEST(testTdf112088);
 CPPUNIT_TEST(testTdf112333);
 CPPUNIT_TEST(testTdf112552);
+CPPUNIT_TEST(testTdf112557);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1115,6 +1117,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, &tempFile);
+
+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 4380048896c5..633968dcacd4 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -322,8 +322,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));
@@ -2035,7 +2038,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 
nPageNum, Reference< XPro
 pFS->startElementNS(XML_p, XML_cSld, FSEND);
 
 ImplWriteBackground(pFS, aXBackgroundPropSet);
-WriteShapeTree(pFS, LAYOUT, true);
+WriteShapeTree(pFS, MASTER, true);
 
 pFS->endElementNS(XML_p, XML_cSld);
 
@@ -2199,7 +2202,7 @@ void PowerPointExport::WriteShapeTree(const FSHelperPtr& 
pFS, PageType ePageType
 
 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: sd/qa sd/source

2017-09-18 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 |4 ++--
 3 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 1ea4496f3b2defaf51391e816d159717c55f2929
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.

Change-Id: I40be0311a7b7ffc64ac3a97a92a3ea835faa5293
Reviewed-on: https://gerrit.libreoffice.org/42261
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

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 820f02723c52..38d39ead02c8 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -101,6 +101,7 @@ public:
 void testPptmContentType();
 void testTdf111798();
 void testPptmVBAStream();
+void testTdf111863();
 void testTdf111518();
 void testTdf100387();
 void testRotateFlip();
@@ -135,6 +136,7 @@ public:
 CPPUNIT_TEST(testPptmContentType);
 CPPUNIT_TEST(testTdf111798);
 CPPUNIT_TEST(testPptmVBAStream);
+CPPUNIT_TEST(testTdf111863);
 CPPUNIT_TEST(testTdf111518);
 CPPUNIT_TEST(testTdf100387);
 CPPUNIT_TEST(testRotateFlip);
@@ -909,6 +911,19 @@ void SdOOXMLExportTest2::testPptmVBAStream()
 xDocShRef->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, &tempFile);
+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 62b0c4c1440b..f5d39c36ba0c 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1482,10 +1482,10 @@ void PowerPointExport::WriteAnimationNodeEffect(const 
FSHelperPtr& pFS, const Re
 if (xFilter.is())
 {
 const char* pFilter = 
::ppt::AnimationExporter::FindTransitionName(xFilter->getTransition(), 
xFilter->getSubtype(), xFilter->getDirection());
-const char* pDirection = xFilter->getDirection() ? "in" : "out";
+const char* pMode = xFilter->getMode() ? "in" : "out";
 pFS->startElementNS(XML_p, XML_animEffect,
 XML_filter, pFilter,
-XML_transition, pDirection,
+XML_transition, pMode,
 FSEND);
 
 WriteAnimationNodeAnimateInside(pFS, rXNode, bMainSeqChild, false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/qa sd/source

2017-08-25 Thread Paul Trojahn
 sd/qa/unit/export-tests-ooxml2.cxx   |   18 +++---
 sd/source/filter/eppt/pptx-epptooxml.cxx |3 ++-
 2 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 69cfafef7a28aad7a013bb440e15e23e59ea628c
Author: Paul Trojahn 
Date:   Wed Aug 23 00:07:29 2017 +0200

tdf#100387 tdf#100389 OOXML animation export fixes

The second cTn tag needs to have a dur="indefinite" attribute, otherwise
the last element is hidden immediately after being shown. Also the value
of all fill attributes with the value freeze needs to be hold, otherwise
only one animation node is shown at a time.

Change-Id: Ie4ecf69f5a3a1c56d8b3b489351dc2882efd6328
Reviewed-on: https://gerrit.libreoffice.org/41463
Tested-by: Tamás Zolnai 
Reviewed-by: Tamás Zolnai 

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index bb66d8ebc2d1..66d2bf5ae645 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -922,21 +922,25 @@ void SdOOXMLExportTest2::testTdf100387()
 utl::TempFile tempFile;
 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
 xDocShRef->DoClose();
-xmlDocPtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml");
+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", "dur", 
"indefinite");
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]/p:cTn",
 "fill", "hold");
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]/p:cTn/p:childTnLst/p:par/p:cTn",
 "fill", "hold");
 
-assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]"
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]"
  
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "st", "0");
-assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]"
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]"
  
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "end", "0");
 
-assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]"
+assertXPath(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:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "st", "1");
-assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]"
+assertXPath(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:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "end", "1");
 
-assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
  
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "st", "2");
-assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
+assertXPath(pXmlDocContent, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
  
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "end", "2");
 }
 
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 2f02dc49d697..975a7b2c3e56 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1241,6 +1241,7 @@ void 
PowerPointExport::WriteAnimationNodeCommonPropsStart(const FSHelperPtr& pFS
 break;
 case EffectNodeType::MAIN_SEQUENCE:
 pNodeType = "mainSeq";
+pDuration = "indefinite";
 break;
 case EffectNodeType::ON_CLICK:
 pNodeType = "clickEffect";
@@ -1314,7 +1315,7 @@ void 
PowerPointExport::WriteAnimationNodeCommonPropsStart(const FSHelperPtr& pFS
 switch (nFill)
 {
 case AnimationFill::FREEZE:
-pFill = "freeze";
+pFill = "hold";
   

[Libreoffice-commits] core.git: sd/qa sd/source

2017-08-24 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 |  324 ++---
 3 files changed, 179 insertions(+), 164 deletions(-)

New commits:
commit b766cab621690a3aaf4e10fcf925ebab1c1925b8
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.

Change-Id: Iae185ac7e5d2505554692045516cc51dbdcd735b
Reviewed-on: https://gerrit.libreoffice.org/41517
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

diff --git a/sd/qa/unit/data/pptx/tdf108926.ppt 
b/sd/qa/unit/data/pptx/tdf108926.ppt
new file mode 100755
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 7546689852a5..f9177c6493d3 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -171,6 +171,7 @@ public:
 void testSmartArtRotation();
 void testTdf109223();
 void testTdf109187();
+void testTdf108926();
 
 bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, 
std::vector& rExpected);
 void testPatternImport();
@@ -250,6 +251,7 @@ public:
 CPPUNIT_TEST(testSmartArtRotation);
 CPPUNIT_TEST(testTdf109223);
 CPPUNIT_TEST(testTdf109187);
+CPPUNIT_TEST(testTdf108926);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2431,6 +2433,23 @@ void SdImportTest::testTdf109187()
 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 7bec40a94c6c..ce06ae52a268 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2355,215 +2355,211 @@ 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;
+case PptPlaceholder::VERTICALTEXTTITLE :
+bVertical = true;
+SAL_FALLTHROUGH;
+case PptPlaceholder::TITLE :
ePresObjKind = PRESOBJ_TITLE;   break;
+case PptPlaceho

[Libreoffice-commits] core.git: sd/qa sd/source

2017-08-18 Thread Paul Trojahn
 sd/qa/unit/data/odp/tdf100387.odp|binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   27 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   29 -
 3 files changed, 51 insertions(+), 5 deletions(-)

New commits:
commit 81d40428bbcfe332b78e154b4cd3fd7feff5ff73
Author: Paul Trojahn 
Date:   Mon Aug 7 10:18:36 2017 +0200

tdf#100387 Fix OOXML export of animated lists

pRg is a paragraph range, not a character range.
AnimationExporter::getTargetElementShape is still
used by the ppt export filter, so I just moved the
relevant parts over to
PowerPointExport::WriteAnimationTarget.

Change-Id: If477013d62483d57fe142c9da3ab0c75872733af
Reviewed-on: https://gerrit.libreoffice.org/40979
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 

diff --git a/sd/qa/unit/data/odp/tdf100387.odp 
b/sd/qa/unit/data/odp/tdf100387.odp
new file mode 100644
index ..72c7ba38528c
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf100387.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 3d89edec6120..8f41bc928427 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -101,6 +101,7 @@ public:
 void testPptmContentType();
 void testPptmVBAStream();
 void testTdf111518();
+void testTdf100387();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -129,6 +130,7 @@ public:
 CPPUNIT_TEST(testPptmContentType);
 CPPUNIT_TEST(testPptmVBAStream);
 CPPUNIT_TEST(testTdf111518);
+CPPUNIT_TEST(testTdf100387);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -854,6 +856,31 @@ void SdOOXMLExportTest2::testTdf111518()
 "M -3.54167E-6 -4.81481E-6 L 0.39037 -0.00069");
 }
 
+void SdOOXMLExportTest2::testTdf100387()
+{
+
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf100387.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->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[1]"
+ 
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "st", "0");
+assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]"
+ 
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "end", "0");
+
+assertXPath(pXmlDocRels, 
"/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:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "st", "1");
+assertXPath(pXmlDocRels, 
"/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:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "end", "1");
+
+assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
+ 
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "st", "2");
+assertXPath(pXmlDocRels, 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
+ 
"/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg",
 "end", "2");
+}
+
 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 c8d3532617b7..2f02dc49d697 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -66,6 +66,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -936,9 +937,27 @@ void PowerPointExport::WriteAnimationAttributeName(const 
FSHelperPtr& pFS, const
 
 void PowerPointExport::WriteAnimationTarget(const FSHelperPtr& pFS, const Any& 
rTarget)
 {
-sal_Int32 nBegin = -1, nEnd = -1;
-bool bParagraphTarget;
-Reference< XShape > rXShape = 
AnimationExporter::getTargetElementShape(rTarget, nBegin, nEnd, 
bParagraphTarget);
+sal_Int32 nParagraph = -1;
+bool bParagraphTarget = false;
+
+Reference< XShape > rXShape;
+rTarget >>= rXShape;
+
+if (!rXShape.is())
+{
+ParagraphTarget aParagraphTarget;
+if (rTarget >>= aParagraphTarget)
+rXShape = aParagraphTarget.Shape;
+if (rXShape.is())
+{
+nParagraph = static_cast< sal_Int

[Libreoffice-commits] core.git: sd/qa sd/source

2017-06-28 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 b6bd337595383b9b9f0524ec4190dc3e1fbbf6e1
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 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 628c72afef30..0ff3e16717c1 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -100,6 +100,7 @@ public:
 void testTdf105502();
 void testCommentCallbacks();
 void testMultiViewInsertDeletePage();
+void testDisableUndoRepair();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -136,6 +137,7 @@ public:
 CPPUNIT_TEST(testTdf105502);
 CPPUNIT_TEST(testCommentCallbacks);
 CPPUNIT_TEST(testMultiViewInsertDeletePage);
+CPPUNIT_TEST(testDisableUndoRepair);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1768,6 +1770,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_EQUAL(SfxItemState::DISABLED, 
pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem1));
+CPPUNIT_ASSERT_EQUAL(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 7e744d07f598..5f342906d994 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -126,54 +126,58 @@ void  ViewShell::GetMenuState( SfxItemSet &rSet )
 if(SfxItemState::DEFAULT == rSet.GetItemState(SID_UNDO))
 {
 ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
-bool bActivate(false);
-
 if(pUndoManager)
 {
 if(pUndoManager->GetUndoActionCount() != 0)
 {
-bActivate = true;
+// If an other view created the first undo action, prevent 
redoing it from this view.
+const SfxUndoAction* pAction = pUndoManager->GetUndoAction();
+if (pAction->GetViewShellId() != 
GetViewShe

[Libreoffice-commits] core.git: sd/qa sd/source

2017-06-26 Thread Noel Grandin
 sd/qa/unit/SVGExportTests.cxx |3 
 sd/qa/unit/import-tests.cxx   |2 
 sd/source/core/drawdoc4.cxx   |4 
 sd/source/core/pglink.cxx |4 
 sd/source/core/sdpage.cxx |   12 --
 sd/source/core/stlpool.cxx|3 
 sd/source/core/stlsheet.cxx   |3 
 sd/source/filter/eppt/eppt.cxx|9 --
 sd/source/filter/eppt/epptso.cxx  |   20 ++--
 sd/source/filter/eppt/pptexanimations.cxx |   74 --
 sd/source/filter/eppt/pptx-epptooxml.cxx  |6 -
 sd/source/filter/eppt/pptx-stylesheet.cxx |2 
 sd/source/filter/grf/sdgrffilter.cxx  |3 
 sd/source/filter/html/pubdlg.cxx  |3 
 sd/source/filter/sdfilter.cxx |3 
 sd/source/filter/xml/sdxmlwrp.cxx |   15 +--
 sd/source/ui/animations/motionpathtag.cxx |4 
 sd/source/ui/annotations/annotationtag.cxx|6 -
 sd/source/ui/dlg/LayerTabBar.cxx  |6 -
 sd/source/ui/dlg/PhotoAlbumDialog.cxx |6 -
 sd/source/ui/dlg/TemplateScanner.cxx  |   10 --
 sd/source/ui/dlg/animobjs.cxx |2 
 sd/source/ui/dlg/dlgolbul.cxx |3 
 sd/source/ui/docshell/docshel4.cxx|5 -
 sd/source/ui/framework/factories/ViewShellWrapper.cxx |4 
 sd/source/ui/func/bulmaper.cxx|   12 --
 sd/source/ui/func/fuformatpaintbrush.cxx  |3 
 sd/source/ui/func/fuinsfil.cxx|3 
 sd/source/ui/func/fuolbull.cxx|3 
 sd/source/ui/func/fuprobjs.cxx|   28 +++---
 sd/source/ui/func/futext.cxx  |6 -
 sd/source/ui/remotecontrol/BluetoothServer.cxx|3 
 sd/source/ui/remotecontrol/Receiver.cxx   |3 
 sd/source/ui/sidebar/MasterPageContainer.cxx  |3 
 sd/source/ui/sidebar/MasterPageContainerProviders.cxx |3 
 sd/source/ui/tools/IdleDetection.cxx  |4 
 sd/source/ui/tools/PreviewRenderer.cxx|2 
 sd/source/ui/unoidl/SdUnoSlideView.cxx|4 
 sd/source/ui/view/ViewShellBase.cxx   |7 -
 sd/source/ui/view/drtxtob1.cxx|3 
 sd/source/ui/view/drviews2.cxx|3 
 sd/source/ui/view/drviews3.cxx|   12 --
 sd/source/ui/view/drviews4.cxx|6 -
 sd/source/ui/view/drviews6.cxx|3 
 sd/source/ui/view/drviewsa.cxx|3 
 sd/source/ui/view/drviewsd.cxx|6 -
 sd/source/ui/view/sdview2.cxx |3 
 sd/source/ui/view/viewshel.cxx|6 -
 48 files changed, 133 insertions(+), 208 deletions(-)

New commits:
commit b59b4a38b45e1bf158701355c8c70f1c59f3e112
Author: Noel Grandin 
Date:   Sun Jun 25 19:10:54 2017 +0200

loplugin:oncevar in sd

Change-Id: I56649b4df8c517f152ed4e9132985bbef22f8634
Reviewed-on: https://gerrit.libreoffice.org/39241
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index d241822caecc..c976436a6f89 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -57,8 +57,7 @@ protected:
 {
 uno::Reference xStorable(mxComponent, 
uno::UNO_QUERY);
 utl::MediaDescriptor aMediaDescriptor;
-OUString aFilterName("impress_svg_Export");
-aMediaDescriptor["FilterName"] <<= aFilterName;
+aMediaDescriptor["FilterName"] <<= OUString("impress_svg_Export");
 xStorable->storeToURL(maTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
 }
 
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 73e89b3d13ff..6f75439da31e 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -284,7 +284,7 @@ void SdImportTest::testDocumentLayout()
 
 for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) 
); ++i )
 {
-int nUpdateMe = -1; // index of test we want to update; supposedly 
only when the test is created
+int const nUpdateMe = -1; // index of test we want to update; 
supposedly only when the test is created
 
 sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( 
"/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pInput ), 
aFilesToCompare[i].nFormat );
 if( aFilesToCompare[i].nExportType >= 0 )
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index d4290d037a27..5bc477b0f535 100644

[Libreoffice-commits] core.git: sd/qa sd/source

2017-03-31 Thread Noel Grandin
 sd/qa/unit/export-tests-ooxml1.cxx   |6 ++---
 sd/qa/unit/export-tests-ooxml2.cxx   |4 +--
 sd/qa/unit/import-tests.cxx  |   35 +++
 sd/qa/unit/misc-tests.cxx|6 ++---
 sd/source/filter/eppt/pptx-epptooxml.cxx |2 -
 sd/source/filter/eppt/pptx-text.cxx  |2 -
 sd/source/ui/func/fuoaprms.cxx   |8 +++
 sd/source/ui/unoidl/unoobj.cxx   |2 -
 sd/source/ui/view/drviews9.cxx   |   10 
 9 files changed, 55 insertions(+), 20 deletions(-)

New commits:
commit 82025e7f7af562549a900b9f1d76ed73fe4f2a58
Author: Noel Grandin 
Date:   Fri Mar 31 12:21:44 2017 +0200

use actual UNO enums in sd

Change-Id: Ife2590d2d8d7622ea6fa2f03d6a333c856326d34
Reviewed-on: https://gerrit.libreoffice.org/35963
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 2fc233bf836a..e7a29c25f6c4 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -507,12 +507,12 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
 drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
 xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
 xCell->getPropertyValue("FillStyle") >>= aFillStyle;
-CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, aFillStyle);
+CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_BITMAP, (int)aFillStyle);
 
 // Test Gradient fill type for cell
 xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
 xCell->getPropertyValue("FillStyle") >>= aFillStyle;
-CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle);
+CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, (int)aFillStyle);
 
 xDocShRef->DoClose();
 }
@@ -543,7 +543,7 @@ void SdOOXMLExportTest1::testLineStyle()
 
 const XLineStyleItem& rStyleItem = dynamic_cast(
 pShape->GetMergedItem(XATTR_LINESTYLE));
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style",drawing::LineStyle_SOLID, 
rStyleItem.GetValue());
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style", (int)drawing::LineStyle_SOLID, 
(int)rStyleItem.GetValue());
 
 xDocShRef->DoClose();
 }
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index fa83615f268e..0e6bd2542814 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -768,12 +768,12 @@ void SdOOXMLExportTest2::testTdf105739()
 // Test fill type
 drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
 aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
-CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle);
+CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, 
(int)aFillStyle);
 
 // Test gradient properties
 com::sun::star::awt::Gradient aFillGradient;
 aXBackgroundPropSet->getPropertyValue("FillGradient") >>= 
aFillGradient;
-CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_LINEAR, aFillGradient.Style);
+CPPUNIT_ASSERT_EQUAL((int)awt::GradientStyle_LINEAR, 
(int)aFillGradient.Style);
 CPPUNIT_ASSERT_EQUAL(util::Color(0xff), aFillGradient.StartColor);
 CPPUNIT_ASSERT_EQUAL(util::Color(0x00b050), aFillGradient.EndColor);
 }
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c4dfd192dd09..f45ae187d0db 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -623,6 +623,41 @@ std::ostream& operator<<(std::ostream& rStrm, const 
uno::Reference& xRef)
 
 } } } }
 
+namespace com { namespace sun { namespace star { namespace drawing {
+
+std::ostream& operator<<(std::ostream& rStrm, LineStyle n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+std::ostream& operator<<(std::ostream& rStrm, FillStyle n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+
+} } } }
+
+namespace com { namespace sun { namespace star { namespace presentation {
+
+std::ostream& operator<<(std::ostream& rStrm, ClickAction n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+
+} } } }
+
+namespace com { namespace sun { namespace star { namespace style {
+
+std::ostream& operator<<(std::ostream& rStrm, ParagraphAdjust n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+
+} } } }
+
 void SdImportTest::testTdf97808()
 {
 sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/tdf97808.fodp"), FODP);
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 87c6beb66ca0..014869cb0790 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -228,7 +228,7 @@ void SdMiscTest::testTdf99396TextEdit()
 uno::Reference xTable = pTableObject->getTable();
 uno::Reference xCell(xTable->getCellByPosition(0, 
0), uno::UNO_QUERY);
 drawing::TextVerticalAdjust eAdjust = 
xCell->getPropertyValue("TextVerticalAdjust").get();
-  

[Libreoffice-commits] core.git: sd/qa sd/source

2017-03-14 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 986ab0b771e8e921d132059fda4971b18064c1aa
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
Reviewed-on: https://gerrit.libreoffice.org/35149
Tested-by: Jenkins 
Reviewed-by: Jan Holesovsky 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 10fb24b..58e146a 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(&SdTiledRenderingTest::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 55f0f37..0858912 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1073,8 +1073,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)
@@ -1084,9 +1088,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


[Libreoffice-commits] core.git: sd/qa sd/source

2016-10-18 Thread Noel Grandin
 sd/qa/unit/tiledrendering/data/tdf103083.fodp |  932 ++
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |   70 +
 sd/source/ui/view/sdview.cxx  |   43 -
 3 files changed, 1009 insertions(+), 36 deletions(-)

New commits:
commit 7e4887679924df28da2083735e0367ecccb8180b
Author: Noel Grandin 
Date:   Fri Oct 14 16:38:57 2016 +0200

tdf#103083 - EDITING: Cut and Paste changes bullet point formatting

The bug is that, on paste, the incorrect stylesheet is set on a paragraph
node, leading to the loss of bullet formatting information.

There are two copies of this style-resetting code, one in
   sd::View::OnEndPasteOrDrop
and the other in
Outliner::ImplSetLevelDependendStyleSheet.

The first one was introduced by:
commit 8aa3d1214b17873f6c3d79d95da8bc33d78298c4
Author: Rüdiger Timm 
Date:   Fri Jun 6 11:11:54 2008 +
INTEGRATION: CWS impressodf12 (1.62.4); FILE MERGED

And the second one by:
   commit a6b3e8c1495151b99c3f2f0eadf5881654cbd3b3
   Author: Rüdiger Timm 
   Date:   Fri Jun 6 11:30:58 2008 +
   INTEGRATION: CWS impressodf12 (1.70.350); FILE MERGED

The second one appears to do the right thing, and fixes this bug,
so I am deleting the first one.

Change-Id: I5eede7fe7bd3aa24696b495e740d1a4df124bd3a
Reviewed-on: https://gerrit.libreoffice.org/30009
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/sd/qa/unit/tiledrendering/data/tdf103083.fodp 
b/sd/qa/unit/tiledrendering/data/tdf103083.fodp
new file mode 100644
index 000..8de5e37
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/tdf103083.fodp
@@ -0,0 +1,932 @@
+
+
+http://www.w3.org/1999/xlink"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:scr
 ipt="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" 
xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xml
 ns:calcext:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:css3t="http://www.w3.org/TR/css3-text/"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.presentation">
+ 
+2016-10-03T11:33:02.159552013
+PT21M51S
+2
+LibreOfficeDev/5.3.0.0.alpha0$Linux_X86_64 
LibreOffice_project/36b8fd83a57132f486d918e5ab39a6e8898bb630
+2016-10-03T11:33:43.592997719
+ 
+  
+   -275
+   -1323
+   28053
+   19616
+   
+
+ view1
+ false
+ false
+ true
+ true
+ true
+ true
+ false
+ false
+ true
+ 1500
+ false
+ //8=
+ //8=
+ 
+ false
+ true
+ V2278V23104H18449H578V627V24757H4049H2466H17561
+ true
+ 0
+ 0
+ false
+ true
+ false
+ 4
+ 0
+ -275
+ -1323
+ 28057
+ 19620
+ 2540
+ 2540
+ 254
+ 254
+ 254
+ 1
+ 254
+ 1
+ false
+ 1500
+ true
+ true
+
+   
+  
+  
+   true
+   $(inst)/share/palette%3B$(user)/config/standard.sob
+   0
+   $(inst)/share/palette%3B$(user)/config/standard.soc
+   $(inst)/share/palette%3B$(user)/config/standard.sod
+   1270
+   false
+   
+
+ de
+ DE
+ 
+ 
+ 
+
+
+ en
+ US
+ 
+ 
+ 
+
+
+ en
+ GB
+ 
+ 
+ 
+
+
+  

  1   2   >