[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, 

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

2023-11-01 Thread Henry Castro (via logerrit)
 sd/qa/unit/data/pptx/master-slides.pptx |binary
 sd/qa/unit/import-tests2.cxx|   10 ++
 2 files changed, 10 insertions(+)

New commits:
commit 32e6ef3834a0f96d7830719950de52c99aae0263
Author: Henry Castro 
AuthorDate: Mon Oct 9 10:29:40 2023 -0400
Commit: Henry Castro 
CommitDate: Wed Nov 1 14:08:04 2023 +0100

tdf#155512: sd: qa: unit: add unit test "testMasterSlides"

Signed-off-by: Henry Castro 
Change-Id: I6117b384fdad215e6c04b6e74df22fe9daa6a526
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157705
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158739
Tested-by: Jenkins

diff --git a/sd/qa/unit/data/pptx/master-slides.pptx 
b/sd/qa/unit/data/pptx/master-slides.pptx
new file mode 100644
index ..3494d33254ab
Binary files /dev/null and b/sd/qa/unit/data/pptx/master-slides.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 44eacbf1da05..da6572b8af5a 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1972,6 +1972,16 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf153012)
 CPPUNIT_ASSERT_EQUAL(Color(0xd9d9d9), aFillColor);
 }
 
+CPPUNIT_TEST_FIXTURE(SdImportTest2, testMasterSlides)
+{
+createSdImpressDoc("pptx/master-slides.pptx");
+uno::Reference 
xMasterPagesSupplier(mxComponent,
+   
uno::UNO_QUERY_THROW);
+uno::Reference 
xMasterPages(xMasterPagesSupplier->getMasterPages());
+CPPUNIT_ASSERT(xMasterPages.is());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(7), xMasterPages->getCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-10-28 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 2a302e143d4c6b1fc26aee6fdb53e876166d0340
Author: Xisco Fauli 
AuthorDate: Sat Oct 28 09:33:22 2023 +0200
Commit: Xisco Fauli 
CommitDate: Sat Oct 28 18:51:18 2023 +0200

CppunitTest_sd_png_export_tests: relax test a bit

See https://gerrit.libreoffice.org/c/core/+/158341

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 513d7a1e8cf9..da435ae971f1 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -1,4 +1,3 @@
-
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
@@ -496,9 +495,9 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157793)
 }
 
 // Without the fix in place, this test would have failed with
-// - Expected greater than: 8500
+// - Expected greater than: 7800
 // - Actual  : 0
-CPPUNIT_ASSERT_GREATER(8500, nLightGrayCount);
+CPPUNIT_ASSERT_GREATER(7800, nLightGrayCount);
 }
 
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157635)


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

2023-10-25 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   49 ++
 sd/qa/unit/data/odp/tdf157795.odp |binary
 2 files changed, 49 insertions(+)

New commits:
commit 33f158d96c5782a862345736bc6561afe3d583b5
Author: Xisco Fauli 
AuthorDate: Wed Oct 25 10:33:01 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 25 12:28:08 2023 +0200

tdf#157795: sd_png_export: Add unittest

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index af48ecbdd713..513d7a1e8cf9 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -301,6 +301,55 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf156808)
 CPPUNIT_ASSERT_GREATER(9000, nBlackCount);
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157795)
+{
+loadFromURL(u"odp/tdf157795.odp");
+uno::Reference xContext = getComponentContext();
+CPPUNIT_ASSERT(xContext.is());
+uno::Reference xGraphicExporter
+= drawing::GraphicExportFilter::create(xContext);
+
+uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100)),
+comphelper::makePropertyValue("Translucent", sal_Int32(1)),
+};
+
+uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+   uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xPage);
+xGraphicExporter->filter(aDescriptor);
+
+SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+vcl::PngImageReader aPNGReader(aFileStream);
+BitmapEx aBMPEx = aPNGReader.read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+Size aSize = aBMPEx.GetSizePixel();
+CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
+Bitmap aBMP = aBMPEx.GetBitmap();
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX)
+{
+for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+
+// Without the fix in place, this test would have failed with
+// - Expected: rgba[00ff]
+// - Actual  : rgba[010101ff]
+CPPUNIT_ASSERT_EQUAL(COL_BLACK, aColor);
+}
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105362)
 {
 loadFromURL(u"odp/tdf105362.odp");
diff --git a/sd/qa/unit/data/odp/tdf157795.odp 
b/sd/qa/unit/data/odp/tdf157795.odp
new file mode 100644
index ..abfe29bb7940
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf157795.odp differ


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

2023-10-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx   |   51 
 sd/qa/unit/data/pptx/tdf157793.pptx |binary
 2 files changed, 51 insertions(+)

New commits:
commit 4d0e2203d1ccceb4a742b02c267e613b50ca9370
Author: Xisco Fauli 
AuthorDate: Mon Oct 23 11:19:33 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 23 15:28:07 2023 +0200

tdf#157793: sd_png_export: Add unittest

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index a5b705c19f39..af48ecbdd713 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -401,6 +401,57 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157636)
 CPPUNIT_ASSERT_GREATER(6600, nBlackCount);
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157793)
+{
+loadFromURL(u"pptx/tdf157793.pptx");
+uno::Reference xContext = getComponentContext();
+CPPUNIT_ASSERT(xContext.is());
+uno::Reference xGraphicExporter
+= drawing::GraphicExportFilter::create(xContext);
+
+uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
+};
+
+uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+   uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xPage);
+xGraphicExporter->filter(aDescriptor);
+
+SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+vcl::PngImageReader aPNGReader(aFileStream);
+BitmapEx aBMPEx = aPNGReader.read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+Size aSize = aBMPEx.GetSizePixel();
+CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
+Bitmap aBMP = aBMPEx.GetBitmap();
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+int nLightGrayCount = 0;
+for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX)
+{
+for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+if (aColor == 0xfefefe)
+++nLightGrayCount;
+}
+}
+
+// Without the fix in place, this test would have failed with
+// - Expected greater than: 8500
+// - Actual  : 0
+CPPUNIT_ASSERT_GREATER(8500, nLightGrayCount);
+}
+
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157635)
 {
 loadFromURL(u"pptx/tdf157635.pptx");
diff --git a/sd/qa/unit/data/pptx/tdf157793.pptx 
b/sd/qa/unit/data/pptx/tdf157793.pptx
new file mode 100644
index ..b1c4f200b86d
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf157793.pptx differ


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

2023-10-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   49 ++
 sd/qa/unit/data/odp/tdf105362.odp |binary
 2 files changed, 49 insertions(+)

New commits:
commit 4648764378f42df7dee4a4cf7d1614ee64e1d1a3
Author: Xisco Fauli 
AuthorDate: Mon Oct 23 12:50:12 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 23 15:27:00 2023 +0200

tdf#105362: sd_png_export: Add unittest

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index c141c0ddeeb0..a5b705c19f39 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -301,6 +301,55 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf156808)
 CPPUNIT_ASSERT_GREATER(9000, nBlackCount);
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105362)
+{
+loadFromURL(u"odp/tdf105362.odp");
+uno::Reference xContext = getComponentContext();
+CPPUNIT_ASSERT(xContext.is());
+uno::Reference xGraphicExporter
+= drawing::GraphicExportFilter::create(xContext);
+
+uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100)),
+comphelper::makePropertyValue("Translucent", sal_Int32(1)),
+};
+
+uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+   uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xPage);
+xGraphicExporter->filter(aDescriptor);
+
+SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+vcl::PngImageReader aPNGReader(aFileStream);
+BitmapEx aBMPEx = aPNGReader.read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+Size aSize = aBMPEx.GetSizePixel();
+CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
+Bitmap aBMP = aBMPEx.GetBitmap();
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX)
+{
+for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+
+// Without the fix in place, this test would have failed with
+// - Expected: rgba[00ff]
+// - Actual  : rgba[]
+CPPUNIT_ASSERT_EQUAL(COL_BLACK, aColor);
+}
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157636)
 {
 loadFromURL(u"ppt/tdf157636.ppt");
diff --git a/sd/qa/unit/data/odp/tdf105362.odp 
b/sd/qa/unit/data/odp/tdf105362.odp
new file mode 100644
index ..1f0a83e85d1f
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf105362.odp differ


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

2023-10-21 Thread Sarper Akdemir (via logerrit)
 sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx |binary
 sd/qa/unit/import-tests2.cxx|4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 676e0527d2f31556eccae314fbb12ce204f02ec7
Author: Sarper Akdemir 
AuthorDate: Fri Oct 20 12:03:25 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Sat Oct 21 22:58:39 2023 +0200

use Liberation Sans instead of Calibri in the test for tdf#144092

based on Stephan Bergmann's point on:


the font used in the test file was Calibri, which likely was
being replaced with the best approximation on a given system.
Changed that to Liberation Sans which is a font that is bundled
with LibreOffice to improve the test's robustness.

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

diff --git a/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx 
b/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx
index c597abf9a620..949a0561b25c 100644
Binary files a/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx and 
b/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 525177ba44da..0ca3513ae00c 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1771,10 +1771,10 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, 
testTdf144092TableHeight)
 uno::Reference xTableShape(getShapeFromPage(0, 0), 
uno::UNO_QUERY);
 
 // Without the accompanying fix in place, this test would have failed with:
-// - Expected: 7208
+// - Expected: 7606
 // - Actual  : 4595
 // i.e. the table height wasn't corrected by expanding less than minimum 
sized rows.
-CPPUNIT_ASSERT_EQUAL(sal_Int32(7208), xTableShape->getSize().Height);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(7606), xTableShape->getSize().Height);
 }
 
 CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf89928BlackWhiteThreshold)


[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

2023-10-20 Thread Miklos Vajna (via logerrit)
 sd/qa/unit/data/pptx/smartart-autofit-sync.pptx |binary
 1 file changed

New commits:
commit e64f3ab974e2f8c528fef8d75162b82ec0453293
Author: Miklos Vajna 
AuthorDate: Fri Oct 20 15:47:45 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Oct 20 20:20:59 2023 +0200

CppunitTest_sd_import_tests-smartart: make testAutofitSync more robust

- replace 'Calibri Light' with 'Noto Sans' (we bundle the later)
- replace 'Calibri' with 'Arial'

With this:

diff --git a/sd/CppunitTest_sd_import_tests-smartart.mk 
b/sd/CppunitTest_sd_import_tests-smartart.mk
index 9b7362b08152..72e0dead7731 100644
--- a/sd/CppunitTest_sd_import_tests-smartart.mk
+++ b/sd/CppunitTest_sd_import_tests-smartart.mk
@@ -11,4 +11,6 @@

 $(eval $(call sd_import_test,-smartart))

+$(eval $(call 
gb_CppunitTest_set_non_application_font_use,sd_import_tests-smartart,abort))
+
 # vim: set noet sw=4 ts=4:

doesn't abort anymore. In fact the second replacement is just for
completeness, the first was enough alredy.

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

diff --git a/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx 
b/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx
index 9a6ce0f494c5..e27dbbfd3de3 100644
Binary files a/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx and 
b/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx differ


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

2023-10-20 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b34132256c1e9ebbf0cc82a14f4da7335574a887
Author: Xisco Fauli 
AuthorDate: Fri Oct 20 10:28:50 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 20 12:26:01 2023 +0200

CppunitTest_sd_png_export_tests: relax test even more

I misread 
https://gerrit.libreoffice.org/c/core/+/158181/3#message-f54ed5a8dcf1d68fea73ace5ff9851d3d5fe5a2f

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 6c6d13a8a942..c141c0ddeeb0 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -296,9 +296,9 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf156808)
 }
 
 // Without the fix in place, this test would have failed with
-// - Expected greater than: 9300
+// - Expected greater than: 9000
 // - Actual  : 0
-CPPUNIT_ASSERT_GREATER(9300, nBlackCount);
+CPPUNIT_ASSERT_GREATER(9000, nBlackCount);
 }
 
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157636)


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

2023-10-20 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 498515b01aa026c2b39836f69d10b7016c89a66f
Author: Xisco Fauli 
AuthorDate: Thu Oct 19 15:36:14 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 20 10:21:14 2023 +0200

CppunitTest_sd_png_export_tests: relax test a bit

See https://gerrit.libreoffice.org/c/core/+/157763

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 8f012347644a..6c6d13a8a942 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -284,18 +284,21 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf156808)
 CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
 Bitmap aBMP = aBMPEx.GetBitmap();
 Bitmap::ScopedReadAccess pReadAccess(aBMP);
-for (tools::Long nX = 2; nX < aSize.Width() - 2; ++nX)
+int nBlackCount = 0;
+for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX)
 {
 for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
 {
 const Color aColor = pReadAccess->GetColor(nY, nX);
-
-// Without the fix in place, this test would have failed with
-// - Expected: rgba[00ff]
-// - Actual  : rgba[]
-CPPUNIT_ASSERT_EQUAL(COL_BLACK, aColor);
+if (aColor == COL_BLACK)
+++nBlackCount;
 }
 }
+
+// Without the fix in place, this test would have failed with
+// - Expected greater than: 9300
+// - Actual  : 0
+CPPUNIT_ASSERT_GREATER(9300, nBlackCount);
 }
 
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157636)


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

2023-10-12 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   51 ++
 sd/qa/unit/data/ppt/tdf157636.ppt |binary
 2 files changed, 51 insertions(+)

New commits:
commit e9374f74385d7dfe77d1902d3d82af20143bc775
Author: Xisco Fauli 
AuthorDate: Wed Oct 11 16:10:37 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 13 00:12:42 2023 +0200

tdf#157636: sd_png_export: Add unittest

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 04fbed439a41..8f012347644a 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -298,6 +298,57 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf156808)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157636)
+{
+loadFromURL(u"ppt/tdf157636.ppt");
+uno::Reference xContext = getComponentContext();
+CPPUNIT_ASSERT(xContext.is());
+uno::Reference xGraphicExporter
+= drawing::GraphicExportFilter::create(xContext);
+
+uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
+};
+
+uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+   uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xPage);
+xGraphicExporter->filter(aDescriptor);
+
+SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+vcl::PngImageReader aPNGReader(aFileStream);
+BitmapEx aBMPEx = aPNGReader.read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+Size aSize = aBMPEx.GetSizePixel();
+CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
+Bitmap aBMP = aBMPEx.GetBitmap();
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+int nBlackCount = 0;
+for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX)
+{
+for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+if (aColor == COL_BLACK)
+++nBlackCount;
+}
+}
+
+// Without the fix in place, this test would have failed with
+// - Expected greater than: 6600
+// - Actual  : 559
+CPPUNIT_ASSERT_GREATER(6600, nBlackCount);
+}
+
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157635)
 {
 loadFromURL(u"pptx/tdf157635.pptx");
diff --git a/sd/qa/unit/data/ppt/tdf157636.ppt 
b/sd/qa/unit/data/ppt/tdf157636.ppt
new file mode 100644
index ..1dcbbe6f00dc
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf157636.ppt differ


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

2023-10-11 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx   |   48 
 sd/qa/unit/data/pptx/tdf156808.pptx |binary
 2 files changed, 48 insertions(+)

New commits:
commit 40641b868b20c73e694770c2c7ea71e232514fa1
Author: Xisco Fauli 
AuthorDate: Tue Oct 10 16:33:25 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 11 11:39:00 2023 +0200

tdf#156808: sd_png_export: Add unittest

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 7c28b7d51654..04fbed439a41 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -250,6 +250,54 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157652)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf156808)
+{
+loadFromURL(u"pptx/tdf156808.pptx");
+uno::Reference xContext = getComponentContext();
+CPPUNIT_ASSERT(xContext.is());
+uno::Reference xGraphicExporter
+= drawing::GraphicExportFilter::create(xContext);
+
+uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
+};
+
+uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+   uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xPage);
+xGraphicExporter->filter(aDescriptor);
+
+SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+vcl::PngImageReader aPNGReader(aFileStream);
+BitmapEx aBMPEx = aPNGReader.read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+Size aSize = aBMPEx.GetSizePixel();
+CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
+Bitmap aBMP = aBMPEx.GetBitmap();
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+for (tools::Long nX = 2; nX < aSize.Width() - 2; ++nX)
+{
+for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+
+// Without the fix in place, this test would have failed with
+// - Expected: rgba[00ff]
+// - Actual  : rgba[]
+CPPUNIT_ASSERT_EQUAL(COL_BLACK, aColor);
+}
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157635)
 {
 loadFromURL(u"pptx/tdf157635.pptx");
diff --git a/sd/qa/unit/data/pptx/tdf156808.pptx 
b/sd/qa/unit/data/pptx/tdf156808.pptx
new file mode 100644
index ..34256151b60b
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf156808.pptx differ


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

2023-10-10 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   48 ++
 sd/qa/unit/data/odp/tdf157652.odp |binary
 2 files changed, 48 insertions(+)

New commits:
commit 0cd5b97acbb3419eb7f550e39a291691373bd878
Author: Xisco Fauli 
AuthorDate: Tue Oct 10 14:02:39 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Oct 10 21:35:50 2023 +0200

tdf#157502, tdf#157652: sd_png_export: Add unittest

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 58cd828b677b..7c28b7d51654 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -202,6 +202,54 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632)
 CPPUNIT_ASSERT(!pReadAccess);
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157652)
+{
+loadFromURL(u"odp/tdf157652.odp");
+uno::Reference xContext = getComponentContext();
+CPPUNIT_ASSERT(xContext.is());
+uno::Reference xGraphicExporter
+= drawing::GraphicExportFilter::create(xContext);
+
+uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
+};
+
+uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+   uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xPage);
+xGraphicExporter->filter(aDescriptor);
+
+SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+vcl::PngImageReader aPNGReader(aFileStream);
+BitmapEx aBMPEx = aPNGReader.read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+Size aSize = aBMPEx.GetSizePixel();
+CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
+Bitmap aBMP = aBMPEx.GetBitmap();
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX)
+{
+for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+
+// Without the fix in place, this test would have failed with
+// - Expected: rgba[]
+// - Actual  : rgba[ff953eff]
+CPPUNIT_ASSERT_EQUAL(COL_WHITE, aColor);
+}
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157635)
 {
 loadFromURL(u"pptx/tdf157635.pptx");
diff --git a/sd/qa/unit/data/odp/tdf157652.odp 
b/sd/qa/unit/data/odp/tdf157652.odp
new file mode 100644
index ..11fb34b0c38d
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf157652.odp differ


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

2023-10-09 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/PNGExportTests.cxx   |   51 
 sd/qa/unit/data/pptx/tdf157635.pptx |binary
 2 files changed, 51 insertions(+)

New commits:
commit 4e1aec7937c0ccd9aa3c5c34091e94786f16e145
Author: Xisco Fauli 
AuthorDate: Mon Oct 9 11:49:56 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 9 14:03:03 2023 +0200

tdf#49253, tdf#157635, tdf#157576: sd_png_export: Add unittest

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 58ec8d6077cc..58cd828b677b 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -202,6 +202,57 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632)
 CPPUNIT_ASSERT(!pReadAccess);
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157635)
+{
+loadFromURL(u"pptx/tdf157635.pptx");
+uno::Reference xContext = getComponentContext();
+CPPUNIT_ASSERT(xContext.is());
+uno::Reference xGraphicExporter
+= drawing::GraphicExportFilter::create(xContext);
+
+uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
+};
+
+uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+   uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xPage);
+xGraphicExporter->filter(aDescriptor);
+
+SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+vcl::PngImageReader aPNGReader(aFileStream);
+BitmapEx aBMPEx = aPNGReader.read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+Size aSize = aBMPEx.GetSizePixel();
+CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize);
+Bitmap aBMP = aBMPEx.GetBitmap();
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+int nBlackCount = 0;
+for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX)
+{
+for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+if (aColor == COL_BLACK)
+++nBlackCount;
+}
+}
+
+// Without the fix in place, this test would have failed with
+// - Expected greater than: 7100
+// - Actual  : 0
+CPPUNIT_ASSERT_GREATER(7100, nBlackCount);
+}
+
 CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113163)
 {
 loadFromURL(u"pptx/tdf113163.pptx");
diff --git a/sd/qa/unit/data/pptx/tdf157635.pptx 
b/sd/qa/unit/data/pptx/tdf157635.pptx
new file mode 100644
index ..8612f137174b
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf157635.pptx differ


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

2023-10-02 Thread Regina Henschel (via logerrit)
 sd/qa/unit/data/xml/shapes-test_page1.xml   |1 
 svx/CppunitTest_svx_unit.mk |1 
 svx/qa/unit/data/tdf157543_5PointStar.ppt   |binary
 svx/qa/unit/gluepointTest.cxx   |  110 
 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx |7 -
 5 files changed, 118 insertions(+), 1 deletion(-)

New commits:
commit dd7fc07f83416a3d8a444947b7d28f7347520d6a
Author: Regina Henschel 
AuthorDate: Sun Oct 1 14:47:09 2023 +0200
Commit: Regina Henschel 
CommitDate: Mon Oct 2 16:23:26 2023 +0200

tdf#157543 Add glue points to binary 5-point star

The patch adds the glue points defined in 'Microsoft Office Drawing
97-2007 Binary Format Specification' to our corresponding preset
'msoStar'.

This star shape is contained on page 1 in odp/shapes-test.odp. It had
previously no glue points, but now it has five glue points. Thus I have
updated the xml dump.

Import from pptx is still broken, tracked in tdf#157216.

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

diff --git a/sd/qa/unit/data/xml/shapes-test_page1.xml 
b/sd/qa/unit/data/xml/shapes-test_page1.xml
index b5d97b55888a..344342bc4ac4 100644
--- a/sd/qa/unit/data/xml/shapes-test_page1.xml
+++ b/sd/qa/unit/data/xml/shapes-test_page1.xml
@@ -314,6 +314,7 @@

   
  
+ 
 


diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk
index a46aa5b0d583..95c76b2d0733 100644
--- a/svx/CppunitTest_svx_unit.mk
+++ b/svx/CppunitTest_svx_unit.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \
svx/qa/unit/svdraw/test_SdrTextObject \
svx/qa/unit/customshapes \
 svx/qa/unit/classicshapes \
+svx/qa/unit/gluepointTest \
svx/qa/unit/sdr \
svx/qa/unit/svdraw \
svx/qa/unit/table \
diff --git a/svx/qa/unit/data/tdf157543_5PointStar.ppt 
b/svx/qa/unit/data/tdf157543_5PointStar.ppt
new file mode 100644
index ..f39b24e06599
Binary files /dev/null and b/svx/qa/unit/data/tdf157543_5PointStar.ppt differ
diff --git a/svx/qa/unit/gluepointTest.cxx b/svx/qa/unit/gluepointTest.cxx
new file mode 100644
index ..647f555b8095
--- /dev/null
+++ b/svx/qa/unit/gluepointTest.cxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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/.
+ */
+
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+using namespace ::com::sun::star;
+
+namespace
+{
+/// Tests related to glue points defined in the custom shape geometry.
+class GluePointTest : public UnoApiTest
+{
+public:
+GluePointTest()
+: UnoApiTest("svx/qa/unit/data/")
+{
+}
+
+protected:
+// get shape nShapeIndex from page 0
+uno::Reference getShape(sal_uInt8 nShapeIndex);
+};
+
+uno::Reference GluePointTest::getShape(sal_uInt8 nShapeIndex)
+{
+uno::Reference xDrawPagesSupplier(mxComponent,
+   
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_MESSAGE("Could not get XDrawPagesSupplier", 
xDrawPagesSupplier.is());
+uno::Reference 
xDrawPages(xDrawPagesSupplier->getDrawPages());
+uno::Reference xDrawPage(xDrawPages->getByIndex(0), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_MESSAGE("Could not get xDrawPage", xDrawPage.is());
+uno::Reference xShape(xDrawPage->getByIndex(nShapeIndex), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_MESSAGE("Could not get xShape", xShape.is());
+return xShape;
+}
+
+// Glue points from custom shape geometry. Values are relative to viewBox.
+// Usable if values are constant and not calculated by formula.
+bool lcl_getGeometryGluePoints(
+uno::Sequence& rGluePoints,
+const uno::Reference& xShape)
+{
+uno::Reference xShapeProps(xShape, 
uno::UNO_QUERY_THROW);
+uno::Any anotherAny = xShapeProps->getPropertyValue("CustomShapeGeometry");
+uno::Sequence aCustomShapeGeometry;
+if (!(anotherAny >>= aCustomShapeGeometry))
+return false;
+uno::Sequence aPathProps;
+for (beans::PropertyValue const& rProp : 
std::as_const(aCustomShapeGeometry))
+{
+if (rProp.Name == "Path")
+{
+rProp.Value >>= aPathProps;
+break;
+}
+}
+
+for (beans::PropertyValue const& rProp : std::as_const(aPathProps))
+{
+if (rProp.Name == "GluePoints")
+{
+rProp.Value >>= rGluePoints;
+break;
+}
+}
+if (rGluePoints.getLength() > 0)
+

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

2023-09-01 Thread Noel Grandin (via logerrit)
 sd/qa/unit/data/xml/fdo64586_0.xml |4 -
 sd/qa/unit/data/xml/n758621_0.xml  |4 -
 sd/qa/unit/data/xml/n758621_1.xml  |4 -
 sd/qa/unit/data/xml/n819614_0.xml  |2 
 vcl/source/gdi/impgraph.cxx|   79 +
 5 files changed, 44 insertions(+), 49 deletions(-)

New commits:
commit 6d8c6e8d60956fd36094035a526c1a29a902204b
Author: Noel Grandin 
AuthorDate: Wed Aug 30 21:47:41 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 1 09:54:21 2023 +0200

fix ImpGraphic::operator==

This was broken in
commit 7b355669c6ddeab2e6cec692d6afdff41c61d0fb
Author: Tomaž Vajngerl 
Date:   Sat Apr 14 15:13:05 2018 +0900
Function to load graphic swapped out (loaded on demand)

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

diff --git a/sd/qa/unit/data/xml/fdo64586_0.xml 
b/sd/qa/unit/data/xml/fdo64586_0.xml
index d8ae745787aa..cdabdd2119ad 100644
--- a/sd/qa/unit/data/xml/fdo64586_0.xml
+++ b/sd/qa/unit/data/xml/fdo64586_0.xml
@@ -4,7 +4,7 @@
   
   
   
-  
+  
   
   
   
@@ -18,7 +18,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/sd/qa/unit/data/xml/n758621_0.xml 
b/sd/qa/unit/data/xml/n758621_0.xml
index aba12ebe685f..3284a1da87f9 100644
--- a/sd/qa/unit/data/xml/n758621_0.xml
+++ b/sd/qa/unit/data/xml/n758621_0.xml
@@ -4,7 +4,7 @@
   
   
   
-  
+  
   
   
   
@@ -18,7 +18,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/sd/qa/unit/data/xml/n758621_1.xml 
b/sd/qa/unit/data/xml/n758621_1.xml
index 556c18673065..5d24431bed58 100644
--- a/sd/qa/unit/data/xml/n758621_1.xml
+++ b/sd/qa/unit/data/xml/n758621_1.xml
@@ -4,7 +4,7 @@
   
   
   
-  
+  
   
   
   
@@ -18,7 +18,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/sd/qa/unit/data/xml/n819614_0.xml 
b/sd/qa/unit/data/xml/n819614_0.xml
index 3635f2d26d3e..c889b00c343a 100644
--- a/sd/qa/unit/data/xml/n819614_0.xml
+++ b/sd/qa/unit/data/xml/n819614_0.xml
@@ -4,7 +4,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 41f921228d34..35a2145aa8e4 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -283,61 +283,56 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& 
rImpGraphic)
 return *this;
 }
 
-bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
+bool ImpGraphic::operator==( const ImpGraphic& rOther ) const
 {
-bool bRet = false;
+if( this ==  )
+return true;
 
-if( this ==  )
-bRet = true;
-else if (mbPrepared && rImpGraphic.mbPrepared)
-{
-bRet = (*mpGfxLink == *rImpGraphic.mpGfxLink);
-}
-else if (isAvailable() && rImpGraphic.isAvailable())
+if (mbPrepared && rOther.mbPrepared)
+return (*mpGfxLink == *rOther.mpGfxLink);
+
+if (!isAvailable() || !rOther.isAvailable())
+return false;
+
+if ( meType != rOther.meType )
+return false;
+
+bool bRet = false;
+switch( meType )
 {
-switch( meType )
-{
-case GraphicType::NONE:
-bRet = true;
-break;
+case GraphicType::NONE:
+case GraphicType::Default:
+return true;
 
-case GraphicType::GdiMetafile:
-{
-if( rImpGraphic.maMetaFile == maMetaFile )
-bRet = true;
-}
-break;
+case GraphicType::GdiMetafile:
+return ( rOther.maMetaFile == maMetaFile );
 
-case GraphicType::Bitmap:
+case GraphicType::Bitmap:
+{
+if(maVectorGraphicData)
 {
-if(maVectorGraphicData)
+if(maVectorGraphicData == rOther.maVectorGraphicData)
 {
-if(maVectorGraphicData == rImpGraphic.maVectorGraphicData)
-{
-// equal instances
-bRet = true;
-}
-else if(rImpGraphic.maVectorGraphicData)
-{
-// equal content
-bRet = (*maVectorGraphicData) == 
(*rImpGraphic.maVectorGraphicData);
-}
+// equal instances
+bRet = true;
 }
-else if( mpAnimation )
+else if(rOther.maVectorGraphicData)
 {
-if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation 
== *mpAnimation ) )
-bRet = true;
+// equal content
+bRet = (*maVectorGraphicData) == 
(*rOther.maVectorGraphicData);
 }
-else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maBitmapEx 
== maBitmapEx ) )
-{
+}
+else if( mpAnimation )
+  

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

2023-08-30 Thread Tibor Nagy (via logerrit)
 sd/qa/unit/data/pptx/tdf152070.pptx |binary
 1 file changed

New commits:
commit f4c2ad6cc750a850dd32e5ae3aceb184ccc54fb5
Author: Tibor Nagy 
AuthorDate: Mon Aug 28 14:19:22 2023 +0200
Commit: László Németh 
CommitDate: Wed Aug 30 12:14:25 2023 +0200

Follow-up to tdf#152070 sd: fix unit test of tile background

The test always failed if the output device DPI value is
higher than 96, because of its PNG image without pHYs (physical
pixel dimensions), so the size depended on the output device DPI
and therefore offset value of image changes. Fixed with extending
the PNG image with pHYs metadata.

Follow-up to commit b12e38c1ccb388e62e35d856d4a575e1724a10e9
"tdf#152070 PPTX import: fix offset of tile background image".

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

diff --git a/sd/qa/unit/data/pptx/tdf152070.pptx 
b/sd/qa/unit/data/pptx/tdf152070.pptx
index 1fbc8016d149..c98116c1873e 100644
Binary files a/sd/qa/unit/data/pptx/tdf152070.pptx and 
b/sd/qa/unit/data/pptx/tdf152070.pptx differ


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

2023-07-19 Thread Andreas Heinisch (via logerrit)
 sd/qa/unit/uiimpress.cxx |   20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

New commits:
commit fd361874d5c4da99dec763dfdc9c4dd21dfe34a6
Author: Andreas Heinisch 
AuthorDate: Mon Jul 17 10:57:56 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Wed Jul 19 10:12:41 2023 +0200

tdf#130581 - Improve unit test of undo command for hide/show slides

The test has the following structure:

1. The first slide will be selected and set to hidden
2. Then, the test checks if the slide is hidden and
if there is the undo command for hiding the slide

3. Second, hiding the slide will be undone
4. Again, the test checks if the slide is visible and
if there is the redo command for hiding the slide

Finally, the same actions will be tested using the show slide command
where the tests checks for two undo actions, i.e., show and hide slide.

Change-Id: I8e9c4905f4ebbb45d872f5e6ca76179dbfae3a31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154464
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 3a1c2ad911aa..acc3fabe5494 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -493,7 +493,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf100950)
 CPPUNIT_ASSERT(rPageSelector.IsPageSelected(2));
 }
 
-CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581)
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581_undo_hide_show_slide)
 {
 createSdImpressDoc();
 
@@ -505,9 +505,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581)
 auto pXImpressDocument = 
dynamic_cast(mxComponent.get());
 SdDrawDocument* pDocument = pXImpressDocument->GetDoc();
 sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
-// Without the fix in place, this test would have failed with
-// - Expected: 1
-// - Actual  : 0
+// Check if there is the correct undo action, i.e., hide slide
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetUndoActionCount());
 CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), 
pUndoManager->GetUndoActionComment());
 sd::slidesorter::SlideSorterViewShell* pSSVS = getSlideSorterViewShell();
@@ -518,10 +516,8 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581)
 CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0));
 
 // Undo hide slide action and check the number of available redo actions
+// including the correct undo action, i.e., hide slide
 dispatchCommand(mxComponent, ".uno:Undo", {});
-// Without the fix in place, this test would have failed with
-// - Expected: 1
-// - Actual  : 0
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetRedoActionCount());
 CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), 
pUndoManager->GetRedoActionComment());
 CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0));
@@ -530,18 +526,14 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581)
 dispatchCommand(mxComponent, ".uno:Redo", {});
 CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0));
 dispatchCommand(mxComponent, ".uno:ShowSlide", {});
-// Without the fix in place, this test would have failed with
-// - Expected: 2
-// - Actual  : 0
+// There should be two undo actions, i.e., show and hide slide
 CPPUNIT_ASSERT_EQUAL(static_cast(2), 
pUndoManager->GetUndoActionCount());
 CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_SHOW_SLIDE), 
pUndoManager->GetUndoActionComment());
 CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0));
 
-// Undo show slide action and check the number of available undo/redo 
actions
+// Undo show slide and check the number of available undo/redo actions
 dispatchCommand(mxComponent, ".uno:Undo", {});
-// Without the fix in place, this test would have failed with
-// - Expected: 1
-// - Actual  : 0
+// There should be one undo action, i.e., hide slide, and one redo action, 
i.e., show slide
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetUndoActionCount());
 CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), 
pUndoManager->GetUndoActionComment());
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetRedoActionCount());


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

2023-06-20 Thread Tibor Nagy (via logerrit)
 sd/qa/uitest/data/tdf155863.odp |binary
 sd/qa/uitest/impress_tests/tdf155863.py |   34 
 svx/source/svdraw/svdograf.cxx  |   24 ++
 3 files changed, 45 insertions(+), 13 deletions(-)

New commits:
commit a4e12cbfc69cfe668fa30756a3c5843e911e22b1
Author: Tibor Nagy 
AuthorDate: Fri Jun 16 09:34:29 2023 +0200
Commit: László Németh 
CommitDate: Tue Jun 20 18:31:41 2023 +0200

tdf#155863 sd: fix resizing of cropped images to original size

Resizing with the function "Original Size" (e.g. in the context menu) 
resulted distortion in case of cropped images, if the original image
and its cropping have different aspect ratios. Now zoom the cropped
image to the original resolution instead of stretching it to the
same size.

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

diff --git a/sd/qa/uitest/data/tdf155863.odp b/sd/qa/uitest/data/tdf155863.odp
new file mode 100644
index ..2ae286c05d31
Binary files /dev/null and b/sd/qa/uitest/data/tdf155863.odp differ
diff --git a/sd/qa/uitest/impress_tests/tdf155863.py 
b/sd/qa/uitest/impress_tests/tdf155863.py
new file mode 100644
index ..bce8936a3d40
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/tdf155863.py
@@ -0,0 +1,34 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class tdf155863(UITestCase):
+def test_tdf155863(self):
+# This document contains an image with an original size of 7.99cm x 
5.74cm.
+# The image has been cropped 0.8cm on the left, 3.59cm on the right, 
0.99cm at the top,
+# and 0.75cm at the bottom.
+# Also, it has been resized to a width of 2.1cm and a height of 2.33cm.
+with self.ui_test.load_file(get_url_for_data_file("tdf155863.odp")) as 
document:
+xImpressDoc = self.xUITest.getTopFocusWindow()
+xEditWin = xImpressDoc.getChild("impress_win")
+
+# select the image on the first slide
+xEditWin.executeAction("SELECT", 
mkPropertyValues({"OBJECT":"Image"}))
+
+# click "Original Size"
+self.xUITest.executeCommand(".uno:OriginalSize")
+
+# tdf#155863: Without the fix in place, the image will be 
distorted due to the wrong size.
+self.assertEqual(3597, 
document.DrawPages[0].getByIndex(0).Size.Width)
+self.assertEqual(3998, 
document.DrawPages[0].getByIndex(0).Size.Height)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index cdb1b0e8301c..b36daff54745 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -476,23 +476,21 @@ Size SdrGrafObj::getOriginalSize() const
 {
 Size aSize = GetGrafPrefSize();
 
-if (aGrafInfo.IsCropped())
-{
-const tools::Long 
aCroppedTop(OutputDevice::LogicToLogic(aGrafInfo.GetTopCrop(), 
getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()));
-const tools::Long 
aCroppedBottom(OutputDevice::LogicToLogic(aGrafInfo.GetBottomCrop(), 
getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()));
-const tools::Long 
aCroppedLeft(OutputDevice::LogicToLogic(aGrafInfo.GetLeftCrop(), 
getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()));
-const tools::Long 
aCroppedRight(OutputDevice::LogicToLogic(aGrafInfo.GetRightCrop(), 
getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()));
-const tools::Long aCroppedWidth(aSize.getWidth() - aCroppedLeft + 
aCroppedRight);
-const tools::Long aCroppedHeight(aSize.getHeight() - aCroppedTop + 
aCroppedBottom);
-
-aSize = Size ( aCroppedWidth, aCroppedHeight);
-}
-
-if ( GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
+if (GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
 aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, 
MapMode(getSdrModelFromSdrObject().GetScaleUnit()));
 else
 aSize = OutputDevice::LogicToLogic(aSize, GetGrafPrefMapMode(), 
MapMode(getSdrModelFromSdrObject().GetScaleUnit()));
 
+if (aGrafInfo.IsCropped())
+{
+const tools::Long aCroppedWidth(aSize.getWidth() - 
aGrafInfo.GetLeftCrop()
+- aGrafInfo.GetRightCrop());
+const tools::Long 

[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: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

2023-05-17 Thread Xisco Fauli (via logerrit)
 dev/null |binary
 1 file changed

New commits:
commit 4d030ec4a63c63eeb4fa958ffa377785478cf078
Author: Xisco Fauli 
AuthorDate: Wed May 17 21:00:11 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu May 18 00:04:11 2023 +0200

sd: remove unused document

Added in 2704821c6b6e829b5ef5c32cdc8eb2a03b6114a9
"smartart : test documents" without any code using it

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

diff --git a/sd/qa/unit/data/pptx/smartart-pyramid.pptx 
b/sd/qa/unit/data/pptx/smartart-pyramid.pptx
deleted file mode 100644
index 7c2296f9db9e..
Binary files a/sd/qa/unit/data/pptx/smartart-pyramid.pptx and /dev/null differ


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

2023-05-12 Thread Patrick Luby (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 976cd8c1c146d6a733a53ac6a55aad84b9bbd406
Author: Patrick Luby 
AuthorDate: Fri May 12 09:11:13 2023 -0400
Commit: Patrick Luby 
CommitDate: Fri May 12 19:28:11 2023 +0200

Disable test that always fails with Apple Retina displays

With a HiDPI display on macOS, each logical pixel is backed
by 4 physical pixels. Turning off antialiasing and drawing a
diagonal line causes many logical pixels on the edge of the
diagonal line to have a mixture of white and blue physical
pixels. Then, when such logical pixels are fetched via
BitmapEx::GetPixelColor(), their underlying 4 white and blue
physical pixels are combined into blended shades of white
and blue.

Change-Id: I1aca121f294ce2f4cb7b17a93b904425c8049f80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151705
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index b3863c8b9622..5ca65f545dc2 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -474,6 +474,17 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf155048)
 
 // 1. AA disabled
 {
+#ifdef MACOSX
+// Disable test that always fails with Apple Retina displays
+// With a HiDPI display on macOS, each logical pixel is backed
+// by 4 physical pixels. Turning off antialiasing and drawing a
+// diagonal line causes many logical pixels on the edge of the
+// diagonal line to have a mixture of white and blue physical
+// pixels. Then, when such logical pixels are fetched via
+// BitmapEx::GetPixelColor(), their underlying 4 white and blue
+// physical pixels are combined into blended shades of white
+// and blue.
+#else
 css::uno::Sequence aFilterData{
 comphelper::makePropertyValue("PixelWidth", sal_Int32(200)),
 comphelper::makePropertyValue("PixelHeight", sal_Int32(200)),
@@ -497,6 +508,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf155048)
 // There must be only two colors (white and blue) in the bitmap 
generated without AA
 CPPUNIT_ASSERT_EQUAL(size_t(2), foundColors.size());
 maTempFile.CloseStream();
+#endif
 }
 
 // 2. AA enabled


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

2023-05-12 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/TextFittingTest.cxx |   45 ++---
 1 file changed, 7 insertions(+), 38 deletions(-)

New commits:
commit d23ec642e9eecd792da7a39b7871b384b9256e91
Author: Tomaž Vajngerl 
AuthorDate: Tue May 9 21:51:05 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri May 12 11:03:16 2023 +0200

sd: remove unneeded includes in TextFittingTest

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

diff --git a/sd/qa/unit/TextFittingTest.cxx b/sd/qa/unit/TextFittingTest.cxx
index 5cbe8a6b9c69..588d3f0ddd54 100644
--- a/sd/qa/unit/TextFittingTest.cxx
+++ b/sd/qa/unit/TextFittingTest.cxx
@@ -7,51 +7,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
-
 #include "sdmodeltestbase.hxx"
 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+
+#include 
 #include 
+#include 
+#include 
 
 using namespace css;
 


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

2023-05-03 Thread Andrea Gelmini (via logerrit)
 sd/qa/unit/export-tests-ooxml1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cfe49a23bc3ac79117a120d0f661f98e384798e2
Author: Andrea Gelmini 
AuthorDate: Wed May 3 19:55:28 2023 +0200
Commit: Julien Nabet 
CommitDate: Wed May 3 21:43:00 2023 +0200

Fix typo

Change-Id: Iaf3db11f667f46a421726fee10ace21581fc3853
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151337
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index b9f1fb7a9412..703eac601174 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -1222,7 +1222,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf94238)
 // - aGradient.Border was 0
 CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_RADIAL, aGradient.Style);
 CPPUNIT_ASSERT_EQUAL(static_cast(100), aGradient.YOffset);
-// MCGR: 39->0 no border needed anyore with ooxml import
+// MCGR: 39->0 no border needed anymore with ooxml import
 CPPUNIT_ASSERT_EQUAL(static_cast(0), aGradient.Border);
 
 // MCGR: Use the completely imported gradient to check for correctness


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

2023-04-27 Thread Mike Kaganski (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   66 ++
 sd/qa/unit/data/odg/diagonalLine.fodg |   39 +++
 svtools/source/config/optionsdrawinglayer.cxx |   13 ++---
 3 files changed, 112 insertions(+), 6 deletions(-)

New commits:
commit 1b85a555d3ee618b542dce414687c97f934b8b56
Author: Mike Kaganski 
AuthorDate: Thu Apr 27 17:10:06 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Apr 28 06:45:26 2023 +0200

tdf#155048: forward AntiAliasing to drawinglayer also in temporary case

Commit 444bf8710d5da7b584fbcb94693e4ed8d2e29297 (Update handling of
AntiAliasing settings and processor2d, 2022-11-08) made respective
changes so that SvtOptionsDrawinglayer::SetAntiAliasing forwards the
setting to drawinglayer. However, it only happened in non-temporary
case, which is fixed now.

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index dcbe54054bd6..b3863c8b9622 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -461,4 +461,70 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf99729)
  nonwhitecounts[1]);
 }
 
+CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf155048)
+{
+loadFromURL(u"odg/diagonalLine.fodg");
+
+auto xGraphicExporter = 
drawing::GraphicExportFilter::create(getComponentContext());
+CPPUNIT_ASSERT(xGraphicExporter);
+
+auto xSupplier = 
mxComponent.queryThrow();
+auto xPage = 
xSupplier->getDrawPages()->getByIndex(0).queryThrow();
+xGraphicExporter->setSourceDocument(xPage);
+
+// 1. AA disabled
+{
+css::uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(200)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(200)),
+comphelper::makePropertyValue("AntiAliasing", false),
+};
+
+css::uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+xGraphicExporter->filter(aDescriptor);
+
+BitmapEx bmp = 
vcl::PngImageReader(*maTempFile.GetStream(StreamMode::READ)).read();
+std::set foundColors;
+for (tools::Long x = 0; x < bmp.GetSizePixel().Width(); ++x)
+for (tools::Long y = 0; y < bmp.GetSizePixel().Height(); ++y)
+foundColors.insert(bmp.GetPixelColor(x, y));
+
+// There must be only two colors (white and blue) in the bitmap 
generated without AA
+CPPUNIT_ASSERT_EQUAL(size_t(2), foundColors.size());
+maTempFile.CloseStream();
+}
+
+// 2. AA enabled
+{
+css::uno::Sequence aFilterData{
+comphelper::makePropertyValue("PixelWidth", sal_Int32(200)),
+comphelper::makePropertyValue("PixelHeight", sal_Int32(200)),
+comphelper::makePropertyValue("AntiAliasing", true),
+};
+
+css::uno::Sequence aDescriptor{
+comphelper::makePropertyValue("URL", maTempFile.GetURL()),
+comphelper::makePropertyValue("FilterName", OUString("PNG")),
+comphelper::makePropertyValue("FilterData", aFilterData)
+};
+
+xGraphicExporter->filter(aDescriptor);
+
+BitmapEx bmp = 
vcl::PngImageReader(*maTempFile.GetStream(StreamMode::READ)).read();
+std::set foundColors;
+for (tools::Long x = 0; x < bmp.GetSizePixel().Width(); ++x)
+for (tools::Long y = 0; y < bmp.GetSizePixel().Height(); ++y)
+foundColors.insert(bmp.GetPixelColor(x, y));
+
+// With AA, the number of colors will be greater - it is 19 on my 
system
+CPPUNIT_ASSERT_GREATER(size_t(2), foundColors.size());
+maTempFile.CloseStream();
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/qa/unit/data/odg/diagonalLine.fodg 
b/sd/qa/unit/data/odg/diagonalLine.fodg
new file mode 100644
index ..f6f8edec46bc
--- /dev/null
+++ b/sd/qa/unit/data/odg/diagonalLine.fodg
@@ -0,0 +1,39 @@
+
+
+
+ 
+  
+  
+   
+  
+ 
+ 
+  
+   
+  
+  
+   
+  
+  
+  
+   
+  
+ 
+ 
+  
+   
+   
+   
+   
+   
+  
+  
+ 
+ 
+  
+   
+
+   
+  
+ 
+
\ No newline at end of file
diff --git a/svtools/source/config/optionsdrawinglayer.cxx 
b/svtools/source/config/optionsdrawinglayer.cxx
index 2fee81139800..0564adffa94c 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -183,14 +183,15 @@ void SetAntiAliasing( bool bOn, bool bTemporary )
 comphelper::ConfigurationChanges::create();
 officecfg::Office::Common::Drawinglayer::AntiAliasing::set(bOn, batch);
 

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

2023-04-18 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/data/odp/tdf154754.odp |binary
 sd/qa/unit/export-tests.cxx   |8 
 2 files changed, 8 insertions(+)

New commits:
commit 128c64fd110254577d31c5bd053aa98d8c0676ed
Author: Xisco Fauli 
AuthorDate: Mon Apr 17 14:04:40 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Apr 18 11:09:40 2023 +0200

tdf#154754: sd_export_tests: Add unittest

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

diff --git a/sd/qa/unit/data/odp/tdf154754.odp 
b/sd/qa/unit/data/odp/tdf154754.odp
new file mode 100644
index ..9aa412de8509
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf154754.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 37be550e3b40..4be14483aad4 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1468,6 +1468,14 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf152606)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
 }
 
+CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf154754)
+{
+//Without the fix in place, it would crash at export time
+skipValidation();
+createSdImpressDoc("odp/tdf154754.odp");
+saveAndReload("impress8");
+}
+
 CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf91060)
 {
 //Without the fix in place, it would crash at import time


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

2023-03-22 Thread Stephan Bergmann (via logerrit)
 sd/qa/unit/export-tests.cxx |  190 +---
 1 file changed, 129 insertions(+), 61 deletions(-)

New commits:
commit d54e5915da0778a0087f8b40c92d15d3c21f3de6
Author: Stephan Bergmann 
AuthorDate: Tue Mar 21 14:14:23 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Mar 22 09:53:45 2023 +

Demultiplex test code

It is so much easier to work with if a test failure's line number 
unambiguously
points at the code's sole execution.  (That is, test code is necessarily 
non-
DRY.)

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index fbf371895338..37be550e3b40 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1093,89 +1093,157 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf115394PPT)
 CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
 }
 
-CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImage)
+CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImageImpress8)
 {
-std::vector vFormat{ "impress8", "Impress Office Open XML", "MS 
PowerPoint 97" };
-for (size_t i = 0; i < vFormat.size(); i++)
-{
-OUString sExportFormat = vFormat[i];
-createSdImpressDoc("odp/BulletsAsImage.odp");
-const OString sFailedMessageBase = "Failed on filter " + 
sExportFormat.toUtf8();
-saveAndReload(sExportFormat);
+createSdImpressDoc("odp/BulletsAsImage.odp");
+saveAndReload("impress8");
 
-uno::Reference xShape(getShapeFromPage(0, 0));
-uno::Reference const 
xParagraph(getParagraphFromShape(0, xShape));
-uno::Reference xPropSet(xParagraph, 
uno::UNO_QUERY_THROW);
+uno::Reference xShape(getShapeFromPage(0, 0));
+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 
xLevels(xPropSet->getPropertyValue("NumberingRules"),
+uno::UNO_QUERY_THROW);
+uno::Sequence aProperties;
+xLevels->getByIndex(0) >>= aProperties; // 1st level
 
-uno::Reference xBitmap;
-awt::Size aSize;
-sal_Int16 nNumberingType = -1;
+uno::Reference xBitmap;
+awt::Size aSize;
+sal_Int16 nNumberingType = -1;
 
-for (beans::PropertyValue const& rProperty : 
std::as_const(aProperties))
+for (beans::PropertyValue const& rProperty : std::as_const(aProperties))
+{
+if (rProperty.Name == "NumberingType")
+{
+nNumberingType = rProperty.Value.get();
+}
+else if (rProperty.Name == "GraphicBitmap")
+{
+xBitmap = rProperty.Value.get>();
+}
+else if (rProperty.Name == "GraphicSize")
 {
-if (rProperty.Name == "NumberingType")
-{
-nNumberingType = rProperty.Value.get();
-}
-else if (rProperty.Name == "GraphicBitmap")
-{
-xBitmap = rProperty.Value.get>();
-}
-else if (rProperty.Name == "GraphicSize")
-{
-aSize = rProperty.Value.get();
-}
+aSize = rProperty.Value.get();
 }
+}
+
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::BITMAP, nNumberingType);
+
+// Graphic Bitmap
+CPPUNIT_ASSERT_MESSAGE("No bitmap for the bullets", xBitmap.is());
+Graphic aGraphic(uno::Reference(xBitmap, 
uno::UNO_QUERY));
+CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType());
+CPPUNIT_ASSERT(aGraphic.GetSizeBytes() > o3tl::make_unsigned(0));
+
+CPPUNIT_ASSERT_EQUAL(tools::Long(16), aGraphic.GetSizePixel().Width());
+CPPUNIT_ASSERT_EQUAL(tools::Long(16), aGraphic.GetSizePixel().Height());
+
+// Graphic Size
+CPPUNIT_ASSERT_EQUAL(sal_Int32(500), aSize.Width);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(500), aSize.Height);
+}
+
+CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImageImpressOfficeOpenXml)
+{
+createSdImpressDoc("odp/BulletsAsImage.odp");
+saveAndReload("Impress Office Open XML");
+
+uno::Reference xShape(getShapeFromPage(0, 0));
+uno::Reference const xParagraph(getParagraphFromShape(0, 
xShape));
+uno::Reference xPropSet(xParagraph, 
uno::UNO_QUERY_THROW);
 
-CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessageBase.getStr(), 
style::NumberingType::BITMAP,
- nNumberingType);
+uno::Reference 
xLevels(xPropSet->getPropertyValue("NumberingRules"),
+uno::UNO_QUERY_THROW);
+uno::Sequence 

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

2023-03-15 Thread Stephan Bergmann (via logerrit)
 sd/qa/unit/import-tests2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 633b9aebf8ac50f5e46e70f9f371fe7b936e0e1d
Author: Stephan Bergmann 
AuthorDate: Tue Mar 14 22:31:33 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Mar 15 07:59:50 2023 +

Silence a false -Werror=maybe-uninitialized

...seen at least with gcc-c++-13.0.1-0.7.fc38.x86_64,

> In file included from include/test/bootstrapfixture.hxx:20,
>  from include/test/unoapi_test.hxx:18,
>  from include/test/unoapixml_test.hxx:15,
>  from sd/qa/unit/sdmodeltestbase.hxx:15,
>  from sd/qa/unit/import-tests2.cxx:12:
> sd/qa/unit/import-tests2.cxx: In member function ‘void 
testTdf152186::TestBody()’:
> workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:274:33: 
error: ‘bHasShadow’ may be used uninitialized [-Werror=maybe-uninitialized]
>   274 |   ( CPPUNIT_NS::Asserter::failIf( !(condition),   
\
>   |   
~~^~~
>   275 |  CPPUNIT_NS::Message( "assertion 
failed", \
>   |  
~~
>   276 |   
"Expression: " #condition), \
>   |   
~
>   277 |  CPPUNIT_SOURCELINE() ) )
>   |  
> sd/qa/unit/import-tests2.cxx:86:9: note: in expansion of macro 
‘CPPUNIT_ASSERT’
>86 | CPPUNIT_ASSERT(!bHasShadow);
>   | ^~
> sd/qa/unit/import-tests2.cxx:80:10: note: ‘bHasShadow’ was declared here
>80 | bool bHasShadow;
>   |  ^~

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

diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index ceeb2603bf35..37a185c4d3f8 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -77,7 +77,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf152186)
 createSdImpressDoc("pptx/tdf152186.pptx");
 saveAndReload("Impress MS PowerPoint 2007 XML");
 
-bool bHasShadow;
+bool bHasShadow = bool();
 const SdrPage* pPage = GetPage(1);
 for (size_t i = 0; i < pPage->GetObjCount(); ++i)
 {


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

2023-03-06 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/tiledrendering/tiledrendering.cxx |  236 ++-
 1 file changed, 58 insertions(+), 178 deletions(-)

New commits:
commit a78d1b359966a2ab829fe13eaac7821894a96d91
Author: Xisco Fauli 
AuthorDate: Mon Mar 6 12:31:09 2023 +0100
Commit: Xisco Fauli 
CommitDate: Mon Mar 6 14:20:41 2023 +

CppunitTest_sd_tiledrendering: use CPPUNIT_TEST_FIXTURE()

This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index f8ca37932edd..12d7159e9faa 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -72,125 +72,7 @@ public:
 virtual void setUp() override;
 virtual void tearDown() override;
 
-void testCreateDestroy();
-void testCreateView();
-void testRegisterCallback();
-void testPostKeyEvent();
-void testPostMouseEvent();
-void testSetTextSelection();
-void testGetTextSelection();
-void testSetGraphicSelection();
-void testUndoShells();
-void testResetSelection();
-void testInsertDeletePage();
-void testInsertTable();
-void testPartHash();
-void testResizeTable();
-void testResizeTableColumn();
-void testViewCursors();
-void testViewCursorParts();
-void testCursorViews();
-void testCursorVisibility_SingleClick();
-void testCursorVisibility_DoubleClick();
-void testCursorVisibility_MultiView();
-void testCursorVisibility_Escape();
-void testViewLock();
-void testUndoLimiting();
-void testCreateViewGraphicSelection();
-void testCreateViewTextCursor();
-void testTdf102223();
-void testTdf118354();
-void testPostKeyEventInvalidation();
-void testTdf103083();
-void testTdf104405();
-void testTdf81754();
-void testTdf105502();
-void testCommentCallbacks();
-void testCommentChangeImpress();
-void testCommentChangeDraw();
-void testMultiViewInsertDeletePage();
-void testMultiViewInsertDeletePage2();
-void testDisableUndoRepair();
-void testDocumentRepair();
-void testLanguageStatus();
-void testDefaultView();
-void testIMESupport();
-void testTdf115783();
-void testPasteTextOnSlide();
-void testTdf115873();
-void testTdf115873Group();
-void testCutSelectionChange();
-void testRegenerateDiagram();
-void testLanguageAllText();
-void testInsertDeletePageInvalidation();
-void testSpellOnlineRenderParameter();
-void testSlideDuplicateUndo();
-void testMoveShapeHandle();
-void testDeleteTable();
-void testPasteUndo();
-void testShapeEditInMultipleViews();
-
-CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
-CPPUNIT_TEST(testCreateDestroy);
-CPPUNIT_TEST(testCreateView);
-CPPUNIT_TEST(testRegisterCallback);
-CPPUNIT_TEST(testPostKeyEvent);
-CPPUNIT_TEST(testPostMouseEvent);
-CPPUNIT_TEST(testSetTextSelection);
-CPPUNIT_TEST(testGetTextSelection);
-CPPUNIT_TEST(testSetGraphicSelection);
-CPPUNIT_TEST(testUndoShells);
-CPPUNIT_TEST(testResetSelection);
-CPPUNIT_TEST(testInsertDeletePage);
-CPPUNIT_TEST(testInsertTable);
-CPPUNIT_TEST(testPartHash);
-CPPUNIT_TEST(testResizeTable);
-CPPUNIT_TEST(testResizeTableColumn);
-CPPUNIT_TEST(testViewCursors);
-CPPUNIT_TEST(testViewCursorParts);
-CPPUNIT_TEST(testCursorViews);
-CPPUNIT_TEST(testCursorVisibility_SingleClick);
-CPPUNIT_TEST(testCursorVisibility_DoubleClick);
-CPPUNIT_TEST(testCursorVisibility_MultiView);
-CPPUNIT_TEST(testCursorVisibility_Escape);
-CPPUNIT_TEST(testViewLock);
-CPPUNIT_TEST(testUndoLimiting);
-CPPUNIT_TEST(testCreateViewGraphicSelection);
-CPPUNIT_TEST(testCreateViewTextCursor);
-CPPUNIT_TEST(testTdf102223);
-CPPUNIT_TEST(testTdf118354);
-CPPUNIT_TEST(testPostKeyEventInvalidation);
-CPPUNIT_TEST(testTdf103083);
-CPPUNIT_TEST(testTdf104405);
-CPPUNIT_TEST(testTdf81754);
-CPPUNIT_TEST(testTdf105502);
-CPPUNIT_TEST(testCommentCallbacks);
-CPPUNIT_TEST(testCommentChangeImpress);
-CPPUNIT_TEST(testCommentChangeDraw);
-CPPUNIT_TEST(testMultiViewInsertDeletePage);
-CPPUNIT_TEST(testMultiViewInsertDeletePage2);
-CPPUNIT_TEST(testDisableUndoRepair);
-CPPUNIT_TEST(testDocumentRepair);
-CPPUNIT_TEST(testLanguageStatus);
-CPPUNIT_TEST(testDefaultView);
-CPPUNIT_TEST(testIMESupport);
-CPPUNIT_TEST(testTdf115783);
-CPPUNIT_TEST(testPasteTextOnSlide);
-CPPUNIT_TEST(testTdf115873);
-CPPUNIT_TEST(testTdf115873Group);
-CPPUNIT_TEST(testCutSelectionChange);
-CPPUNIT_TEST(testRegenerateDiagram);

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

2023-03-02 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/misc-tests.cxx  |   30 +
 sw/qa/extras/layout/layout.cxx |  173 +++--
 sw/qa/extras/layout/layout2.cxx|   10 -
 sw/qa/extras/odfexport/odfexport.cxx   |   14 --
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |   14 --
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |5 
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx |5 
 sw/qa/extras/rtfexport/rtfexport4.cxx  |   17 --
 sw/qa/extras/rtfexport/rtfexport6.cxx  |   29 
 sw/qa/extras/uiwriter/uiwriter.cxx |5 
 sw/qa/extras/uiwriter/uiwriter4.cxx|5 
 11 files changed, 71 insertions(+), 236 deletions(-)

New commits:
commit dacbc0fccc8faa29cb8dd0688a6ec1d496df7bdd
Author: Xisco Fauli 
AuthorDate: Thu Mar 2 14:30:16 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 2 16:11:11 2023 +

qa: simplify code

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

diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index ea391708d060..844037924bb1 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -541,18 +541,9 @@ void SdMiscTest::testTdf101242_ODF_no_settings()
   
"config:config-item-set[@config:name='ooo:view-settings']/"
   
"config:config-item-map-indexed[@config:name='Views']/"
   "config:config-item-map-entry");
-xmlXPathObjectPtr pXmlObj
-= getXPathNode(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='VisibleLayers']");
-CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlObj->nodesetval));
-xmlXPathFreeObject(pXmlObj);
-pXmlObj = getXPathNode(pXmlDoc2,
-   sPathStart2 + 
"/config:config-item[@config:name='PrintableLayers']");
-CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlObj->nodesetval));
-xmlXPathFreeObject(pXmlObj);
-pXmlObj
-= getXPathNode(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='LockedLayers']");
-CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlObj->nodesetval));
-xmlXPathFreeObject(pXmlObj);
+assertXPath(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='VisibleLayers']", 0);
+assertXPath(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='PrintableLayers']", 0);
+assertXPath(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='LockedLayers']", 0);
 }
 
 void SdMiscTest::testTdf101242_settings_keep()
@@ -642,18 +633,9 @@ void SdMiscTest::testTdf101242_settings_remove()
   
"config:config-item-set[@config:name='ooo:view-settings']/"
   
"config:config-item-map-indexed[@config:name='Views']/"
   "config:config-item-map-entry");
-xmlXPathObjectPtr pXmlObj
-= getXPathNode(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='VisibleLayers']");
-CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlObj->nodesetval));
-xmlXPathFreeObject(pXmlObj);
-pXmlObj = getXPathNode(pXmlDoc2,
-   sPathStart2 + 
"/config:config-item[@config:name='PrintableLayers']");
-CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlObj->nodesetval));
-xmlXPathFreeObject(pXmlObj);
-pXmlObj
-= getXPathNode(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='LockedLayers']");
-CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlObj->nodesetval));
-xmlXPathFreeObject(pXmlObj);
+assertXPath(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='VisibleLayers']", 0);
+assertXPath(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='PrintableLayers']", 0);
+assertXPath(pXmlDoc2, sPathStart2 + 
"/config:config-item[@config:name='LockedLayers']", 0);
 }
 
 void SdMiscTest::testTdf119392()
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index b706858237d3..8e1fe15c32ea 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -139,10 +139,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes)
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
 
 // show: nothing is merged
-xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//merged");
-xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
-CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlNodes));
-xmlXPathFreeObject(pXmlObj);
+assertXPath(pXmlDoc, "//merged", 0);
+
 assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
 "type", "PortionType::Footnote");
 assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
@@ -374,12 +372,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
 discardDumpedLayout();
 pXmlDoc 

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

2023-02-24 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/import-tests.cxx |  300 ++--
 1 file changed, 71 insertions(+), 229 deletions(-)

New commits:
commit d31442848197678939144779e04d2510f049874a
Author: Xisco Fauli 
AuthorDate: Fri Feb 24 13:24:00 2023 +0100
Commit: Xisco Fauli 
CommitDate: Fri Feb 24 13:20:20 2023 +

CppunitTest_sd_import_tests: use CPPUNIT_TEST_FIXTURE()

These suites are large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 3ab567c43877..a52947493de8 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -81,162 +81,6 @@ public:
 : SdModelTestBase("/sd/qa/unit/data/")
 {
 }
-
-void testDocumentLayout();
-void testTdf152434();
-void testStandardConnectors();
-void testConnectors();
-void testTdf153036_resizedConnectorL();
-void testTdf150719();
-void testTdf149314();
-void testTdf149124();
-void testTdf148965();
-void testTdf89449();
-void testTdf147459();
-void testTdf146223();
-void testTdf144918();
-void testTdf144917();
-void testHyperlinkOnImage();
-void testTdf142645();
-void testTdf141704();
-void testTdf142915();
-void testTdf142913();
-void testTdf142590();
-void testCustomSlideShow();
-void testInternalHyperlink();
-void testHyperlinkColor();
-void testSmoketest();
-void testTdf131269();
-void testN759180();
-void testN778859();
-void testMasterPageStyleParent();
-void testGradientAngle();
-void testTdf97808();
-void testFillStyleNone();
-void testFdo64512();
-void testFdo71075();
-void testN828390_2();
-void testN828390_3();
-void testFdo68594();
-void testPlaceholderPriority();
-void testFdo72998();
-void testFdo77027();
-void testStrictOOXML();
-void testN862510_1();
-void testN862510_2();
-void testN862510_4();
-void testBnc870237();
-void testBnc887225();
-void testPredefinedTableStyle();
-void testBnc591147();
-void testCreationDate();
-void testMultiColTexts();
-void testBnc584721_1();
-void testBnc584721_2();
-void testBnc584721_4();
-void testBnc904423();
-void testShapeLineStyle();
-void testTableBorderLineStyle();
-void testBnc862510_6();
-void testBnc862510_7();
-#if ENABLE_PDFIMPORT
-void testPDFImportShared();
-#if defined(IMPORT_PDF_ELEMENTS)
-void testPDFImport();
-void testPDFImportSkipImages();
-#endif
-#endif
-void testBulletSuffix();
-void testBnc910045();
-void testRowHeight();
-void testTdf93830();
-void testTdf127129();
-void testTdf93097();
-void testTdf62255();
-void testTdf89927();
-void testTdf103800();
-void testTdf151767();
-void testTdf152070();
-
-CPPUNIT_TEST_SUITE(SdImportTest);
-
-CPPUNIT_TEST(testDocumentLayout);
-CPPUNIT_TEST(testTdf152434);
-CPPUNIT_TEST(testStandardConnectors);
-CPPUNIT_TEST(testConnectors);
-CPPUNIT_TEST(testTdf153036_resizedConnectorL);
-CPPUNIT_TEST(testTdf150719);
-CPPUNIT_TEST(testTdf149314);
-CPPUNIT_TEST(testTdf149124);
-CPPUNIT_TEST(testTdf148965);
-CPPUNIT_TEST(testTdf89449);
-CPPUNIT_TEST(testTdf147459);
-CPPUNIT_TEST(testTdf146223);
-CPPUNIT_TEST(testTdf144918);
-CPPUNIT_TEST(testTdf144917);
-CPPUNIT_TEST(testHyperlinkOnImage);
-CPPUNIT_TEST(testTdf142645);
-CPPUNIT_TEST(testTdf141704);
-CPPUNIT_TEST(testTdf142915);
-CPPUNIT_TEST(testTdf142913);
-CPPUNIT_TEST(testTdf142590);
-CPPUNIT_TEST(testCustomSlideShow);
-CPPUNIT_TEST(testInternalHyperlink);
-CPPUNIT_TEST(testHyperlinkColor);
-CPPUNIT_TEST(testSmoketest);
-CPPUNIT_TEST(testTdf131269);
-CPPUNIT_TEST(testN759180);
-CPPUNIT_TEST(testN778859);
-CPPUNIT_TEST(testMasterPageStyleParent);
-CPPUNIT_TEST(testGradientAngle);
-CPPUNIT_TEST(testTdf97808);
-CPPUNIT_TEST(testFillStyleNone);
-CPPUNIT_TEST(testFdo64512);
-CPPUNIT_TEST(testFdo71075);
-CPPUNIT_TEST(testN828390_2);
-CPPUNIT_TEST(testN828390_3);
-CPPUNIT_TEST(testFdo68594);
-CPPUNIT_TEST(testPlaceholderPriority);
-CPPUNIT_TEST(testFdo72998);
-CPPUNIT_TEST(testFdo77027);
-CPPUNIT_TEST(testStrictOOXML);
-CPPUNIT_TEST(testN862510_1);
-CPPUNIT_TEST(testN862510_2);
-CPPUNIT_TEST(testN862510_4);
-CPPUNIT_TEST(testBnc870237);
-CPPUNIT_TEST(testBnc887225);
-CPPUNIT_TEST(testPredefinedTableStyle);
-CPPUNIT_TEST(testBnc591147);
-CPPUNIT_TEST(testCreationDate);
-CPPUNIT_TEST(testMultiColTexts);
-CPPUNIT_TEST(testBnc584721_1);
-CPPUNIT_TEST(testBnc584721_2);

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

2023-02-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests.cxx |  213 ++--
 1 file changed, 52 insertions(+), 161 deletions(-)

New commits:
commit ab20dba30769a5a52830220daa347772485db6a2
Author: Xisco Fauli 
AuthorDate: Thu Feb 23 17:16:34 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Feb 23 21:54:10 2023 +

CppunitTest_sd_export_tests: use CPPUNIT_TEST_FIXTURE()

This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 1878bf11e706..370f08564b22 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -53,119 +53,12 @@ public:
 {
 }
 
-void testBackgroundImage();
-void testMediaEmbedding();
-void testFillBitmapUnused();
-void testFdo84043();
-void testTdf97630();
-void testImpressPasswordExport();
-void testDrawPasswordExport();
-void testSwappedOutImageExport();
-void testOOoXMLAnimations();
-void testBnc480256();
-void testUnknownAttributes();
-void testTdf80020();
-void testTdf128985();
-void testLinkedGraphicRT();
-void testTdf79082();
-void testImageWithSpecialID();
-void testTdf62176();
-void testTransparentBackground();
-void testTdf142716();
-void testEmbeddedPdf();
-void testEmbeddedText();
-void testTransparenText();
-void testDefaultSubscripts();
-void testTdf98477();
-void testAuthorField();
-void testTdf50499();
-void testTdf100926();
-void testPageWithTransparentBackground();
-void testTextRotation();
-void testTdf115394PPT();
-void testBulletsAsImage();
-void testTdf113818();
-void testTdf119629();
-void testTdf141269();
-void testTdf123557();
-void testTdf113822();
-void testTdf126761();
-void testGlow();
-void testSoftEdges();
-void testShadowBlur();
-void testRhbz1870501();
-void testTdf152606();
-void testTdf91060();
-void testTdf128550();
-void testTdf140714();
-void testMasterPageBackgroundFullSize();
-void testColumnsODG();
-void testTdf112126();
-void testCellProperties();
-void testUserTableStyles();
-void testTdf153179();
-
-CPPUNIT_TEST_SUITE(SdExportTest);
-
-CPPUNIT_TEST(testBackgroundImage);
-CPPUNIT_TEST(testMediaEmbedding);
-CPPUNIT_TEST(testFillBitmapUnused);
-CPPUNIT_TEST(testFdo84043);
-CPPUNIT_TEST(testTdf97630);
-CPPUNIT_TEST(testImpressPasswordExport);
-CPPUNIT_TEST(testDrawPasswordExport);
-CPPUNIT_TEST(testSwappedOutImageExport);
-CPPUNIT_TEST(testOOoXMLAnimations);
-CPPUNIT_TEST(testBnc480256);
-CPPUNIT_TEST(testUnknownAttributes);
-CPPUNIT_TEST(testTdf80020);
-CPPUNIT_TEST(testTdf128985);
-CPPUNIT_TEST(testLinkedGraphicRT);
-CPPUNIT_TEST(testTdf79082);
-CPPUNIT_TEST(testImageWithSpecialID);
-CPPUNIT_TEST(testTdf62176);
-CPPUNIT_TEST(testTransparentBackground);
-CPPUNIT_TEST(testTdf142716);
-CPPUNIT_TEST(testEmbeddedPdf);
-CPPUNIT_TEST(testEmbeddedText);
-CPPUNIT_TEST(testTransparenText);
-CPPUNIT_TEST(testDefaultSubscripts);
-CPPUNIT_TEST(testTdf98477);
-CPPUNIT_TEST(testAuthorField);
-CPPUNIT_TEST(testTdf50499);
-CPPUNIT_TEST(testTdf100926);
-CPPUNIT_TEST(testPageWithTransparentBackground);
-CPPUNIT_TEST(testTextRotation);
-CPPUNIT_TEST(testTdf115394PPT);
-CPPUNIT_TEST(testBulletsAsImage);
-CPPUNIT_TEST(testTdf113818);
-CPPUNIT_TEST(testTdf119629);
-CPPUNIT_TEST(testTdf141269);
-CPPUNIT_TEST(testTdf123557);
-CPPUNIT_TEST(testTdf113822);
-CPPUNIT_TEST(testTdf126761);
-CPPUNIT_TEST(testGlow);
-CPPUNIT_TEST(testSoftEdges);
-CPPUNIT_TEST(testShadowBlur);
-CPPUNIT_TEST(testRhbz1870501);
-CPPUNIT_TEST(testTdf152606);
-CPPUNIT_TEST(testTdf91060);
-CPPUNIT_TEST(testTdf128550);
-CPPUNIT_TEST(testTdf140714);
-CPPUNIT_TEST(testMasterPageBackgroundFullSize);
-CPPUNIT_TEST(testColumnsODG);
-CPPUNIT_TEST(testTdf112126);
-CPPUNIT_TEST(testCellProperties);
-CPPUNIT_TEST(testUserTableStyles);
-CPPUNIT_TEST(testTdf153179);
-CPPUNIT_TEST_SUITE_END();
-
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
 {
 XmlTestTools::registerODFNamespaces(pXmlXPathCtx);
 }
 
-private:
+protected:
 uno::Reference getBitmapFromTable(OUString const& rName);
 };
 
@@ -192,7 +85,7 @@ uno::Reference 
SdExportTest::getBitmapFromTable(OUString const& rN
 return xBitmap;
 }
 
-void SdExportTest::testBackgroundImage()
+CPPUNIT_TEST_FIXTURE(SdExportTest, testBackgroundImage)
 {
 // Initial bug: N821567
 
@@ -297,7 +190,7 @@ void 

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

2023-02-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml1.cxx |  300 +
 1 file changed, 73 insertions(+), 227 deletions(-)

New commits:
commit 46d489ccd6f8e24fefba25118de9a72b2602b656
Author: Xisco Fauli 
AuthorDate: Thu Feb 23 11:17:10 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Feb 23 14:22:04 2023 +

CppunitTest_sd_export_tests-ooxml1: use CPPUNIT_TEST_FIXTURE()

This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index b7b43f886ff9..98aa9c79eec7 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -51,158 +51,6 @@ public:
 {
 }
 
-void testTdf152335();
-void testTdf149803();
-void testTdf149311();
-void testTdf149128();
-void testTdf66228();
-void testTdf147919();
-void testTdf130165();
-void testTdf124781();
-void testTdf144914();
-void testTdf124232();
-void testTdf143624();
-void testTdf142648();
-void testTdf47365();
-void testTdf125071();
-void testTdf54037();
-void testFdo90607();
-void testTdf127237();
-void testBnc887230();
-void testBnc870233_1();
-void testBnc870233_2();
-void testN828390_4();
-void testN828390_5();
-void testFdo71961();
-void testLostPlaceholders();
-void testN828390();
-void testBnc880763();
-void testBnc862510_5();
-void testBnc822347_EmptyBullet();
-void testFdo83751();
-void testFdo79731();
-void testTableCellFillProperties();
-void testBulletStartNumber();
-void testLineStyle();
-void testCellLeftAndRightMargin();
-void testTdf134862();
-void testRightToLeftParaghraph();
-void testTextboxWithHyperlink();
-void testMergedCells();
-void testTableCellBorder();
-void testBulletColor();
-void testBulletCharAndFont();
-void testBulletMarginAndIndentation();
-void testParaMarginAndindentation();
-void testTdf111884();
-void testTdf112633();
-void testTdf128952();
-void testTdf127090();
-void testCustomXml();
-void testTdf94238();
-void testPictureTransparency();
-void testTdf125554();
-void testRoundtripOwnLineStyles();
-void testRoundtripPrstDash();
-void testDashOnHairline();
-void testNarrationNonMediaShape();
-void testCustomshapeBitmapfillSrcrect();
-void testTdf100348FontworkBitmapFill();
-void testTdf100348FontworkGradientGlow();
-void testTdf128345FullTransparentGradient();
-void testTdf128345GradientLinear();
-void testTdf128345GradientRadial();
-void testTdf128345GradientAxial();
-void testTdf134969TransparencyOnColorGradient();
-void testTdf136911();
-void testArcTo();
-void testNarrationMimeType();
-void testTdf140865Wordart3D();
-void testTdf124457();
-void testPlaceholderFillAndOutlineExport();
-void testTdf143126();
-void testTdf143129();
-void testTdf118045();
-void testTdf137675();
-
-CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
-
-CPPUNIT_TEST(testTdf152335);
-CPPUNIT_TEST(testTdf149803);
-CPPUNIT_TEST(testTdf149311);
-CPPUNIT_TEST(testTdf149128);
-CPPUNIT_TEST(testTdf66228);
-CPPUNIT_TEST(testTdf147919);
-CPPUNIT_TEST(testTdf130165);
-CPPUNIT_TEST(testTdf124781);
-CPPUNIT_TEST(testTdf144914);
-CPPUNIT_TEST(testTdf124232);
-CPPUNIT_TEST(testTdf143624);
-CPPUNIT_TEST(testTdf142648);
-CPPUNIT_TEST(testTdf47365);
-CPPUNIT_TEST(testTdf125071);
-CPPUNIT_TEST(testTdf54037);
-CPPUNIT_TEST(testFdo90607);
-CPPUNIT_TEST(testTdf127237);
-CPPUNIT_TEST(testBnc887230);
-CPPUNIT_TEST(testBnc870233_1);
-CPPUNIT_TEST(testBnc870233_2);
-CPPUNIT_TEST(testN828390_4);
-CPPUNIT_TEST(testN828390_5);
-CPPUNIT_TEST(testFdo71961);
-CPPUNIT_TEST(testLostPlaceholders);
-CPPUNIT_TEST(testN828390);
-CPPUNIT_TEST(testBnc880763);
-CPPUNIT_TEST(testBnc862510_5);
-CPPUNIT_TEST(testBnc822347_EmptyBullet);
-CPPUNIT_TEST(testFdo83751);
-CPPUNIT_TEST(testFdo79731);
-CPPUNIT_TEST(testTableCellFillProperties);
-CPPUNIT_TEST(testBulletStartNumber);
-CPPUNIT_TEST(testLineStyle);
-CPPUNIT_TEST(testCellLeftAndRightMargin);
-CPPUNIT_TEST(testTdf134862);
-CPPUNIT_TEST(testRightToLeftParaghraph);
-CPPUNIT_TEST(testTextboxWithHyperlink);
-CPPUNIT_TEST(testMergedCells);
-CPPUNIT_TEST(testTableCellBorder);
-CPPUNIT_TEST(testBulletColor);
-CPPUNIT_TEST(testBulletCharAndFont);
-CPPUNIT_TEST(testBulletMarginAndIndentation);
-CPPUNIT_TEST(testParaMarginAndindentation);
-CPPUNIT_TEST(testTdf111884);
-

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

2023-02-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/import-tests2.cxx |  313 ++-
 1 file changed, 77 insertions(+), 236 deletions(-)

New commits:
commit e176e7a5eafa11df9ad5a9948724a4b6102798d0
Author: Xisco Fauli 
AuthorDate: Wed Feb 22 16:08:13 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Feb 23 12:03:47 2023 +

CppunitTest_sd_import_tests2: use CPPUNIT_TEST_FIXTURE()

This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 5d5864a2891e..ceeb2603bf35 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -68,168 +68,11 @@ public:
 {
 }
 
-void testTdf152186();
-void testTdf93868();
-void testTdf95932();
-void testTdf99030();
-void testTdf49561();
-void testTdf103473();
-void testAoo124143();
-void testTdf103567();
-void testTdf103792();
-void testTdf148685();
-void testTdf103876();
-void testTdf79007();
-void testTdf119649();
-void testTdf118776();
-void testTdf129686();
-void testTdf104015();
-void testTdf104201();
-void testTdf103477();
-void testTdf104445();
-void testTdf105150();
-void testTdf105150PPT();
-void testTdf123684();
-void testTdf100926();
-void testTdf89064();
-void testTdf108925();
-void testTdf109067();
-void testTdf109187();
-void testTdf108926();
-void testTdf100065();
-void testTdf90626();
-void testTdf138148();
-void testTdf114488();
-void testTdf134174();
-void testTdf134210();
-void testTdf114913();
-void testTdf114821();
-void testTdf115394();
-void testTdf115394PPT();
-void testTdf51340();
-void testTdf116899();
-void testTdf77747();
-void testTdf116266();
-void testTdf128684();
-void testShapeGlowEffectPPTXImpoer();
-void testShapeBlurPPTXImport();
-void testMirroredGraphic();
-void testGreysScaleGraphic();
-void testTdf134210CropPosition();
-
+protected:
 bool checkPattern(int nShapeNumber, std::vector& rExpected);
-void testPatternImport();
-void testPptCrop();
-void testTdf149206();
-void testTdf149785();
-void testTdf149985();
-void testTdf150770();
-void testTdf120028();
-void testDescriptionImport();
-void testTdf83247();
-void testTdf47365();
-void testTdf122899();
-void testOOXTheme();
-void testCropToShape();
-void testTdf127964();
-void testTdf106638();
-void testTdf113198();
-void testTdf49856();
-void testTdf103347();
-void testHyperlinksOnShapes();
-void testTdf112209();
-void testTdf128596();
-void testDefaultTabStop();
-void testCropToZero();
-void testTdf144092TableHeight();
-void testTdf89928BlackWhiteThreshold();
-void testTdf151547TransparentWhiteText();
-void testTdf149961AutofitIndentation();
-void testTdf149588TransparentSolidFill();
-
-CPPUNIT_TEST_SUITE(SdImportTest2);
-
-CPPUNIT_TEST(testTdf152186);
-CPPUNIT_TEST(testTdf93868);
-CPPUNIT_TEST(testTdf95932);
-CPPUNIT_TEST(testTdf99030);
-CPPUNIT_TEST(testTdf49561);
-CPPUNIT_TEST(testTdf103473);
-CPPUNIT_TEST(testAoo124143);
-CPPUNIT_TEST(testTdf103567);
-CPPUNIT_TEST(testTdf103792);
-CPPUNIT_TEST(testTdf148685);
-CPPUNIT_TEST(testTdf103876);
-CPPUNIT_TEST(testTdf79007);
-CPPUNIT_TEST(testTdf119649);
-CPPUNIT_TEST(testTdf118776);
-CPPUNIT_TEST(testTdf129686);
-CPPUNIT_TEST(testTdf104015);
-CPPUNIT_TEST(testTdf104201);
-CPPUNIT_TEST(testTdf103477);
-CPPUNIT_TEST(testTdf104445);
-CPPUNIT_TEST(testTdf105150);
-CPPUNIT_TEST(testTdf105150PPT);
-CPPUNIT_TEST(testTdf123684);
-CPPUNIT_TEST(testTdf100926);
-CPPUNIT_TEST(testPatternImport);
-CPPUNIT_TEST(testTdf89064);
-CPPUNIT_TEST(testTdf108925);
-CPPUNIT_TEST(testTdf109067);
-CPPUNIT_TEST(testTdf109187);
-CPPUNIT_TEST(testTdf108926);
-CPPUNIT_TEST(testTdf100065);
-CPPUNIT_TEST(testTdf90626);
-CPPUNIT_TEST(testTdf138148);
-CPPUNIT_TEST(testTdf114488);
-CPPUNIT_TEST(testTdf134174);
-CPPUNIT_TEST(testTdf134210);
-CPPUNIT_TEST(testTdf114913);
-CPPUNIT_TEST(testTdf114821);
-CPPUNIT_TEST(testTdf115394);
-CPPUNIT_TEST(testTdf115394PPT);
-CPPUNIT_TEST(testTdf51340);
-CPPUNIT_TEST(testTdf116899);
-CPPUNIT_TEST(testTdf77747);
-CPPUNIT_TEST(testTdf116266);
-CPPUNIT_TEST(testPptCrop);
-CPPUNIT_TEST(testTdf149206);
-CPPUNIT_TEST(testTdf149785);
-CPPUNIT_TEST(testTdf149985);
-CPPUNIT_TEST(testTdf150770);
-CPPUNIT_TEST(testTdf120028);
-CPPUNIT_TEST(testDescriptionImport);
-

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

2023-02-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml3.cxx |  371 +
 1 file changed, 92 insertions(+), 279 deletions(-)

New commits:
commit 988cdcc18610300dd389e0efc25553e6c1bcb19e
Author: Xisco Fauli 
AuthorDate: Wed Feb 22 17:14:41 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Feb 23 08:23:39 2023 +

CppunitTest_sd_export_tests-ooxml3: use CPPUNIT_TEST_FIXTURE()

This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 2bbb68875760..96167204aecc 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -40,201 +40,16 @@ public:
 {
 }
 
-void testTdf9();
-void testTdf129430();
-void testTdf114848();
-void testTdf147586();
-void testTdf68759();
-void testTdf127901();
-void testTdf48735();
-void testTdf90626();
-void testTdf107608();
-void testTdf111786();
-void testFontScale();
-void testShapeAutofitPPTX();
-void testLegacyShapeAutofitPPTX();
-void testTdf115394();
-void testTdf115394Zero();
-void testTdf115005();
-int testTdf115005_FallBack_Images(bool bAddReplacementImages);
-void testTdf115005_FallBack_Images_On();
-void testTdf115005_FallBack_Images_Off();
-void testTdf118806();
-void testTdf130058();
-void testTdf111789();
-void testTdf145162();
-void testZeroIndentExport();
-void testTdf100348_convert_Fontwork2TextWarp();
-void testTdf125573_FontWorkScaleX();
-void testTdf99497_keepAppearanceOfCircleKind();
-/// SmartArt animated elements
-void testTdf104792();
-void testTdf90627();
-void testTdf104786();
-void testTdf118783();
-void testTdf104789();
-void testOpenDocumentAsReadOnly();
-void testTdf118835();
-void testTdf118768();
-void testTdf118836();
-void testTdf116350TextEffects();
-void testTdf128096();
-void testTdf120573();
-void testTdf119118();
-void testTdf99213();
-void testPotxExport();
-void testTdf44223();
-void testTdf135843();
-void testSmartArtPreserve();
-void testTdf125346();
-void testTdf125346_2();
-void testTdf125360();
-void testTdf125360_1();
-void testTdf125360_2();
-void testTdf125551();
-void testTdf136830();
-void testTdf126234();
-void testTdf126741();
-void testTdf127372();
-void testTdf127379();
-void testTdf98603();
-void testTdf79082();
-void testTdf128213();
-void testTdf129372();
-void testShapeGlowEffect();
-void testUnderline();
-void testTdf119087();
-void testTdf131554();
-void testTdf132282();
-void testTdf132201EffectOrder();
-void testShapeSoftEdgeEffect();
-void testShapeShadowBlurEffect();
-void testTdf119223();
-void testTdf128213ShapeRot();
-void testTdf125560_textDeflate();
-void testTdf125560_textInflateTop();
-void testTdf96061_textHighlight();
-void testTdf143222_embeddedWorksheet();
-void testTdf142235_TestPlaceholderTextAlignment();
-void testTdf143315();
-void testTdf147121();
-void testTdf140912_PicturePlaceholder();
-void testEnhancedPathViewBox();
-void testTdf74670();
-void testTdf109169_OctagonBevel();
-void testTdf109169_DiamondBevel();
-void testTdf144092_emptyShapeTextProps();
-void testTdf149551_tbrl90();
-void testTdf149551_btlr();
-void testTdf94122_autoColor();
-void testTdf124333();
-void testAutofittedTextboxIndent();
-void testTdf151622_oleIcon();
-void testTdf152436();
-void testLinkedOLE();
-
-CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
-
-CPPUNIT_TEST(testTdf9);
-CPPUNIT_TEST(testTdf129430);
-CPPUNIT_TEST(testTdf114848);
-CPPUNIT_TEST(testTdf147586);
-CPPUNIT_TEST(testTdf68759);
-CPPUNIT_TEST(testTdf127901);
-CPPUNIT_TEST(testTdf48735);
-CPPUNIT_TEST(testTdf90626);
-CPPUNIT_TEST(testTdf107608);
-CPPUNIT_TEST(testTdf111786);
-CPPUNIT_TEST(testFontScale);
-CPPUNIT_TEST(testShapeAutofitPPTX);
-CPPUNIT_TEST(testLegacyShapeAutofitPPTX);
-CPPUNIT_TEST(testTdf115394);
-CPPUNIT_TEST(testTdf115394Zero);
-CPPUNIT_TEST(testTdf115005);
-CPPUNIT_TEST(testTdf115005_FallBack_Images_On);
-CPPUNIT_TEST(testTdf115005_FallBack_Images_Off);
-CPPUNIT_TEST(testTdf118806);
-CPPUNIT_TEST(testTdf130058);
-CPPUNIT_TEST(testTdf111789);
-CPPUNIT_TEST(testTdf145162);
-CPPUNIT_TEST(testZeroIndentExport);
-CPPUNIT_TEST(testTdf100348_convert_Fontwork2TextWarp);
-CPPUNIT_TEST(testTdf125573_FontWorkScaleX);
-CPPUNIT_TEST(testTdf99497_keepAppearanceOfCircleKind);
-

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

2023-02-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx |  288 -
 1 file changed, 70 insertions(+), 218 deletions(-)

New commits:
commit f9300c3521206ab9591788a96dc97f60586d03b2
Author: Xisco Fauli 
AuthorDate: Wed Feb 22 17:21:38 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Feb 23 08:23:18 2023 +

CppunitTest_sd_export_tests-ooxml2: use CPPUNIT_TEST_FIXTURE()

This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index a7469250f1fe..429f26d5fe52 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -76,159 +76,13 @@ public:
 {
 }
 
-void testRepeatBitmapMode();
-void testTdf153107();
-void testTdf142291();
-void testTdf151492();
-void testTdf149697();
-void testTdf149126();
-void testTdf131905();
-void testTdf93883();
-void testTdf91378();
-void testBnc822341();
-void testMathObject();
-void testMathObjectPPT2010();
-void testTdf119015();
-void testTdf123090();
-void testTdf126324();
-void testTdf119187();
-void testTdf132472();
-void testTdf80224();
-void testExportTransitionsPPTX();
-void testPresetShapesExport();
-void testTdf92527();
-void testDatetimeFieldNumberFormat();
-void testDatetimeFieldNumberFormatPPTX();
-void testSlideNumberField();
-void testSlideNumberFieldPPTX();
-void testSlideCountField();
-void testSlideNameField();
-void testExtFileField();
-void testAuthorField();
-void testTdf99224();
-void testTdf92076();
-void testTdf59046();
-void testTdf133502();
-void testTdf105739();
-void testPageBitmapWithTransparency();
-void testPptmContentType();
-void testTdf111798();
-void testPptmVBAStream();
-void testTdf111863();
-void testTdf111518();
-void testTdf100387();
-void testClosingShapesAndLineCaps();
-void testRotateFlip();
-void testTdf106867();
-void testTdf112280();
-void testTdf112088();
-void testTdf112333();
-void testTdf112552();
-void testTdf112557();
-void testTdf128049();
-void testTdf106026();
-void testTdf112334();
-void testTdf112089();
-void testTdf112086();
-void testTdf112647();
-void testGroupRotation();
-void testTdf104788();
-void testSmartartRotation2();
-void testTdf91999_rotateShape();
-void testTdf114845_rotateShape();
-void testGroupsPosition();
-void testGroupsRotatedPosition();
-void testAccentColor();
-void testThemeColors();
-void testTdf111785();
-void testTdf118825();
-void testTextColumns_tdf140852();
-void testTextColumns_3columns();
-void testTdf59323_slideFooters();
-void testTdf53970();
-
-CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
-
-CPPUNIT_TEST(testRepeatBitmapMode);
-CPPUNIT_TEST(testTdf153107);
-CPPUNIT_TEST(testTdf142291);
-CPPUNIT_TEST(testTdf151492);
-CPPUNIT_TEST(testTdf149697);
-CPPUNIT_TEST(testTdf149126);
-CPPUNIT_TEST(testTdf131905);
-CPPUNIT_TEST(testTdf93883);
-CPPUNIT_TEST(testTdf91378);
-CPPUNIT_TEST(testBnc822341);
-CPPUNIT_TEST(testMathObject);
-CPPUNIT_TEST(testMathObjectPPT2010);
-CPPUNIT_TEST(testTdf119015);
-CPPUNIT_TEST(testTdf123090);
-CPPUNIT_TEST(testTdf126324);
-CPPUNIT_TEST(testTdf119187);
-CPPUNIT_TEST(testTdf132472);
-CPPUNIT_TEST(testTdf80224);
-CPPUNIT_TEST(testExportTransitionsPPTX);
-CPPUNIT_TEST(testPresetShapesExport);
-CPPUNIT_TEST(testTdf92527);
-CPPUNIT_TEST(testDatetimeFieldNumberFormat);
-CPPUNIT_TEST(testDatetimeFieldNumberFormatPPTX);
-CPPUNIT_TEST(testSlideNumberField);
-CPPUNIT_TEST(testSlideNumberFieldPPTX);
-CPPUNIT_TEST(testSlideCountField);
-CPPUNIT_TEST(testSlideNameField);
-CPPUNIT_TEST(testExtFileField);
-CPPUNIT_TEST(testAuthorField);
-CPPUNIT_TEST(testTdf99224);
-CPPUNIT_TEST(testTdf92076);
-CPPUNIT_TEST(testTdf59046);
-CPPUNIT_TEST(testTdf133502);
-CPPUNIT_TEST(testTdf105739);
-CPPUNIT_TEST(testPageBitmapWithTransparency);
-CPPUNIT_TEST(testPptmContentType);
-CPPUNIT_TEST(testTdf111798);
-CPPUNIT_TEST(testPptmVBAStream);
-CPPUNIT_TEST(testTdf111863);
-CPPUNIT_TEST(testTdf111518);
-CPPUNIT_TEST(testTdf100387);
-CPPUNIT_TEST(testClosingShapesAndLineCaps);
-CPPUNIT_TEST(testRotateFlip);
-CPPUNIT_TEST(testTdf106867);
-CPPUNIT_TEST(testTdf112280);
-CPPUNIT_TEST(testTdf112088);
-CPPUNIT_TEST(testTdf112333);
-CPPUNIT_TEST(testTdf112552);
-CPPUNIT_TEST(testTdf112557);
-CPPUNIT_TEST(testTdf128049);
-

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

2023-02-22 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/import-tests-smartart.cxx |  244 ---
 1 file changed, 59 insertions(+), 185 deletions(-)

New commits:
commit 131da4cce6e0ede110f7276e0f67c8742a69c380
Author: Xisco Fauli 
AuthorDate: Wed Feb 22 15:59:45 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 22 20:09:49 2023 +

CppunitTest_sd_import_tests-smartart: use CPPUNIT_TEST_FIXTURE()

This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.

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

diff --git a/sd/qa/unit/import-tests-smartart.cxx 
b/sd/qa/unit/import-tests-smartart.cxx
index ba8e8e2c28a7..895ca7f03211 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -72,133 +72,9 @@ public:
 : SdModelTestBase("/sd/qa/unit/data/")
 {
 }
-
-void testBase();
-void testChildren();
-void testText();
-void testCnt();
-void testDir();
-void testTdf148665();
-void testTdf148921();
-void testMaxDepth();
-void testRotation();
-void testTextAutoRotation();
-void testPyramid();
-void testPyramidOneChild();
-void testChevron();
-void testCycle();
-void testvenndiagram();
-void testmatrix();
-void testHierarchy();
-void testInvertedPyramid();
-void testBasicProcess();
-void testMultidirectional();
-void testHorizontalBulletList();
-void testBasicRadicals();
-void testEquation();
-void testSegmentedCycle();
-void testBaseRtoL();
-void testVerticalBoxList();
-void testVerticalBracketList();
-void testTableList();
-void testAccentProcess();
-void testContinuousBlockProcess();
-void testOrgChart();
-void testCycleMatrix();
-void testPictureStrip();
-void testInteropGrabBag();
-void testBackground();
-void testBackgroundDrawingmlFallback();
-void testCenterCycle();
-void testFontSize();
-void testVerticalBlockList();
-void testBulletList();
-void testMissingBulletAndIndent();
-void testRecursion();
-void testDataFollow();
-void testOrgChart2();
-void testTdf131553();
-void testFillColorList();
-void testTdf134221();
-void testLinearRule();
-void testLinearRuleVert();
-void testAutofitSync();
-void testSnakeRows();
-void testCompositeInferRight();
-void testTdf149551Pie();
-void testTdf149551Pyramid();
-void testTdf149551Venn();
-void testTdf149551Gear();
-void testTdf145528Matrix();
-void testTdf135953TextPosition();
-void testTdf132302RightArrow();
-
-CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
-
-CPPUNIT_TEST(testBase);
-CPPUNIT_TEST(testChildren);
-CPPUNIT_TEST(testText);
-CPPUNIT_TEST(testCnt);
-CPPUNIT_TEST(testDir);
-CPPUNIT_TEST(testTdf148665);
-CPPUNIT_TEST(testTdf148921);
-CPPUNIT_TEST(testMaxDepth);
-CPPUNIT_TEST(testRotation);
-CPPUNIT_TEST(testTextAutoRotation);
-CPPUNIT_TEST(testPyramid);
-CPPUNIT_TEST(testPyramidOneChild);
-CPPUNIT_TEST(testChevron);
-CPPUNIT_TEST(testCycle);
-CPPUNIT_TEST(testHierarchy);
-CPPUNIT_TEST(testmatrix);
-CPPUNIT_TEST(testvenndiagram);
-CPPUNIT_TEST(testInvertedPyramid);
-CPPUNIT_TEST(testBasicProcess);
-CPPUNIT_TEST(testMultidirectional);
-CPPUNIT_TEST(testHorizontalBulletList);
-CPPUNIT_TEST(testBasicRadicals);
-CPPUNIT_TEST(testEquation);
-CPPUNIT_TEST(testSegmentedCycle);
-CPPUNIT_TEST(testBaseRtoL);
-CPPUNIT_TEST(testVerticalBoxList);
-CPPUNIT_TEST(testVerticalBracketList);
-CPPUNIT_TEST(testTableList);
-CPPUNIT_TEST(testAccentProcess);
-CPPUNIT_TEST(testContinuousBlockProcess);
-CPPUNIT_TEST(testOrgChart);
-CPPUNIT_TEST(testCycleMatrix);
-CPPUNIT_TEST(testPictureStrip);
-CPPUNIT_TEST(testInteropGrabBag);
-CPPUNIT_TEST(testBackground);
-CPPUNIT_TEST(testBackgroundDrawingmlFallback);
-CPPUNIT_TEST(testCenterCycle);
-CPPUNIT_TEST(testFontSize);
-CPPUNIT_TEST(testVerticalBlockList);
-CPPUNIT_TEST(testBulletList);
-CPPUNIT_TEST(testMissingBulletAndIndent);
-CPPUNIT_TEST(testRecursion);
-CPPUNIT_TEST(testDataFollow);
-CPPUNIT_TEST(testOrgChart2);
-CPPUNIT_TEST(testTdf131553);
-CPPUNIT_TEST(testFillColorList);
-CPPUNIT_TEST(testTdf134221);
-CPPUNIT_TEST(testLinearRule);
-CPPUNIT_TEST(testLinearRuleVert);
-CPPUNIT_TEST(testAutofitSync);
-CPPUNIT_TEST(testSnakeRows);
-CPPUNIT_TEST(testCompositeInferRight);
-CPPUNIT_TEST(testTdf149551Pie);
-CPPUNIT_TEST(testTdf149551Pyramid);
-CPPUNIT_TEST(testTdf149551Venn);
-CPPUNIT_TEST(testTdf149551Gear);
-CPPUNIT_TEST(testTdf145528Matrix);
-CPPUNIT_TEST(testTdf135953TextPosition);
-

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

2023-02-22 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/data/pptx/tdf134862.pptx |binary
 sd/qa/unit/export-tests-ooxml1.cxx  |   30 ++
 2 files changed, 30 insertions(+)

New commits:
commit 27a454359a0d57de872bc110d6e88d5e51f26202
Author: Xisco Fauli 
AuthorDate: Wed Feb 22 13:52:53 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 22 16:51:04 2023 +

tdf#134862: sd_export_tests-ooxml1: Add unittest

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

diff --git a/sd/qa/unit/data/pptx/tdf134862.pptx 
b/sd/qa/unit/data/pptx/tdf134862.pptx
new file mode 100644
index ..b92acfc3e235
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf134862.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 2c3c5a0152e3..b7b43f886ff9 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -85,6 +85,7 @@ public:
 void testBulletStartNumber();
 void testLineStyle();
 void testCellLeftAndRightMargin();
+void testTdf134862();
 void testRightToLeftParaghraph();
 void testTextboxWithHyperlink();
 void testMergedCells();
@@ -160,6 +161,7 @@ public:
 CPPUNIT_TEST(testBulletStartNumber);
 CPPUNIT_TEST(testLineStyle);
 CPPUNIT_TEST(testCellLeftAndRightMargin);
+CPPUNIT_TEST(testTdf134862);
 CPPUNIT_TEST(testRightToLeftParaghraph);
 CPPUNIT_TEST(testTextboxWithHyperlink);
 CPPUNIT_TEST(testMergedCells);
@@ -999,6 +1001,34 @@ void SdOOXMLExportTest1::testLineStyle()
  static_cast(rStyleItem.GetValue()));
 }
 
+void SdOOXMLExportTest1::testTdf134862()
+{
+createSdImpressDoc("pptx/tdf134862.pptx");
+uno::Reference xShape(getShapeFromPage(0, 0));
+
+uno::Reference xParagraph(getParagraphFromShape(0, 
xShape));
+uno::Reference xPropSet(xParagraph, 
uno::UNO_QUERY_THROW);
+
+sal_Int16 nWritingMode = 0;
+xPropSet->getPropertyValue("WritingMode") >>= nWritingMode;
+
+// Without the fix in place, this test would have failed here
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", 
text::WritingMode2::RL_TB,
+ nWritingMode);
+
+saveAndReload("Impress Office Open XML");
+
+xShape.set(getShapeFromPage(0, 0));
+
+xParagraph.set(getParagraphFromShape(0, xShape));
+xPropSet.set(xParagraph, uno::UNO_QUERY_THROW);
+
+nWritingMode = 0;
+xPropSet->getPropertyValue("WritingMode") >>= nWritingMode;
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", 
text::WritingMode2::RL_TB,
+ nWritingMode);
+}
+
 void SdOOXMLExportTest1::testRightToLeftParaghraph()
 {
 createSdImpressDoc("pptx/rightToLeftParagraph.pptx");


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

2023-02-15 Thread Tünde Tóth (via logerrit)
 sd/qa/unit/export-tests.cxx|   11 +
 xmloff/source/draw/shapeexport.cxx |   45 +
 2 files changed, 56 insertions(+)

New commits:
commit da725dfe07f2cf10349772d1667591c4d6a6fe8a
Author: Tünde Tóth 
AuthorDate: Fri Jan 27 09:55:40 2023 +0100
Commit: László Németh 
CommitDate: Wed Feb 15 08:35:00 2023 +

tdf#153179 ODP export regression: fix lost shape at missing object

If the object is missing, it's still possible to keep its shape
by exporting its preview graphic, as before the regression.

Regression from commit adc042f95d3dbd65b778260025d59283146916e5
"tdf#124333 PPTX import: fix Z-order of embedded OLE objects".

See also commit 907da02bf8b33c080538731864225b3c44251328
"tdf#152436 PPTX export regression: fix lost shape at missing object"

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index a7915dcc4c23..1878bf11e706 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -103,6 +103,7 @@ public:
 void testTdf112126();
 void testCellProperties();
 void testUserTableStyles();
+void testTdf153179();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -156,6 +157,7 @@ public:
 CPPUNIT_TEST(testTdf112126);
 CPPUNIT_TEST(testCellProperties);
 CPPUNIT_TEST(testUserTableStyles);
+CPPUNIT_TEST(testTdf153179);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -1861,6 +1863,15 @@ void SdExportTest::testUserTableStyles()
 CPPUNIT_ASSERT(xTableStyle->isUserDefined());
 }
 
+void SdExportTest::testTdf153179()
+{
+createSdImpressDoc("pptx/ole-emf_min.pptx");
+saveAndReload("impress8");
+
+// Check number of shapes after export.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getPage(0)->getCount());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index 3e0786e6ea77..f972c389a396 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -3011,6 +3011,51 @@ void XMLShapeExport::ImpExportOLE2Shape(
 mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, 
XML_EMBED );
 mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, 
XML_ONLOAD );
 }
+else
+{
+// tdf#153179 Export the preview graphic of the object if 
the object is missing.
+uno::Reference xGraphic;
+xPropSet->getPropertyValue("Graphic") >>= xGraphic;
+
+if (xGraphic.is())
+{
+OUString aMimeType;
+const OUString aHref = 
mrExport.AddEmbeddedXGraphic(xGraphic, aMimeType);
+
+if (aMimeType.isEmpty())
+mrExport.GetGraphicMimeTypeFromStream(xGraphic, 
aMimeType);
+
+if (!aHref.isEmpty())
+{
+mrExport.AddAttribute(XML_NAMESPACE_XLINK, 
XML_HREF, aHref);
+mrExport.AddAttribute(XML_NAMESPACE_XLINK, 
XML_TYPE, XML_SIMPLE);
+mrExport.AddAttribute(XML_NAMESPACE_XLINK, 
XML_SHOW, XML_EMBED);
+mrExport.AddAttribute(XML_NAMESPACE_XLINK, 
XML_ACTUATE, XML_ONLOAD);
+}
+
+if (!aMimeType.isEmpty()
+&& GetExport().getSaneDefaultVersion() > 
SvtSaveOptions::ODFSVER_012)
+{ // ODF 1.3 OFFICE-3943
+mrExport.AddAttribute(SvtSaveOptions::ODFSVER_013
+  <= 
GetExport().getSaneDefaultVersion()
+  ? XML_NAMESPACE_DRAW
+  : XML_NAMESPACE_LO_EXT,
+  "mime-type", aMimeType);
+}
+
+SvXMLElementExport aImageElem(mrExport, 
XML_NAMESPACE_DRAW, XML_IMAGE, true,
+  true);
+
+// optional office:binary-data
+mrExport.AddEmbeddedXGraphicAsBase64(xGraphic);
+
+ImpExportEvents(xShape);
+ImpExportGluePoints(xShape);
+ImpExportDescription(xShape);
+
+return;
+}
+}
 }
 }
 


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

2023-01-30 Thread Xisco Fauli (via logerrit)
 sd/qa/uitest/impress_tests2/tdf148810.py |   54 ---
 sd/qa/unit/uiimpress.cxx |   31 +
 2 files changed, 31 insertions(+), 54 deletions(-)

New commits:
commit 2c99e7737ef2b536a4d9f28c3ddd37fe6afa9ceb
Author: Xisco Fauli 
AuthorDate: Mon Jan 30 16:34:09 2023 +0100
Commit: Xisco Fauli 
CommitDate: Mon Jan 30 18:23:57 2023 +

tdf#148810: sd: move UItest to CppUnittest

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

diff --git a/sd/qa/uitest/impress_tests2/tdf148810.py 
b/sd/qa/uitest/impress_tests2/tdf148810.py
deleted file mode 100755
index 6ae79b8e1670..
--- a/sd/qa/uitest/impress_tests2/tdf148810.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# This file is part of the LibreOffice project.
-#
-# 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.uihelper.common import get_state_as_dict, get_url_for_data_file
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.framework import UITestCase
-
-
-class Tdf148810(UITestCase):
-
-def test_Tdf148810(self):
-with 
self.ui_test.load_file(get_url_for_data_file("tdf148810_PARA_OUTLLEVEL.pptx")):
-document = self.ui_test.get_component()
-
-xDoc = self.xUITest.getTopFocusWindow()
-xEditWin = xDoc.getChild("impress_win")
-
-xEditWin.executeAction("SELECT", 
mkPropertyValues({"OBJECT":"TextShape 2"}))
-
-# type something to get into text editing mode (instead of shape 
selection).
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
-#time.sleep(2)
-
-# get to the front of the text (behind the bullet point)
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"HOME"}))
-# remove the numbering bullet point
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"BACKSPACE"}))
-
-#xShape = xEditWin.getChild("TextShape 2")
-#print(xShape)
-#print(xShape.getChildren())
-#print(get_state_as_dict(xShape))
-#print(dir(xShape)
-
-xText = 
document.DrawPages[0].getByIndex(1).createEnumeration().nextElement()
-#print(xText)
-# this is the first numbering level (as opposed to either -1 or 
None for no numbering)
-self.assertEqual(0, xText.NumberingLevel)
-#time.sleep(2)
-
-self.xUITest.executeCommand(".uno:Undo")
-#time.sleep(2)
-
-xText = 
document.DrawPages[0].getByIndex(1).createEnumeration().nextElement()
-# This was failing with "None"
-self.assertEqual(0, xText.NumberingLevel)
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/qa/uitest/data/tdf148810_PARA_OUTLLEVEL.pptx 
b/sd/qa/unit/data/pptx/tdf148810_PARA_OUTLLEVEL.pptx
similarity index 100%
rename from sd/qa/uitest/data/tdf148810_PARA_OUTLLEVEL.pptx
rename to sd/qa/unit/data/pptx/tdf148810_PARA_OUTLLEVEL.pptx
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 57d504ae47b7..e311087673ab 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -1114,6 +1114,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf153161)
 CPPUNIT_ASSERT_EQUAL(sExpectedText, xShape->getString());
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf148810)
+{
+createSdImpressDoc("pptx/tdf148810_PARA_OUTLLEVEL.pptx");
+
+// type something to get into text editing mode (instead of shape 
selection).
+insertStringToObject(1, u"x", /*bUseEscape*/ false);
+
+auto pXImpressDocument = 
dynamic_cast(mxComponent.get());
+typeKey(pXImpressDocument, KEY_HOME);
+
+typeKey(pXImpressDocument, KEY_BACKSPACE);
+
+uno::Reference xShape(getShapeFromPage(1, 0));
+uno::Reference xParagraph(getParagraphFromShape(0, 
xShape));
+uno::Reference xPropSet(xParagraph, 
uno::UNO_QUERY_THROW);
+sal_Int16 nNumberingLevel = -1;
+xPropSet->getPropertyValue("NumberingLevel") >>= nNumberingLevel;
+CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nNumberingLevel);
+
+dispatchCommand(mxComponent, ".uno:Undo", {});
+Scheduler::ProcessEventsToIdle();
+
+nNumberingLevel = -1;
+xPropSet->getPropertyValue("NumberingLevel") >>= nNumberingLevel;
+
+// Without the fix in place, this test would have failed with
+// - Expected: 0
+// - Actual  : -1
+CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nNumberingLevel);
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 {
 createSdImpressDoc();


[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

2023-01-26 Thread Xisco Fauli (via logerrit)
 sd/qa/uitest/impress_tests2/tdf153161.py |   37 ---
 sd/qa/unit/uiimpress.cxx |   23 +++
 2 files changed, 23 insertions(+), 37 deletions(-)

New commits:
commit 40d76def20bc3ae5ab7db88fef2688ce1664fa15
Author: Xisco Fauli 
AuthorDate: Thu Jan 26 09:49:15 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 26 10:38:10 2023 +

tdf#153161: sd: move UItest to CppUnittest

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

diff --git a/sd/qa/uitest/impress_tests2/tdf153161.py 
b/sd/qa/uitest/impress_tests2/tdf153161.py
deleted file mode 100644
index db14d7986f5b..
--- a/sd/qa/uitest/impress_tests2/tdf153161.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# This file is part of the LibreOffice project.
-#
-# 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 libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.framework import UITestCase
-from uitest.uihelper.common import get_url_for_data_file
-
-class TestTdf153161(UITestCase):
-
-def testTdf153161(self):
-url = get_url_for_data_file('tdf153161_FlushToSave.odp')
-
-with self.ui_test.load_file(url) as document:
-oldText = document.DrawPages[0].getByIndex(1).String
-self.assertTrue(oldText.startswith('在没有版本控制系统的时期'))
-
-xImpressDoc = self.xUITest.getTopFocusWindow()
-xEditWin = xImpressDoc.getChild('impress_win')
-xEditWin.executeAction('SELECT', 
mkPropertyValues({'OBJECT':'Unnamed Drawinglayer object 1'}))
-
-# Type something, getting into text editing mode (appending) 
automatically
-xEditWin.executeAction('TYPE', mkPropertyValues({'TEXT': 'Foo 
Bar'}))
-xToolkit = 
self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
-xToolkit.processEventsToIdle()
-self.xUITest.executeCommand('.uno:Save')
-
-# Reload and check that the edit was saved
-with self.ui_test.load_file(url) as document:
-self.assertEqual(oldText + 'Foo Bar', 
document.DrawPages[0].getByIndex(1).String)
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/qa/uitest/data/tdf153161_FlushToSave.odp 
b/sd/qa/unit/data/odp/tdf153161_FlushToSave.odp
similarity index 100%
rename from sd/qa/uitest/data/tdf153161_FlushToSave.odp
rename to sd/qa/unit/data/odp/tdf153161_FlushToSave.odp
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 5655e58c0700..57d504ae47b7 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -1091,6 +1091,29 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testFillColorNoColor)
 pDispatcher->ExecuteList(SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, { 
 });
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf153161)
+{
+createSdImpressDoc("odp/tdf153161_FlushToSave.odp");
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape(xDrawPage->getByIndex(1), 
uno::UNO_QUERY);
+OUString sOldText(xShape->getString());
+CPPUNIT_ASSERT(sOldText.startsWith(u"在没有版本控制系统的时期"));
+
+// Type something, getting into text editing mode (appending) automatically
+insertStringToObject(1, u"Foo Bar", /*bUseEscape*/ false);
+
+saveAndReload("impress8");
+
+xDrawPagesSupplier.set(mxComponent, uno::UNO_QUERY);
+xDrawPage.set(xDrawPagesSupplier->getDrawPages()->getByIndex(0), 
uno::UNO_QUERY);
+xShape.set(xDrawPage->getByIndex(1), uno::UNO_QUERY);
+OUString sExpectedText = sOldText + "Foo Bar";
+CPPUNIT_ASSERT_EQUAL(sExpectedText, xShape->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 {
 createSdImpressDoc();


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

2023-01-24 Thread Mike Kaganski (via logerrit)
 sd/qa/uitest/data/tdf153161_FlushToSave.odp |binary
 sd/qa/uitest/impress_tests2/tdf153161.py|   37 
 xmloff/source/draw/shapeexport.cxx  |   12 +
 3 files changed, 49 insertions(+)

New commits:
commit d183daea1abbd7b564d083298874dd7c40d5a5b3
Author: Mike Kaganski 
AuthorDate: Wed Jan 25 01:37:00 2023 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jan 25 07:25:16 2023 +

tdf#153161: (Ab)use a call to XTextRange::getString to flush edits

Restore the call (without checking its returned value), removed in commit
d194474aabd699806cb3631bc8641dd0548b8026 ("tdf#151100: xText->getString()
may be empty for content needing export", 2022-09-22), side effects of
which obviously allow some object's changes to get flushed and saved.

Change-Id: I62f27cd056c32ad76f79a4862e2f4a0964eaadef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146106
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/sd/qa/uitest/data/tdf153161_FlushToSave.odp 
b/sd/qa/uitest/data/tdf153161_FlushToSave.odp
new file mode 100644
index ..1fd5c20c2a52
Binary files /dev/null and b/sd/qa/uitest/data/tdf153161_FlushToSave.odp differ
diff --git a/sd/qa/uitest/impress_tests2/tdf153161.py 
b/sd/qa/uitest/impress_tests2/tdf153161.py
new file mode 100644
index ..db14d7986f5b
--- /dev/null
+++ b/sd/qa/uitest/impress_tests2/tdf153161.py
@@ -0,0 +1,37 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+
+class TestTdf153161(UITestCase):
+
+def testTdf153161(self):
+url = get_url_for_data_file('tdf153161_FlushToSave.odp')
+
+with self.ui_test.load_file(url) as document:
+oldText = document.DrawPages[0].getByIndex(1).String
+self.assertTrue(oldText.startswith('在没有版本控制系统的时期'))
+
+xImpressDoc = self.xUITest.getTopFocusWindow()
+xEditWin = xImpressDoc.getChild('impress_win')
+xEditWin.executeAction('SELECT', 
mkPropertyValues({'OBJECT':'Unnamed Drawinglayer object 1'}))
+
+# Type something, getting into text editing mode (appending) 
automatically
+xEditWin.executeAction('TYPE', mkPropertyValues({'TEXT': 'Foo 
Bar'}))
+xToolkit = 
self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+xToolkit.processEventsToIdle()
+self.xUITest.executeCommand('.uno:Save')
+
+# Reload and check that the edit was saved
+with self.ui_test.load_file(url) as document:
+self.assertEqual(oldText + 'Foo Bar', 
document.DrawPages[0].getByIndex(1).String)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index 39d9eabb5971..3e0786e6ea77 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -310,6 +310,18 @@ void XMLShapeExport::collectShapeAutoStyles(const 
uno::Reference< drawing::XShap
 uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
 if (xText.is())
 {
+try
+{
+// tdf#153161: it seems that the call to XTextRange::getString 
flushes the changes
+// for some objects, that otherwise fail to get exported 
correctly. Maybe at some
+// point it would make sense to find a better place for more 
targeted flush.
+xText->getString();
+}
+catch (uno::RuntimeException const&)
+{
+// E.g., SwXTextFrame that contains only a table will throw; 
this is not an error
+}
+
 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( 
xPropSet->getPropertySetInfo() );
 
 if( xPropSetInfo.is() && 
xPropSetInfo->hasPropertyByName("IsEmptyPresentationObject") )


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

2023-01-20 Thread Caolán McNamara (via logerrit)
 sd/qa/unit/data/pptx/tdf125573_FontWorkScaleX.pptx |binary
 sd/qa/unit/export-tests-ooxml3.cxx |5 +++--
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit bb3ddcf7ae63879f50c9e88fcc01003e66c7288b
Author: Caolán McNamara 
AuthorDate: Thu Jan 19 20:39:06 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 20 10:47:41 2023 +

change test to use Calibri instead of Cambria

because of the Caladea problem

There are sadly now two Caladea fonts with different metrics, see:
 https://bugzilla.redhat.com/show_bug.cgi?id=2162532
 https://github.com/huertatipografica/Caladea/issues/4

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

diff --git a/sd/qa/unit/data/pptx/tdf125573_FontWorkScaleX.pptx 
b/sd/qa/unit/data/pptx/tdf125573_FontWorkScaleX.pptx
index e8d1938a2308..28672eb4b7f3 100644
Binary files a/sd/qa/unit/data/pptx/tdf125573_FontWorkScaleX.pptx and 
b/sd/qa/unit/data/pptx/tdf125573_FontWorkScaleX.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 309709317821..db023bef2592 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -748,14 +748,15 @@ void SdOOXMLExportTest3::testTdf125573_FontWorkScaleX()
 awt::Rectangle aBoundRectArch;
 xShapeArchProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= 
aBoundRectArch;
 // BoundRect is DPI dependent, thus allow some range.
-CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectArch.Width - 13038));
+// (Without fix Expected less than: 85 Actual  : 10432)
+CPPUNIT_ASSERT_LESS(sal_Int32(85), std::abs(aBoundRectArch.Width - 13038));
 
 // Error was, that text in shapes of category "Warp" was not scaled to the 
path.
 uno::Reference xShapeWaveProps(getShapeFromPage(0, 
1));
 awt::Rectangle aBoundRectWave;
 xShapeWaveProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= 
aBoundRectWave;
 // BoundRect is DPI dependent, thus allow some range.
-CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectWave.Width - 11576));
+CPPUNIT_ASSERT_LESS(sal_Int32(85), std::abs(aBoundRectWave.Width - 11576));
 }
 
 void SdOOXMLExportTest3::testTdf99497_keepAppearanceOfCircleKind()


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

2023-01-02 Thread Caolán McNamara (via logerrit)
 sd/qa/unit/uiimpress.cxx |2 +-
 svx/sdi/svx.sdi  |   16 
 sw/sdi/swriter.sdi   |4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit cc4ead451cb3b6ce6994370b3a9263756ea284d1
Author: Caolán McNamara 
AuthorDate: Thu Dec 29 19:37:57 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Jan 2 19:04:31 2023 +

Resolves: tdf#150339 two arguments called "Color"

from around:

commit 780d83771af89e6b27b3618d9c033c3fb29ba803
Date:   Mon Nov 4 17:17:58 2019 +0100

jsdialogs: .uno:Color with string argument

and:

commit 1144712bb99cfb699e73b473ee44351c50a35613
Date:   Mon Oct 28 10:19:50 2019 +0100

jsdialogs: make possible to set .uno:BackgroundColor in Writer

SvxColorItem Color SID_ATTR_CHAR_COLOR
(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem Color 
SID_ATTR_CHAR_COLOR,...
   ^  ^

rename the most recently added to "ColorString"

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

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 13f072cf2488..0235cada8194 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -757,7 +757,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillColor)
 // Set FillPageColor
 
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
-{ "Color", uno::Any(OUString("ff")) },
+{ "ColorString", uno::Any(OUString("ff")) },
 }));
 
 dispatchCommand(mxComponent, ".uno:FillPageColor", aPropertyValues);
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index d1f02f5b1d3b..f2e040712566 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -408,7 +408,7 @@ SfxVoidItem TableDesign SID_TABLEDESIGN
 ]
 
 SvxColorItem BackgroundColor SID_BACKGROUND_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem BackgroundColor 
SID_BACKGROUND_COLOR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem BackgroundColor 
SID_BACKGROUND_COLOR)
 
 [
 AutoUpdate = TRUE,
@@ -1506,7 +1506,7 @@ SfxVoidItem ClearOutline SID_OUTLINE_DELETEALL
 
 
 SvxColorItem Color SID_ATTR_CHAR_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem Color 
SID_ATTR_CHAR_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, 
SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff 
SID_ATTR_COLOR_LUM_OFF)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem Color 
SID_ATTR_CHAR_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,
@@ -1524,7 +1524,7 @@ SvxColorItem Color SID_ATTR_CHAR_COLOR
 ]
 
 SvxColorItem CharBackColor SID_ATTR_CHAR_BACK_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem CharBackColor 
SID_ATTR_CHAR_BACK_COLOR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem CharBackColor 
SID_ATTR_CHAR_BACK_COLOR)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,
@@ -2798,7 +2798,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, 
SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff 
SID_ATTR_COLOR_LUM_OFF)
+(SfxStringItem ColorString 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,
@@ -2816,7 +2816,7 @@ XFillColorItem FillColor SID_ATTR_FILL_COLOR
 ]
 
 XFillColorItem FillPageColor SID_ATTR_PAGE_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR)
 [
 /* flags: */
 AutoUpdate = TRUE,
@@ -5677,7 +5677,7 @@ SfxVoidItem ArrowsToolbox SID_DRAWTBX_ARROWS
 ]
 
 SvxColorItem FrameLineColor SID_FRAME_LINECOLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem FrameLineColor 
SID_FRAME_LINECOLOR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem FrameLineColor 
SID_FRAME_LINECOLOR)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,
@@ -7874,7 +7874,7 @@ SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
 ]
 
 XColorItem FillShadowColor SID_ATTR_SHADOW_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR)
 [
 
 AutoUpdate = TRUE,
@@ -9118,7 +9118,7 @@ SvxWordLineModeItem WordMode SID_ATTR_CHAR_WORDLINEMODE
 
 
 XLineColorItem XLineColor SID_ATTR_LINE_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, XLineColorItem XLineColor 

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

2022-12-21 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/data/pptx/tdf152606.pptx |binary
 sd/qa/unit/export-tests.cxx |   14 ++
 2 files changed, 14 insertions(+)

New commits:
commit 47f66915f8d8f2418811417ad4b1109f31dee492
Author: Xisco Fauli 
AuthorDate: Wed Dec 21 10:51:47 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 21 17:34:50 2022 +

tdf#152606: sd_export_tests: Add unittest

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

diff --git a/sd/qa/unit/data/pptx/tdf152606.pptx 
b/sd/qa/unit/data/pptx/tdf152606.pptx
new file mode 100644
index ..6b4c756d11a8
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf152606.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 9b5c73bd43f3..a7915dcc4c23 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -94,6 +94,7 @@ public:
 void testSoftEdges();
 void testShadowBlur();
 void testRhbz1870501();
+void testTdf152606();
 void testTdf91060();
 void testTdf128550();
 void testTdf140714();
@@ -146,6 +147,7 @@ public:
 CPPUNIT_TEST(testSoftEdges);
 CPPUNIT_TEST(testShadowBlur);
 CPPUNIT_TEST(testRhbz1870501);
+CPPUNIT_TEST(testTdf152606);
 CPPUNIT_TEST(testTdf91060);
 CPPUNIT_TEST(testTdf128550);
 CPPUNIT_TEST(testTdf140714);
@@ -1496,6 +1498,18 @@ void SdExportTest::testRhbz1870501()
 saveAndReload("draw8");
 }
 
+void SdExportTest::testTdf152606()
+{
+//Without the fix in place, it would crash at import time
+createSdImpressDoc("pptx/tdf152606.pptx");
+saveAndReload("Impress Office Open XML");
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
+}
+
 void SdExportTest::testTdf91060()
 {
 //Without the fix in place, it would crash at import time


[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

2022-12-12 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/sdmodeltestbase.hxx |   19 ---
 1 file changed, 19 deletions(-)

New commits:
commit 2ef1439ae90b3621198728b4e1e67b2e72fc376c
Author: Xisco Fauli 
AuthorDate: Mon Dec 12 18:08:44 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Dec 12 21:54:46 2022 +

SdModelTestBase: remove duplicated template

this is already defined in include/tools/gen.hxx

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

diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 08e3a8e7fbc3..f651419c776b 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -172,23 +172,4 @@ public:
 }
 };
 
-CPPUNIT_NS_BEGIN
-
-template <> struct assertion_traits
-{
-static bool equal(const tools::Rectangle& r1, const tools::Rectangle& r2) 
{ return r1 == r2; }
-
-static std::string toString(const tools::Rectangle& r)
-{
-OStringStream ost;
-ost << "Rect P: [" << r.Top() << ", " << r.Left()
-<< "] "
-   "S: ["
-<< r.GetWidth() << ", " << r.GetHeight() << "]";
-return ost.str();
-}
-};
-
-CPPUNIT_NS_END
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-12-08 Thread Bogdan B (via logerrit)
 sd/qa/uitest/findReplace/findReplace.py |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 15e94efb87118b0ceb4aa926181a8906259f369b
Author: Bogdan B 
AuthorDate: Fri Nov 11 20:08:01 2022 +0200
Commit: Hossein 
CommitDate: Thu Dec 8 22:55:49 2022 +

tdf#132293 remove unused imports from uitest

Change-Id: I6f5b5d97dab27986a6b0046c42c20ec4d0527980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142531
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sd/qa/uitest/findReplace/findReplace.py 
b/sd/qa/uitest/findReplace/findReplace.py
index 0e4bd4c12f73..130765a865bb 100644
--- a/sd/qa/uitest/findReplace/findReplace.py
+++ b/sd/qa/uitest/findReplace/findReplace.py
@@ -7,11 +7,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, 
type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class findReplace(UITestCase):
 def test_find_impress(self):


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

2022-12-05 Thread Stephan Bergmann (via logerrit)
 sd/qa/unit/import-tests2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9d93e57613fc5e9f67400a166dcce5344c238348
Author: Stephan Bergmann 
AuthorDate: Mon Dec 5 15:52:26 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 5 16:28:47 2022 +

Make sure bHasShadow has a value

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

diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index e704f0bcd783..b258c535e2c6 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -237,7 +237,7 @@ void SdImportTest2::testTdf152186()
 for (size_t i = 0; i < pPage->GetObjCount(); ++i)
 {
 uno::Reference xShape(getShapeFromPage(i, 0));
-xShape->getPropertyValue("Shadow") >>= bHasShadow;
+CPPUNIT_ASSERT(xShape->getPropertyValue("Shadow") >>= bHasShadow);
 CPPUNIT_ASSERT(!bHasShadow);
 }
 }


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

2022-12-01 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/import-tests2.cxx   |2 +-
 sd/qa/unit/sdmodeltestbase.hxx |   11 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit b3291a3c0e64fd759184c29848d4323e1384965e
Author: Xisco Fauli 
AuthorDate: Thu Dec 1 13:46:49 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 1 15:28:46 2022 +0100

sd: check files are loaded without any warning error

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

diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 46d1966a2e1a..e704f0bcd783 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -229,7 +229,7 @@ public:
 
 void SdImportTest2::testTdf152186()
 {
-loadFromURL(u"pptx/tdf152186.pptx");
+createSdImpressDoc("pptx/tdf152186.pptx");
 saveAndReload("Impress MS PowerPoint 2007 XML");
 
 bool bHasShadow;
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 189bdda09718..08e3a8e7fbc3 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -56,6 +56,8 @@ public:
 uno::Reference xServiceInfo(mxComponent, 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT(
 
xServiceInfo->supportsService("com.sun.star.presentation.PresentationDocument"));
+
+CPPUNIT_ASSERT(!getSdDocShell()->GetMedium()->GetWarningError());
 }
 
 void createSdDrawDoc(const char* pName = nullptr, const char* pPassword = 
nullptr)
@@ -67,6 +69,15 @@ public:
 
 uno::Reference xServiceInfo(mxComponent, 
uno::UNO_QUERY_THROW);
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.DrawingDocument"));
+
+CPPUNIT_ASSERT(!getSdDocShell()->GetMedium()->GetWarningError());
+}
+
+sd::DrawDocShell* getSdDocShell()
+{
+SdXImpressDocument* pImpressDocument = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pImpressDocument);
+return pImpressDocument->GetDocShell();
 }
 
 uno::Reference getPage(int nPage)


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

2022-11-30 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/uiimpress.cxx |   14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 925f9a9111eb8c856869e9b2b9eeb220ab21430d
Author: Xisco Fauli 
AuthorDate: Wed Nov 30 12:40:17 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Nov 30 16:21:02 2022 +0100

CppunitTest_sd_uiimpress: fix asserts

we want to check the number of shapes, not the number
of pages

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

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 32ea8642e2ed..13f072cf2488 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -861,13 +861,12 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf38669)
 Scheduler::ProcessEventsToIdle();
 
 uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
-uno::Reference xDraws = 
xDrawPagesSupplier->getDrawPages();
-CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
 
 typeString(pImpressDocument, u"°");
 
-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: °
@@ -912,14 +911,11 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123841)
 Scheduler::ProcessEventsToIdle();
 
 uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
-uno::Reference xDraws = 
xDrawPagesSupplier->getDrawPages();
-
-int getShapes = xDraws->getCount();
-CPPUNIT_ASSERT_EQUAL(1, getShapes);
-
 uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
  uno::UNO_QUERY);
 
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
+
 for (int i = 0; i < 3; i++)
 {
 uno::Reference XPropSet(xDrawPage->getByIndex(i), 
uno::UNO_QUERY);


[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

2022-11-29 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/SVGExportTests.cxx |4 
 sd/qa/unit/SdrPdfImportTest.cxx   |3 ---
 sd/qa/unit/export-tests-ooxml1.cxx|2 --
 sd/qa/unit/export-tests-ooxml3.cxx|1 -
 sd/qa/unit/export-tests.cxx   |5 +
 sd/qa/unit/import-tests.cxx   |2 --
 sd/qa/unit/import-tests2.cxx  |2 --
 sd/qa/unit/misc-tests.cxx |9 -
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |3 ---
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |3 ---
 sd/qa/unit/uiimpress.cxx  |3 ---
 11 files changed, 1 insertion(+), 36 deletions(-)

New commits:
commit 93651bd3a20f7f4174b1324c8a6b6b33450ead81
Author: Xisco Fauli 
AuthorDate: Tue Nov 29 13:30:32 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Nov 29 14:34:31 2022 +0100

sd: remove unused includes

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

diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index f1c3a8dfc135..a8d64e828a67 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -13,10 +13,6 @@
 #include 
 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx
index 631dcdde3374..87225f66eac2 100644
--- a/sd/qa/unit/SdrPdfImportTest.cxx
+++ b/sd/qa/unit/SdrPdfImportTest.cxx
@@ -14,7 +14,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -26,8 +25,6 @@
 #include 
 #include 
 
-#include 
-
 using namespace css;
 
 namespace
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 3345ca9aac68..d61d0c0991d4 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -28,10 +28,8 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index c58b40b02b78..2e6a600ec686 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 656a69bb41b0..9b5c73bd43f3 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -9,12 +9,11 @@
 
 #include 
 
-#include 
-
 #include 
 #include "sdmodeltestbase.hxx"
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -23,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -36,7 +34,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index ba05f2a589cd..3f3aafcbe0e8 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -49,7 +49,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -61,7 +60,6 @@
 #include 
 #include 
 #include 
-#include 
 
 using namespace ::com::sun::star;
 
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index ad573c3fc8ef..43ea5583a579 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -20,7 +20,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -48,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 6aefd4ba7d38..bc741c6ac2fe 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -13,12 +13,7 @@
 
 #include 
 
-#include 
-#include 
-#include 
-
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -27,14 +22,12 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -57,7 +49,6 @@
 #include 
 #include 
 #include 
-#include 
 
 using namespace ::com::sun::star;
 
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 3d6d74d6702b..5e578218c659 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -13,7 +13,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -28,8 +27,6 @@
 #include 
 #include 
 
-#include 
-
 using namespace css;
 
 class LOKitSearchTest : public UnoApiTest
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index c1a8890cf5a4..36ead01c3fb4 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ 

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

2022-11-29 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 90a37bbaec71d2b551d98f630fc61b9ccfe714ad
Author: Xisco Fauli 
AuthorDate: Tue Nov 29 12:45:03 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Nov 29 14:23:30 2022 +0100

sd: test exporting to odg with password protection

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 4e781dd2d05c..656a69bb41b0 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -62,6 +62,7 @@ public:
 void testFdo84043();
 void testTdf97630();
 void testImpressPasswordExport();
+void testDrawPasswordExport();
 void testSwappedOutImageExport();
 void testOOoXMLAnimations();
 void testBnc480256();
@@ -113,6 +114,7 @@ public:
 CPPUNIT_TEST(testFdo84043);
 CPPUNIT_TEST(testTdf97630);
 CPPUNIT_TEST(testImpressPasswordExport);
+CPPUNIT_TEST(testDrawPasswordExport);
 CPPUNIT_TEST(testSwappedOutImageExport);
 CPPUNIT_TEST(testOOoXMLAnimations);
 CPPUNIT_TEST(testBnc480256);
@@ -526,6 +528,13 @@ void SdExportTest::testImpressPasswordExport()
 }
 }
 
+void SdExportTest::testDrawPasswordExport()
+{
+createSdDrawDoc();
+
+saveAndReload("draw8", /*pPassword*/ "test");
+}
+
 void SdExportTest::testSwappedOutImageExport()
 {
 // Problem was with the swapped out images, which were not swapped in 
during export.


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

2022-11-29 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests.cxx |   14 ++
 test/source/unoapi_test.cxx |3 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 958c08ad86d56839faf28a02097500bad7b1eb76
Author: Xisco Fauli 
AuthorDate: Tue Nov 29 12:29:43 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Nov 29 14:04:50 2022 +0100

sd: test exporting to odp/pptx with password protection

exporting to ppt with password protection is not supported

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index a6efbee97477..4e781dd2d05c 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -61,6 +61,7 @@ public:
 void testFillBitmapUnused();
 void testFdo84043();
 void testTdf97630();
+void testImpressPasswordExport();
 void testSwappedOutImageExport();
 void testOOoXMLAnimations();
 void testBnc480256();
@@ -111,6 +112,7 @@ public:
 CPPUNIT_TEST(testFillBitmapUnused);
 CPPUNIT_TEST(testFdo84043);
 CPPUNIT_TEST(testTdf97630);
+CPPUNIT_TEST(testImpressPasswordExport);
 CPPUNIT_TEST(testSwappedOutImageExport);
 CPPUNIT_TEST(testOOoXMLAnimations);
 CPPUNIT_TEST(testBnc480256);
@@ -512,6 +514,18 @@ void SdExportTest::testTdf97630()
 1);
 }
 
+void SdExportTest::testImpressPasswordExport()
+{
+std::vector vFormat{ "impress8", "Impress Office Open XML" };
+
+for (size_t i = 0; i < vFormat.size(); i++)
+{
+createSdImpressDoc();
+
+saveAndReload(vFormat[i], /*pPassword*/ "test");
+}
+}
+
 void SdExportTest::testSwappedOutImageExport()
 {
 // Problem was with the swapped out images, which were not swapped in 
during export.
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index 60c010c17e98..e8198876537a 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -152,7 +152,8 @@ void UnoApiTest::save(const OUString& rFilter, const char* 
pPassword)
 
 if (pPassword)
 {
-if (rFilter != "Office Open XML Text" && rFilter != "Calc Office Open 
XML")
+if (rFilter != "Office Open XML Text" && rFilter != "Calc Office Open 
XML"
+&& rFilter != "Impress Office Open XML")
 {
 aMediaDescriptor["Password"] <<= 
OUString::createFromAscii(pPassword);
 }


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

2022-11-29 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/ShapeImportExportTest.cxx  |8 -
 sd/qa/unit/activex-controls-tests.cxx |   26 ++---
 sd/qa/unit/export-tests-ooxml1.cxx|  142 +--
 sd/qa/unit/export-tests-ooxml2.cxx|  140 +--
 sd/qa/unit/export-tests-ooxml3.cxx|  174 +-
 sd/qa/unit/export-tests.cxx   |   96 +-
 sd/qa/unit/import-tests-smartart.cxx  |   98 +--
 sd/qa/unit/import-tests.cxx   |  134 +-
 sd/qa/unit/import-tests2.cxx  |  146 ++--
 sd/qa/unit/misc-tests.cxx |   45 
 sd/qa/unit/sdmodeltestbase.hxx|   23 
 sd/qa/unit/uiimpress.cxx  |   85 ++--
 12 files changed, 562 insertions(+), 555 deletions(-)

New commits:
commit 9022e69b4ceb3c8986a3b8637a661baeebef587a
Author: Xisco Fauli 
AuthorDate: Tue Nov 29 11:54:25 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Nov 29 13:48:29 2022 +0100

SdModelTestBase: introduce createSdImpressDoc and createSdDrawDoc

it turned out shadow-blur.odg is instead a presentation file

Change-Id: Ifcf3f7a76dd823bea4937927888648008ef6206d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143457
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/unit/ShapeImportExportTest.cxx 
b/sd/qa/unit/ShapeImportExportTest.cxx
index fa18a184f384..4810cb2ab134 100644
--- a/sd/qa/unit/ShapeImportExportTest.cxx
+++ b/sd/qa/unit/ShapeImportExportTest.cxx
@@ -63,7 +63,7 @@ SdrObject* searchObject(SdrPage const* pPage, 
std::u16string_view rName)
 /* Test text distances (insets) */
 void ShapeImportExportTest::testTextDistancesOOXML()
 {
-loadFromURL(u"TextDistancesInsets1.pptx");
+createSdImpressDoc("TextDistancesInsets1.pptx");
 
 SdrPage const* pPage = GetPage(1);
 // Bottom Margin = 4cm
@@ -172,7 +172,7 @@ void ShapeImportExportTest::testTextDistancesOOXML()
 /* Test text distances (insets) variants where top+bottom margin > text area*/
 void 
ShapeImportExportTest::testTextDistancesOOXML_LargerThanTextAreaSpecialCase()
 {
-loadFromURL(u"TextDistancesInsets2.pptx");
+createSdImpressDoc("TextDistancesInsets2.pptx");
 
 SdrPage const* pPage = GetPage(1);
 
@@ -260,7 +260,7 @@ void 
ShapeImportExportTest::testTextDistancesOOXML_LargerThanTextAreaSpecialCase
 /* Test export of text distances (insets) - conversion back of special case */
 void ShapeImportExportTest::testTextDistancesOOXML_Export()
 {
-loadFromURL(u"TextDistancesInsets3.pptx");
+createSdImpressDoc("TextDistancesInsets3.pptx");
 
 save("Impress Office Open XML");
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
@@ -373,7 +373,7 @@ void ShapeImportExportTest::testTextDistancesOOXML_Export()
 
 void ShapeImportExportTest::testTextDistancesODP_OOXML_Export()
 {
-loadFromURL(u"odp/tdf150966_hugeInset.odp");
+createSdImpressDoc("odp/tdf150966_hugeInset.odp");
 save("Impress Office Open XML");
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
 CPPUNIT_ASSERT(pXmlDoc);
diff --git a/sd/qa/unit/activex-controls-tests.cxx 
b/sd/qa/unit/activex-controls-tests.cxx
index 20f1025bf4a2..ec40a5981f80 100644
--- a/sd/qa/unit/activex-controls-tests.cxx
+++ b/sd/qa/unit/activex-controls-tests.cxx
@@ -68,7 +68,7 @@ public:
 void SdActiveXControlsTest::testBackgroundColor()
 {
 // Check whether all system colors are imported correctly
-loadFromURL(u"pptx/control_background_color.pptx");
+createSdImpressDoc("pptx/control_background_color.pptx");
 
 const std::vector vBackgroundColors =
 {
@@ -114,7 +114,7 @@ void SdActiveXControlsTest::testBackgroundColor()
 
 void SdActiveXControlsTest::testLabelProperties()
 {
-loadFromURL(u"pptx/activex_label.pptx");
+createSdImpressDoc("pptx/activex_label.pptx");
 
 // First control has default properties
 uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 
0), uno::UNO_QUERY_THROW);
@@ -192,7 +192,7 @@ void SdActiveXControlsTest::testLabelProperties()
 
 void SdActiveXControlsTest::testTextBoxProperties()
 {
-loadFromURL(u"pptx/activex_textbox.pptx");
+createSdImpressDoc("pptx/activex_textbox.pptx");
 
 // First control has default properties
 uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 
0), uno::UNO_QUERY_THROW);
@@ -327,7 +327,7 @@ void SdActiveXControlsTest::testTextBoxProperties()
 
 void SdActiveXControlsTest::testSpinButtonProperties()
 {
-loadFromURL(u"pptx/activex_spinbutton.pptx");
+createSdImpressDoc("pptx/activex_spinbutton.pptx");
 
 // First control has default properties
 uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 
0), uno::UNO_QUERY_THROW);
@@ -417,7 +417,7 @@ void SdActiveXControlsTest::testSpinButtonProperties()
 
 void SdActiveXControlsTest::testCommandButtonProperties()
 

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

2022-11-25 Thread Mike Kaganski (via logerrit)
 sd/qa/unit/layout-tests.cxx |4 +-
 sw/qa/extras/uiwriter/uiwriter3.cxx |   50 ++--
 2 files changed, 22 insertions(+), 32 deletions(-)

New commits:
commit 66e93c7a74af4d7078762ef4f2071e2f8ae15c27
Author: Mike Kaganski 
AuthorDate: Fri Nov 25 19:25:23 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Nov 25 18:59:02 2022 +0100

Simplification

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

diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index d2bf22622885..36293f2dcfe2 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -72,8 +72,8 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf146876)
 {
 const OString xPath = "/metafile/push[1]/push[1]/push[" + 
OString::number(i)
   + "]/polyline/point[" + OString::number(j) + 
"]";
-const sal_Int32 nX = getXPath(pXmlDoc, xPath.getStr(), 
"x").toInt32();
-const sal_Int32 nY = getXPath(pXmlDoc, xPath.getStr(), 
"y").toInt32();
+const sal_Int32 nX = getXPath(pXmlDoc, xPath, "x").toInt32();
+const sal_Int32 nY = getXPath(pXmlDoc, xPath, "y").toInt32();
 
 // Without the fix in place, this test would have failed with
 // - Expected greater or equal than: 5000
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index ebdce194e9cd..f1b50f047234 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -401,35 +401,30 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126)
 for (auto nFly = 1; nFly < 8; ++nFly)
 {
 const auto nFlyLeft = getXPath(pLayoutXML1,
-   
OString::Concat("/root/page/body/txt[2]/anchored/fly[")
-   + 
OString::Concat(OString::number(nFly))
-   + OString::Concat("]/infos/bounds"),
+   "/root/page/body/txt[2]/anchored/fly["
+   + OString::number(nFly) + 
"]/infos/bounds",
"left")
   .toInt64();
 const auto nFlyRight = getXPath(pLayoutXML1,
-
OString::Concat("/root/page/body/txt[2]/anchored/fly[")
-+ 
OString::Concat(OString::number(nFly))
-+ 
OString::Concat("]/infos/bounds"),
+"/root/page/body/txt[2]/anchored/fly["
++ OString::number(nFly) + 
"]/infos/bounds",
 "width")
.toInt64();
 const auto nFlyTop = getXPath(pLayoutXML1,
-  
OString::Concat("/root/page/body/txt[2]/anchored/fly[")
-  + 
OString::Concat(OString::number(nFly))
-  + OString::Concat("]/infos/bounds"),
+  "/root/page/body/txt[2]/anchored/fly[" + 
OString::number(nFly)
+  + "]/infos/bounds",
   "top")
  .toInt64();
 const auto nFlyBottom = getXPath(pLayoutXML1,
- 
OString::Concat("/root/page/body/txt[2]/anchored/fly[")
- + 
OString::Concat(OString::number(nFly))
- + 
OString::Concat("]/infos/bounds"),
+ "/root/page/body/txt[2]/anchored/fly["
+ + OString::number(nFly) + 
"]/infos/bounds",
  "height")
 .toInt64();
 
 const auto sDrawRect = getXPath(
 pLayoutXML1,
-
OString::Concat("/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/SdrObjGroup/"
-"SdrObjList/SdrObject[")
-+ OString::Concat(OString::number(nFly)) + 
OString::Concat("]"),
+
"/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject["
++ OString::number(nFly) + "]",
 "aOutRect");
 
 const auto nComaPos1 = sDrawRect.indexOf(',', 0);
@@ -465,35 +460,30 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126)
 for (auto nFly = 1; nFly < 8; ++nFly)
 {
 const auto nFlyLeft = getXPath(pLayoutXML2,
-   
OString::Concat("/root/page/body/txt[6]/anchored/fly[")
-

[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 uitest/uitest

2022-11-15 Thread Bogdan B (via logerrit)
 sd/qa/uitest/impress_tests/autocorrectOptions.py |2 +-
 sd/qa/uitest/impress_tests/exportToPDF.py|3 ++-
 sd/qa/uitest/impress_tests/insertSlide.py|5 +
 sd/qa/uitest/impress_tests/masterElements.py |4 +---
 sd/qa/uitest/impress_tests/tdf134734.py  |3 +--
 sd/qa/uitest/impress_tests2/tdf127900.py |4 +++-
 sd/qa/uitest/impress_tests2/tdf139511.py |1 -
 sd/qa/uitest/impress_tests2/tdf148810.py |1 -
 uitest/uitest/uihelper/testDialog.py |2 +-
 9 files changed, 10 insertions(+), 15 deletions(-)

New commits:
commit eedb077f8860e02838b37d75c230e51cd290a283
Author: Bogdan B 
AuthorDate: Fri Nov 11 20:14:10 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Nov 15 17:41:46 2022 +0100

tdf#132293 remove unused imports from uitest

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

diff --git a/sd/qa/uitest/impress_tests/autocorrectOptions.py 
b/sd/qa/uitest/impress_tests/autocorrectOptions.py
index a79facecc204..2f4b7645e30c 100644
--- a/sd/qa/uitest/impress_tests/autocorrectOptions.py
+++ b/sd/qa/uitest/impress_tests/autocorrectOptions.py
@@ -10,9 +10,9 @@
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
-import time
 from uitest.uihelper.common import select_pos
 
+
 class autocorrectOptions(UITestCase):
 
def test_autocorrect_options_impress(self):
diff --git a/sd/qa/uitest/impress_tests/exportToPDF.py 
b/sd/qa/uitest/impress_tests/exportToPDF.py
index 4dcaa4954405..72a8ac916a46 100644
--- a/sd/qa/uitest/impress_tests/exportToPDF.py
+++ b/sd/qa/uitest/impress_tests/exportToPDF.py
@@ -8,12 +8,13 @@
 #
 
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from uitest.uihelper.common import get_state_as_dict
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from org.libreoffice.unotest import systemPathToFileUrl
 from tempfile import TemporaryDirectory
 import os.path
 
+
 class exportToPDF(UITestCase):
 
 def test_checkDefaultValues(self):
diff --git a/sd/qa/uitest/impress_tests/insertSlide.py 
b/sd/qa/uitest/impress_tests/insertSlide.py
index f81d0792f2b5..83f33c59782c 100644
--- a/sd/qa/uitest/impress_tests/insertSlide.py
+++ b/sd/qa/uitest/impress_tests/insertSlide.py
@@ -8,12 +8,9 @@
 #
 
 from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.uihelper.common import select_pos
 #Bug 85360 - LibreOffice crashes and crashes desktop too on inserting 4th slide
 
+
 class insertSlide(UITestCase):
 
def test_insert_slide(self):
diff --git a/sd/qa/uitest/impress_tests/masterElements.py 
b/sd/qa/uitest/impress_tests/masterElements.py
index ad277ca25c71..9950be9e232c 100644
--- a/sd/qa/uitest/impress_tests/masterElements.py
+++ b/sd/qa/uitest/impress_tests/masterElements.py
@@ -8,10 +8,8 @@
 #
 
 from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.uihelper.common import select_pos
+
 
 class masterElements(UITestCase):
 
diff --git a/sd/qa/uitest/impress_tests/tdf134734.py 
b/sd/qa/uitest/impress_tests/tdf134734.py
index 57559c4ead52..8320246272b7 100644
--- a/sd/qa/uitest/impress_tests/tdf134734.py
+++ b/sd/qa/uitest/impress_tests/tdf134734.py
@@ -8,11 +8,10 @@
 #
 
 from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict, select_pos
 from uitest.uihelper.common import change_measurement_unit
 from com.sun.star.drawing.FillStyle import SOLID
-import importlib
+
 
 class TestClass(UITestCase):
 def test_master_page_background(self):
diff --git a/sd/qa/uitest/impress_tests2/tdf127900.py 
b/sd/qa/uitest/impress_tests2/tdf127900.py
index b85e602fa995..e32b76591aad 100644
--- a/sd/qa/uitest/impress_tests2/tdf127900.py
+++ b/sd/qa/uitest/impress_tests2/tdf127900.py
@@ -6,11 +6,13 @@
 # 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 select_pos, get_state_as_dict
+from uitest.uihelper.common import select_pos
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_url_for_data_file
 
+
 class tdf127900(UITestCase):
 
 def test_tdf127900(self):
diff --git a/sd/qa/uitest/impress_tests2/tdf139511.py 
b/sd/qa/uitest/impress_tests2/tdf139511.py
index 3c1988510888..4ff7a67090a1 100644
--- a/sd/qa/uitest/impress_tests2/tdf139511.py
+++ 

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

2022-11-14 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/SVGExportTests.cxx |   23 ---
 1 file changed, 23 deletions(-)

New commits:
commit 7d750720b667a178b273db4e1f280a756583d74f
Author: Xisco Fauli 
AuthorDate: Mon Nov 14 21:34:32 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Nov 14 22:42:34 2022 +0100

CppunitTest_sd_svg_export_tests: remove duplicated code

This class is already in macros_test.hxx

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

diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index 220d1eb0f5f9..2972465e59fc 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -72,29 +72,6 @@ bool isValidTiledBackgroundId(const OUString& sId)
 
 class SdSVGFilterTest : public UnoApiXmlTest
 {
-class Resetter
-{
-private:
-std::function m_Func;
-
-public:
-Resetter(std::function const& rFunc)
-: m_Func(rFunc)
-{
-}
-~Resetter()
-{
-try
-{
-m_Func();
-}
-catch (...) // has to be reliable
-{
-CPPUNIT_FAIL("resetter failed with exception");
-}
-}
-};
-
 public:
 SdSVGFilterTest()
 : UnoApiXmlTest("/sd/qa/unit/data/odp/")


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

2022-11-14 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx |4 ++--
 sd/qa/unit/export-tests-ooxml3.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3d17308bb77351b49d3a9ebb96cd703208911f33
Author: Xisco Fauli 
AuthorDate: Mon Nov 14 12:18:05 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Nov 14 14:03:10 2022 +0100

sd: fix build

After 1b167f3e0b1afec7c257f458db7505d8d8f177b3
"tdf#142291 PPTX export: fix table border styles"

and

0b224cc5f3c896d8b0064d5cbadc6fce66c8beb9
"Revert "Revert "tdf#151622 PPTX: fix export of show as icon option"""

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

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 69f50c016315..57008eefbf8d 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -227,9 +227,9 @@ public:
 void SdOOXMLExportTest2::testTdf142291()
 {
 loadFromURL(u"pptx/tdt142291.pptx");
-utl::TempFileNamed tempFile = save("Impress Office Open XML");
+save("Impress Office Open XML");
 
-xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), 
"ppt/slides/slide1.xml");
+xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml");
 assertXPath(pXmlDocContent,
 
"/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc[1]/"
 "a:tcPr/a:lnL/a:prstDash",
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index c32055df3f42..d8eedf381ddc 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -2080,9 +2080,9 @@ void SdOOXMLExportTest3::testTdf151622_oleIcon()
 {
 loadFromURL(u"odp/ole_icon.odp");
 
-utl::TempFileNamed tmpfile = save("Impress Office Open XML");
+save("Impress Office Open XML");
 
-xmlDocUniquePtr pXml = parseExport(tmpfile, "ppt/slides/slide1.xml");
+xmlDocUniquePtr pXml = parseExport("ppt/slides/slide1.xml");
 
 // Without the accompanying fix in place, this test would have failed with:
 // - Expression: prop


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

2022-11-04 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/data/odg/FitToFrameText.odg |binary
 sd/qa/unit/layout-tests.cxx|   22 ++
 vcl/source/gdi/mtfxmldump.cxx  |7 ++-
 3 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit 14175b130ff97c5576ff872dcf3163954c6f80f8
Author: Tomaž Vajngerl 
AuthorDate: Wed Nov 2 22:48:35 2022 +0100
Commit: Tomaž Vajngerl 
CommitDate: Fri Nov 4 15:18:39 2022 +0100

add a test for "fit to frame" text rendering

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

diff --git a/sd/qa/unit/data/odg/FitToFrameText.odg 
b/sd/qa/unit/data/odg/FitToFrameText.odg
new file mode 100644
index ..e65b0a3a2102
Binary files /dev/null and b/sd/qa/unit/data/odg/FitToFrameText.odg differ
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index 2a7c0e0a200b..d2bf22622885 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -292,6 +292,28 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testBnc480256)
 assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[8]/linecolor[1]", 
"color", "#ff");
 }
 
+CPPUNIT_TEST_FIXTURE(SdLayoutTest, testFitToFrameTextFitting)
+{
+// This test checks that the text fitting is working correctly when
+// the textbox is set to "fit to frame" by stretching the text to or
+// near the textbox boundary. The problem is especially complicated
+// when the font size is set to a higher number (like 999)
+//
+// The text fitting behaviour when "fit by frame" is enabled is to
+// always fit the text into the text box (without forcing the text
+// into new line) by shrinking or expanding the text horizontally
+// and vertically.
+
+xmlDocUniquePtr pXmlDoc = load("odg/FitToFrameText.odg");
+
+assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]", "x", "0");
+assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]", "y", "406");
+assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]/dxarray", 
"first", "114");
+#ifndef _WIN32 // Windows seems to differ in text layouting, so ignore for now
+assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]/dxarray", 
"last", "7010");
+#endif
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx
index 2dc7e7b9d3e1..5319c2834686 100644
--- a/vcl/source/gdi/mtfxmldump.cxx
+++ b/vcl/source/gdi/mtfxmldump.cxx
@@ -811,11 +811,16 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& 
rMetaFile, tools::XmlWriter& r
 
 if (!pMetaTextArrayAction->GetDXArray().empty())
 {
+auto & rArray = pMetaTextArrayAction->GetDXArray();
 rWriter.startElement("dxarray");
+if (aIndex < o3tl::narrowing(rArray.size()))
+rWriter.attribute("first", rArray[aIndex]);
+if (aIndex + aLength - 1 < 
o3tl::narrowing(rArray.size()))
+rWriter.attribute("last", rArray[aIndex + aLength - 
1]);
 OUStringBuffer sDxLengthString;
 for (sal_Int32 i = 0; i < aLength - aIndex; ++i)
 {
-
sDxLengthString.append(pMetaTextArrayAction->GetDXArray()[aIndex + i]);
+sDxLengthString.append(rArray[aIndex + i]);
 sDxLengthString.append(" ");
 }
 rWriter.content(sDxLengthString);


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

2022-11-03 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/export-tests-ooxml3.cxx |2 +-
 svx/source/svdraw/svdotext.cxx |   15 +++
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 7f73a779e33dd91fad0111629c6b3420c2c9aea0
Author: Tomaž Vajngerl 
AuthorDate: Wed Nov 2 20:15:31 2022 +0100
Commit: Tomaž Vajngerl 
CommitDate: Thu Nov 3 09:53:54 2022 +0100

optimize text fitting algorithm to correctly calculate the fit

As we converted the chart stretching variable from int to double
this can cause the text fitting algorithm to calculate the fit
wrong. This commit changes the text fitting algorithm a bit so
that it produces similar result as before the change.

Change test testAutofittedTextboxIndent from 691200 to 712800 as
the fitting algorithm changed a bit. Visually the document still
looks correct.

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

diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 62fe34150896..2f2576ed1ce6 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -2068,7 +2068,7 @@ void SdOOXMLExportTest3::testAutofittedTextboxIndent()
 
 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 assertXPath(pXmlDocContent1, 
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:pPr", "marL",
-"691200");
+"712800");
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest3);
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 5e2a8721cd89..6e47273fe175 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1252,9 +1252,8 @@ void SdrTextObj::ImpAutoFitText(SdrOutliner& rOutliner, 
const Size& rTextSize,
 // loop early-exits if we detect an already attained value
 double nMinStretchX = 0.0;
 double nMinStretchY = 0.0;
-sal_uInt16 aOldStretchXVals[]={0,0,0,0,0,0,0,0,0,0};
-const size_t aStretchArySize=SAL_N_ELEMENTS(aOldStretchXVals);
-for(unsigned int i=0; i aOldStretchXVals = {0,0,0,0,0,0,0,0,0,0};
+for (size_t i = 0; i < aOldStretchXVals.size(); ++i)
 {
 const Size aCurrTextSize = rOutliner.CalcTextSizeNTP();
 double fFactor = 1.0;
@@ -1279,7 +1278,7 @@ void SdrTextObj::ImpAutoFitText(SdrOutliner& rOutliner, 
const Size& rTextSize,
 double nCurrStretchX, nCurrStretchY;
 rOutliner.GetGlobalCharStretching(nCurrStretchX, nCurrStretchY);
 
-if (fFactor >= 1.0 )
+if (fFactor >= 0.98)
 {
 // resulting text area fits into available shape rect -
 // err on the larger stretching, to optimally fill area
@@ -1287,14 +1286,14 @@ void SdrTextObj::ImpAutoFitText(SdrOutliner& rOutliner, 
const Size& rTextSize,
 nMinStretchY = std::max(nMinStretchY, nCurrStretchY);
 }
 
-aOldStretchXVals[i] = nCurrStretchX;
-if( std::find(aOldStretchXVals, aOldStretchXVals+i, nCurrStretchX) != 
aOldStretchXVals+i )
+aOldStretchXVals[i] = basegfx::fround(nCurrStretchX * 10.0);
+if (std::find(aOldStretchXVals.begin(), aOldStretchXVals.begin() + i, 
basegfx::fround(nCurrStretchX * 10.0)) != aOldStretchXVals.begin() + i)
 break; // same value already attained once; algo is looping, exit
 
 if (fFactor < 1.0 || nCurrStretchX != 100)
 {
-nCurrStretchX = nCurrStretchX * fFactor;
-nCurrStretchY = nCurrStretchY * fFactor;
+nCurrStretchX = double(basegfx::fround(nCurrStretchX * fFactor * 
100.0)) / 100.00;
+nCurrStretchY = double(basegfx::fround(nCurrStretchY * fFactor * 
100.0)) / 100.00;
 
 rOutliner.SetGlobalCharStretching(std::min(100.0, nCurrStretchX), 
std::min(100.0, nCurrStretchY));
 SAL_INFO("svx", "zoom is " << nCurrStretchX);


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

2022-11-02 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/sdmodeltestbase.hxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 71703f3792e90c7ec6ed116cd734e23b0666afd1
Author: Xisco Fauli 
AuthorDate: Wed Nov 2 14:17:08 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Nov 2 15:52:49 2022 +0100

SdUnoApiTestXml: simplify code a bit

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

diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index e71cae25b153..191c56e52eec 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -155,9 +155,6 @@ public:
 {
 std::unique_ptr const pStream(parseExportStream(rTempFile, 
rStreamName));
 xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
-OUString const url(rTempFile.GetURL());
-pXmlDoc->name = 
reinterpret_cast(xmlStrdup(reinterpret_cast(
-OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr(;
 return pXmlDoc;
 }
 };


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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml1.cxx |   31 ++-
 sd/qa/unit/export-tests-ooxml2.cxx |   31 ++-
 sd/qa/unit/export-tests-ooxml3.cxx |5 -
 sd/qa/unit/export-tests.cxx|   96 -
 sd/qa/unit/import-tests.cxx|   18 +-
 sd/qa/unit/sdmodeltestbase.hxx |6 --
 6 files changed, 39 insertions(+), 148 deletions(-)

New commits:
commit a4da4dc147df0f753a08a6bd302c86d3bc591229
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 13:16:56 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 21:36:13 2022 +0100

sd: Simplify code

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

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 276d8d4d5cb5..93234b2bb794 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -450,10 +450,7 @@ void SdOOXMLExportTest1::testTdf142648()
 {
 loadFromURL(u"pptx/tdf142648.pptx");
 
-SdXImpressDocument* pXImpressDocument = 
dynamic_cast(mxComponent.get());
-CPPUNIT_ASSERT(pXImpressDocument);
-SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
-uno::Reference xDPS(pDoc->getUnoModel(), 
uno::UNO_QUERY_THROW);
+uno::Reference xDPS(mxComponent, 
uno::UNO_QUERY_THROW);
 uno::Reference xDrawPages(xDPS->getDrawPages(), 
uno::UNO_SET_THROW);
 uno::Reference xDrawPage;
 xDrawPages->getByIndex(0) >>= xDrawPage;
@@ -1318,10 +1315,7 @@ void SdOOXMLExportTest1::testTdf94238()
 // Load document and export it to a temporary file.
 loadFromURL(u"pptx/tdf94238.pptx");
 utl::TempFileNamed tempFile = save("Impress Office Open XML");
-SdXImpressDocument* pXImpressDocument = 
dynamic_cast(mxComponent.get());
-CPPUNIT_ASSERT(pXImpressDocument);
-SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
-uno::Reference xDoc(pDoc->getUnoModel(), 
uno::UNO_QUERY);
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDoc.is());
 
 uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
@@ -1354,10 +1348,7 @@ void SdOOXMLExportTest1::testPictureTransparency()
 // Load document and export it to a temporary file.
 loadFromURL(u"odp/image_transparency.odp");
 utl::TempFileNamed tempFile = save("Impress Office Open XML");
-SdXImpressDocument* pXImpressDocument = 
dynamic_cast(mxComponent.get());
-CPPUNIT_ASSERT(pXImpressDocument);
-SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
-uno::Reference xDoc(pDoc->getUnoModel(), 
uno::UNO_QUERY);
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDoc.is());
 
 uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
@@ -1389,10 +1380,7 @@ void SdOOXMLExportTest1::testRoundtripOwnLineStyles()
 {
 // Load odp document and read the LineDash values.
 loadFromURL(u"odp/LineStylesOwn.odp");
-SdXImpressDocument* pXImpressDocument = 
dynamic_cast(mxComponent.get());
-CPPUNIT_ASSERT(pXImpressDocument);
-SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
-uno::Reference xDocodp(pDoc->getUnoModel(), 
uno::UNO_QUERY);
+uno::Reference xDocodp(mxComponent, 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDocodp.is());
 uno::Reference 
xPageodp(xDocodp->getDrawPages()->getByIndex(0),
 uno::UNO_QUERY);
@@ -1407,10 +1395,7 @@ void SdOOXMLExportTest1::testRoundtripOwnLineStyles()
 
 // Save to pptx, reload and compare the LineDash values
 utl::TempFileNamed tempFile = save("Impress Office Open XML");
-pXImpressDocument = dynamic_cast(mxComponent.get());
-CPPUNIT_ASSERT(pXImpressDocument);
-pDoc = pXImpressDocument->GetDoc();
-uno::Reference xDocpptx(pDoc->getUnoModel(), 
uno::UNO_QUERY);
+uno::Reference xDocpptx(mxComponent, 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDocpptx.is());
 uno::Reference 
xPagepptx(xDocpptx->getDrawPages()->getByIndex(0),
  uno::UNO_QUERY);
@@ -1451,13 +1436,9 @@ void SdOOXMLExportTest1::testRoundtripPrstDash()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong prstDash", sOriginal[i], sResaved);
 }
 
-SdXImpressDocument* pXImpressDocument = 
dynamic_cast(mxComponent.get());
-CPPUNIT_ASSERT(pXImpressDocument);
-SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
-
 // tdf#126746: Make sure that dash-dot pattern starts with the longer 
dash, as defined in OOXML
 // Make sure Style is drawing::DashStyle_RECTRELATIVE
-uno::Reference xDoc(pDoc->getUnoModel(), 
uno::UNO_QUERY);
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDoc.is());
 uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 CPPUNIT_ASSERT(xPage.is());
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 

[Libreoffice-commits] core.git: sd/qa solenv/clang-format

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/sdmodeltestbase.hxx  |   29 -
 solenv/clang-format/excludelist |1 -
 2 files changed, 12 insertions(+), 18 deletions(-)

New commits:
commit 753d1aa82b0c76e7f5e160c935ba2ca84b1c9e2c
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 17:59:36 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 21:35:46 2022 +0100

sdmodeltestbase.hxx: use clang-format

Now that the file has shrunk in size

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

diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index a1c54f43cfaf..00d4eb317554 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -168,36 +168,31 @@ public:
 
 CPPUNIT_NS_BEGIN
 
-template<> struct assertion_traits
+template <> struct assertion_traits
 {
-static bool equal( const Color& c1, const Color& c2 )
-{
-return c1 == c2;
-}
+static bool equal(const Color& c1, const Color& c2) { return c1 == c2; }
 
-static std::string toString( const Color& c )
+static std::string toString(const Color& c)
 {
 OStringStream ost;
 ost << "Color: R:" << static_cast(c.GetRed())
-  << " G:" << static_cast(c.GetGreen())
-  << " B:" << static_cast(c.GetBlue())
-  << " A:" << static_cast(255 - c.GetAlpha());
+<< " G:" << static_cast(c.GetGreen()) << " B:" << 
static_cast(c.GetBlue())
+<< " A:" << static_cast(255 - c.GetAlpha());
 return ost.str();
 }
 };
 
-template<> struct assertion_traits
+template <> struct assertion_traits
 {
-static bool equal( const tools::Rectangle& r1, const tools::Rectangle& r2 )
-{
-return r1 == r2;
-}
+static bool equal(const tools::Rectangle& r1, const tools::Rectangle& r2) 
{ return r1 == r2; }
 
-static std::string toString( const tools::Rectangle& r)
+static std::string toString(const tools::Rectangle& r)
 {
 OStringStream ost;
-ost << "Rect P: [" << r.Top() << ", " << r.Left() << "] "
-"S: [" << r.GetWidth() << ", " << r.GetHeight() << "]";
+ost << "Rect P: [" << r.Top() << ", " << r.Left()
+<< "] "
+   "S: ["
+<< r.GetWidth() << ", " << r.GetHeight() << "]";
 return ost.str();
 }
 };
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index d3807f60c5a1..65a3580e94fb 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -9487,7 +9487,6 @@ sd/qa/unit/SVGExportTests.cxx
 sd/qa/unit/activex-controls-tests.cxx
 sd/qa/unit/dialogs-test.cxx
 sd/qa/unit/filters-test.cxx
-sd/qa/unit/sdmodeltestbase.hxx
 sd/qa/unit/tiledrendering/tiledrendering.cxx
 sd/qa/unit/uimpress.cxx
 sd/source/core/CustomAnimationCloner.cxx


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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/sdmodeltestbase.hxx |  353 -
 1 file changed, 353 deletions(-)

New commits:
commit 95075e5296776f5d1b528d6d3c26f5337ad8e9a8
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 16:00:03 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 21:35:29 2022 +0100

SdModelTestBase is now unused

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

diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 38a98ec39941..a1c54f43cfaf 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -43,359 +43,6 @@
 
 using namespace ::com::sun::star;
 
-struct FileFormat
-{
-const char* pName;
-const char* pFilterName;
-const char* pTypeName;
-const char* pUserData;
-SfxFilterFlags nFormatType;
-};
-
-// These values are taken from "Flags" in 
filter/source/config/fragments/filters/*
-// You need to turn value of oor:name="Flags" to SfxFilterFlags::*, see
-// include/comphelper/documentconstants.hxx for the possible values.
-// Note: 3RDPARTYFILTER == SfxFilterFlags::STARONEFILTER
-#define ODP_FORMAT_TYPE  ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | 
SfxFilterFlags::TEMPLATE | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT | 
SfxFilterFlags::ENCRYPTION | SfxFilterFlags::PREFERED )
-#define PPT_FORMAT_TYPE  ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | 
SfxFilterFlags::ALIEN )
-#define PPTX_FORMAT_TYPE ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | 
SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER | 
SfxFilterFlags::PREFERED )
-#define HTML_FORMAT_TYPE ( SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN )
-#define PDF_FORMAT_TYPE  ( SfxFilterFlags::STARONEFILTER | 
SfxFilterFlags::ALIEN | SfxFilterFlags::IMPORT | SfxFilterFlags::PREFERED )
-#define FODG_FORMAT_TYPE  (SfxFilterFlags::STARONEFILTER | SfxFilterFlags::OWN 
| SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT)
-#define FODP_FORMAT_TYPE  (SfxFilterFlags::STARONEFILTER | SfxFilterFlags::OWN 
| SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT)
-#define SXI_FORMAT_TYPE  (SfxFilterFlags::IMPORT | SfxFilterFlags::TEMPLATE | 
SfxFilterFlags::OWN | SfxFilterFlags::ALIEN | SfxFilterFlags::PREFERED | 
SfxFilterFlags::ENCRYPTION)
-#define ODG_FORMAT_TYPE  ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | 
SfxFilterFlags::TEMPLATE | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT | 
SfxFilterFlags::ENCRYPTION | SfxFilterFlags::PREFERED )
-#define PPTM_FORMAT_TYPE ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | 
SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER | 
SfxFilterFlags::PREFERED )
-#define POTX_FORMAT_TYPE ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | 
SfxFilterFlags::ALIEN | SfxFilterFlags::TEMPLATE | 
SfxFilterFlags::STARONEFILTER | SfxFilterFlags::PREFERED )
-
-/** List of file formats we support in Impress unit tests.
-
-Taken from filter/source/config/fragments/filters/ too:
-pName: The file extension.
-pFilterName: 
-pTypeName: ...
-nFormatType: ...
-*/
-static FileFormat aFileFormats[] =
-{
-{ "odp",  "impress8", "impress8", "", ODP_FORMAT_TYPE },
-{ "ppt",  "MS PowerPoint 97", "impress_MS_PowerPoint_97", "sd", 
PPT_FORMAT_TYPE },
-{ "pptx", "Impress Office Open XML", "Office Open XML Presentation", "", 
PPTX_FORMAT_TYPE },
-{ "html", "graphic_HTML", "graphic_HTML", "", HTML_FORMAT_TYPE },
-{ "pdf",  "draw_pdf_import", "pdf_Portable_Document_Format", "", 
PDF_FORMAT_TYPE },
-{ "fodg", "OpenDocument Drawing Flat XML", "draw_ODG_FlatXML", "", 
FODG_FORMAT_TYPE },
-{ "fodp", "OpenDocument Presentation Flat XML", "impress_ODP_FlatXML", "", 
FODP_FORMAT_TYPE },
-{ "sxi",  "StarOffice XML (Impress)", "impress_StarOffice_XML_Impress", 
"", SXI_FORMAT_TYPE },
-{ "odg",  "draw8", "draw8", "", ODG_FORMAT_TYPE },
-{ "pptm", "Impress MS PowerPoint 2007 XML VBA", "MS PowerPoint 2007 XML 
VBA", "", PPTM_FORMAT_TYPE },
-{ "potx", "Impress Office Open XML Template", "Office Open XML 
Presentation Template", "", POTX_FORMAT_TYPE },
-{ nullptr, nullptr, nullptr, nullptr, SfxFilterFlags::NONE }
-};
-
-#define ODP  0
-#define PPT  1
-#define PPTX 2
-#define HTML 3
-#define PDF  4
-#define FODG 5
-#define FODP 6
-#define SXI  7
-#define ODG  8
-#define PPTM 9
-#define POTX 10
-
-/// Base class for filter tests loading or roundtripping a document, and 
asserting the document model.
-class SdModelTestBase : public test::BootstrapFixture, public 
unotest::MacrosTest
-{
-private:
-uno::Reference mxDrawComponent;
-uno::Reference mxImpressComponent;
-
-public:
-SdModelTestBase()
-{}
-
-virtual void setUp() override
-{
-test::BootstrapFixture::setUp();
-
-// This is a bit of a fudge, we do this to ensure that 
ScGlobals::ensure,
-// which is a private symbol to us, gets called
-mxImpressComponent = 

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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/import-tests2.cxx |  677 ++-
 1 file changed, 233 insertions(+), 444 deletions(-)

New commits:
commit f48c2fd1cf4a9fbc8e861803119ba7376201f71f
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 15:41:19 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 21:35:14 2022 +0100

CppunitTest_sd_import_tests2: inherit from UnoApiTest

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

diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 86641bde50ac..c6e335661e8c 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -62,10 +62,13 @@
 
 using namespace ::com::sun::star;
 
-class SdImportTest2 : public SdModelTestBase
+class SdImportTest2 : public SdUnoApiTest
 {
 public:
-virtual void setUp() override;
+SdImportTest2()
+: SdUnoApiTest("/sd/qa/unit/data/")
+{
+}
 
 void testTdf93868();
 void testTdf95932();
@@ -115,8 +118,7 @@ public:
 void testGreysScaleGraphic();
 void testTdf134210CropPosition();
 
-bool checkPattern(sd::DrawDocShellRef const& rDocRef, int nShapeNumber,
-  std::vector& rExpected);
+bool checkPattern(int nShapeNumber, std::vector& rExpected);
 void testPatternImport();
 void testPptCrop();
 void testTdf149206();
@@ -225,18 +227,11 @@ public:
 CPPUNIT_TEST_SUITE_END();
 };
 
-void SdImportTest2::setUp()
-{
-SdModelTestBase::setUp();
-mxDesktop.set(frame::Desktop::create(getComponentContext()));
-}
-
 void SdImportTest2::testTdf93868()
 {
-sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf93868.pptx"), 
PPTX);
+loadFromURL(u"pptx/tdf93868.pptx");
 
-const SdrPage* pPage = &(GetPage(1, xDocShRef)->TRG_GetMasterPage());
+const SdrPage* pPage = &(GetPage(1)->TRG_GetMasterPage());
 CPPUNIT_ASSERT_EQUAL(size_t(5), pPage->GetObjCount());
 CPPUNIT_ASSERT_EQUAL(
 drawing::FillStyle_SOLID,
@@ -250,16 +245,13 @@ void SdImportTest2::testTdf93868()
 CPPUNIT_ASSERT_EQUAL(true, dynamic_cast(

pPage->GetObj(1)->GetMergedItem(XATTR_FILLUSESLIDEBACKGROUND))
.GetValue());
-
-xDocShRef->DoClose();
 }
 
 void SdImportTest2::testTdf95932()
 {
-sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf95932.pptx"), 
PPTX);
+loadFromURL(u"pptx/tdf95932.pptx");
 
-const SdrPage* pPage = GetPage(1, xDocShRef);
+const SdrPage* pPage = GetPage(1);
 SdrObject* const pObj = pPage->GetObj(1);
 CPPUNIT_ASSERT(pObj);
 
@@ -269,17 +261,13 @@ void SdImportTest2::testTdf95932()
 const XFillColorItem& rColorItem
 = dynamic_cast(pObj->GetMergedItem(XATTR_FILLCOLOR));
 CPPUNIT_ASSERT_EQUAL(Color(0x76bf3d), rColorItem.GetColorValue());
-
-xDocShRef->DoClose();
 }
 
 void SdImportTest2::testTdf99030()
 {
-sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf99030.pptx"), 
PPTX);
+loadFromURL(u"pptx/tdf99030.pptx");
 
-uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
-   uno::UNO_QUERY_THROW);
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
 uno::Reference 
xPage(xDoc->getMasterPages()->getByIndex(0),
  uno::UNO_QUERY_THROW);
 uno::Reference xPropSet(xPage, uno::UNO_QUERY);
@@ -293,17 +281,13 @@ void SdImportTest2::testTdf99030()
 xBackgroundPropSet->getPropertyValue("FillColor") >>= nFillColor;
 }
 CPPUNIT_ASSERT_EQUAL(Color(0x676A55), nFillColor);
-
-xDocShRef->DoClose();
 }
 
 void SdImportTest2::testTdf49561()
 {
-sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/ppt/tdf49561.ppt"), PPT);
+loadFromURL(u"ppt/tdf49561.ppt");
 
-uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
-   uno::UNO_QUERY_THROW);
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
 uno::Reference 
xPage(xDoc->getMasterPages()->getByIndex(0),
  uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL(sal_Int32(5), xPage->getCount());
@@ -320,16 +304,13 @@ void SdImportTest2::testTdf49561()
 OUString aCharFontName;
 CPPUNIT_ASSERT(xPropSet->getPropertyValue("CharFontName") >>= 
aCharFontName);
 CPPUNIT_ASSERT_EQUAL(OUString("Stencil"), aCharFontName);
-
-xDocShRef->DoClose();
 }
 
 void SdImportTest2::testTdf103473()
 {
-sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf103473.pptx"), 
PPTX);
+loadFromURL(u"pptx/tdf103473.pptx");
 
-   

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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/import-tests.cxx|  614 +++--
 sd/qa/unit/sdmodeltestbase.hxx |   45 ---
 2 files changed, 234 insertions(+), 425 deletions(-)

New commits:
commit 21f8a8e42395171ab33c5b84642b7f2f4e0ce71e
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 14:14:35 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 17:54:52 2022 +0100

CppunitTest_sd_import_tests: inherit from UnoApiTest

No need to have compareWithShapesDump in a different place,
it's only use in one place

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

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index add386d4aa0a..a751c8729991 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -76,10 +76,13 @@ static std::ostream& operator<<(std::ostream& rStrm, const 
uno::Reference& xR
 }
 
 /// Impress import filters tests.
-class SdImportTest : public SdModelTestBase
+class SdImportTest : public SdUnoApiTest
 {
 public:
-virtual void setUp() override;
+SdImportTest()
+: SdUnoApiTest("/sd/qa/unit/data/")
+{
+}
 
 void testDocumentLayout();
 void testConnectors();
@@ -230,12 +233,6 @@ public:
 CPPUNIT_TEST_SUITE_END();
 };
 
-void SdImportTest::setUp()
-{
-SdModelTestBase::setUp();
-mxDesktop.set(frame::Desktop::create(getComponentContext()));
-}
-
 /** Test document against a reference XML dump of shapes.
 
 If you want to update one of these tests, or add a new one, set the nUpdateMe
@@ -245,10 +242,10 @@ why, instead of just updating .xml's blindly.
 
 Example: Let's say you are adding a test called fdoABCD.pptx.  You'll place it
 to the data/ subdirectory, and will add an entry to aFilesToCompare below,
-the 3rd parameter is for export test - can be -1 (don't export), ODP, PPT or 
PPTX
+the 3rd parameter is for export test - can be -1 (don't export), "impress8", 
"MS PowerPoint 97" or "Impress Office Open XML"
 like:
 
-{ "fdoABCD.pptx", "xml/fdoABCD_", PPTX },
+{ "fdoABCD.pptx", "xml/fdoABCD_", "Impress Office Open XML" },
 
 and will count the index in the aFilesToCompare structure (1st is 0, 2nd is 1,
 etc.)  Temporarily you'll set nUpdateMe to this index (instead of -1), and run
@@ -271,32 +268,31 @@ void SdImportTest::testDocumentLayout()
 static const struct
 {
 std::u16string_view sInput, sDump;
-sal_Int32 nFormat;
-sal_Int32 nExportType;
+OUString sExportType;
 } aFilesToCompare[]
-= { { u"odp/shapes-test.odp", u"xml/shapes-test_page", ODP, -1 },
-{ u"fdo47434.pptx", u"xml/fdo47434_", PPTX, -1 },
-{ u"n758621.ppt", u"xml/n758621_", PPT, -1 },
-{ u"fdo64586.ppt", u"xml/fdo64586_", PPT, -1 },
-{ u"n819614.pptx", u"xml/n819614_", PPTX, -1 },
-{ u"n820786.pptx", u"xml/n820786_", PPTX, -1 },
-{ u"n762695.pptx", u"xml/n762695_", PPTX, -1 },
-{ u"n593612.pptx", u"xml/n593612_", PPTX, -1 },
-{ u"fdo71434.pptx", u"xml/fdo71434_", PPTX, -1 },
-{ u"n902652.pptx", u"xml/n902652_", PPTX, -1 },
-{ u"tdf90403.pptx", u"xml/tdf90403_", PPTX, -1 },
-{ u"tdf90338.odp", u"xml/tdf90338_", ODP, PPTX },
-{ u"tdf92001.odp", u"xml/tdf92001_", ODP, PPTX },
+= { { u"odp/shapes-test.odp", u"xml/shapes-test_page", u"" },
+{ u"fdo47434.pptx", u"xml/fdo47434_", u"" },
+{ u"n758621.ppt", u"xml/n758621_", u"" },
+{ u"fdo64586.ppt", u"xml/fdo64586_", u"" },
+{ u"n819614.pptx", u"xml/n819614_", u"" },
+{ u"n820786.pptx", u"xml/n820786_", u"" },
+{ u"n762695.pptx", u"xml/n762695_", u"" },
+{ u"n593612.pptx", u"xml/n593612_", u"" },
+{ u"fdo71434.pptx", u"xml/fdo71434_", u"" },
+{ u"n902652.pptx", u"xml/n902652_", u"" },
+{ u"tdf90403.pptx", u"xml/tdf90403_", u"" },
+{ u"tdf90338.odp", u"xml/tdf90338_", u"Impress Office Open XML" },
+{ u"tdf92001.odp", u"xml/tdf92001_", u"Impress Office Open XML" },
 // GCC -mfpmath=387 rounding issues in lclPushMarkerProperties
 // (oox/source/drawingml/lineproperties.cxx); see mail sub-thread starting at
 //  "Re: Test File: sc/qa/unit/data/functions/fods/chiinv.fods:
 // fails with Assertion" for how "-mfpmath=sse -msse2" would fix that:
 #if !(defined LINUX && defined X86)
-{ u"tdf100491.pptx", u"xml/tdf100491_", PPTX, -1 },
+{ u"tdf100491.pptx", u"xml/tdf100491_", u"" },
 #endif
-{ u"tdf109317.pptx", u"xml/tdf109317_", PPTX, ODP },
-// { u"pptx/n828390.pptx", u"pptx/xml/n828390_", PPTX, PPTX }, // 
Example
+{ u"tdf109317.pptx", u"xml/tdf109317_", u"impress8" 

[Libreoffice-commits] core.git: sd/qa solenv/clang-format

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/import-tests.cxx | 1065 +---
 solenv/clang-format/excludelist |1 
 2 files changed, 579 insertions(+), 487 deletions(-)

New commits:
commit abd4902dfa55d743cc9878bfcab12beb12e83400
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 12:03:38 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 16:22:54 2022 +0100

CppunitTest_sd_import_tests: use clang-format

Do it before changing the inheritance

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

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 5de224453d53..add386d4aa0a 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -65,18 +65,16 @@
 
 using namespace ::com::sun::star;
 
-namespace com::sun::star::uno {
-
-template
+namespace com::sun::star::uno
+{
+template 
 static std::ostream& operator<<(std::ostream& rStrm, const uno::Reference& 
xRef)
 {
 rStrm << xRef.get();
 return rStrm;
 }
-
 }
 
-
 /// Impress import filters tests.
 class SdImportTest : public SdModelTestBase
 {
@@ -270,43 +268,51 @@ the test, and re-running; it should break.
 */
 void SdImportTest::testDocumentLayout()
 {
-static const struct { std::u16string_view sInput, sDump; sal_Int32 
nFormat; sal_Int32 nExportType; } aFilesToCompare[] =
+static const struct
 {
-{ u"odp/shapes-test.odp", u"xml/shapes-test_page", ODP, -1 },
-{ u"fdo47434.pptx", u"xml/fdo47434_", PPTX, -1 },
-{ u"n758621.ppt", u"xml/n758621_", PPT, -1 },
-{ u"fdo64586.ppt", u"xml/fdo64586_", PPT, -1 },
-{ u"n819614.pptx", u"xml/n819614_", PPTX, -1 },
-{ u"n820786.pptx", u"xml/n820786_", PPTX, -1 },
-{ u"n762695.pptx", u"xml/n762695_", PPTX, -1 },
-{ u"n593612.pptx", u"xml/n593612_", PPTX, -1 },
-{ u"fdo71434.pptx", u"xml/fdo71434_", PPTX, -1 },
-{ u"n902652.pptx", u"xml/n902652_", PPTX, -1 },
-{ u"tdf90403.pptx", u"xml/tdf90403_", PPTX, -1 },
-{ u"tdf90338.odp", u"xml/tdf90338_", ODP, PPTX },
-{ u"tdf92001.odp", u"xml/tdf92001_", ODP, PPTX },
+std::u16string_view sInput, sDump;
+sal_Int32 nFormat;
+sal_Int32 nExportType;
+} aFilesToCompare[]
+= { { u"odp/shapes-test.odp", u"xml/shapes-test_page", ODP, -1 },
+{ u"fdo47434.pptx", u"xml/fdo47434_", PPTX, -1 },
+{ u"n758621.ppt", u"xml/n758621_", PPT, -1 },
+{ u"fdo64586.ppt", u"xml/fdo64586_", PPT, -1 },
+{ u"n819614.pptx", u"xml/n819614_", PPTX, -1 },
+{ u"n820786.pptx", u"xml/n820786_", PPTX, -1 },
+{ u"n762695.pptx", u"xml/n762695_", PPTX, -1 },
+{ u"n593612.pptx", u"xml/n593612_", PPTX, -1 },
+{ u"fdo71434.pptx", u"xml/fdo71434_", PPTX, -1 },
+{ u"n902652.pptx", u"xml/n902652_", PPTX, -1 },
+{ u"tdf90403.pptx", u"xml/tdf90403_", PPTX, -1 },
+{ u"tdf90338.odp", u"xml/tdf90338_", ODP, PPTX },
+{ u"tdf92001.odp", u"xml/tdf92001_", ODP, PPTX },
 // GCC -mfpmath=387 rounding issues in lclPushMarkerProperties
 // (oox/source/drawingml/lineproperties.cxx); see mail sub-thread starting at
 //  "Re: Test File: sc/qa/unit/data/functions/fods/chiinv.fods:
 // fails with Assertion" for how "-mfpmath=sse -msse2" would fix that:
 #if !(defined LINUX && defined X86)
-{ u"tdf100491.pptx", u"xml/tdf100491_", PPTX, -1 },
+{ u"tdf100491.pptx", u"xml/tdf100491_", PPTX, -1 },
 #endif
-{ u"tdf109317.pptx", u"xml/tdf109317_", PPTX, ODP},
-// { u"pptx/n828390.pptx", u"pptx/xml/n828390_", PPTX, PPTX }, // 
Example
-};
+{ u"tdf109317.pptx", u"xml/tdf109317_", PPTX, ODP },
+// { u"pptx/n828390.pptx", u"pptx/xml/n828390_", PPTX, PPTX }, // 
Example
+  };
 
-for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) 
); ++i )
+for (int i = 0; i < static_cast(SAL_N_ELEMENTS(aFilesToCompare)); ++i)
 {
-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( 
u"/sd/qa/unit/data/" ) + aFilesToCompare[i].sInput, aFilesToCompare[i].nFormat 
);
-if( aFilesToCompare[i].nExportType >= 0 )
-xDocShRef = saveAndReload( xDocShRef.get(), 
aFilesToCompare[i].nExportType );
-compareWithShapesDump( xDocShRef,
-Concat2View(m_directories.getPathFromSrc( u"/sd/qa/unit/data/" 
) + aFilesToCompare[i].sDump),
-i == nUpdateMe );
+int const nUpdateMe
+= -1; // index of test we want to update; supposedly only when the 
test is created
+
+sd::DrawDocShellRef xDocShRef
+

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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests.cxx |   11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 61d907f808702850fe169de8eaf7421bb3951169
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 13:10:09 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 15:43:27 2022 +0100

CppunitTest_sd_export_tests: fix build

6f32f1a12be06c4da92b807d8a35cb079984e26a
"tdf#72238 xmloff,sd: Import of "
and
c66def668e43bb40eee54fe91e752ba1330cb911
"CppunitTest_sd_export_tests: inherit from UnoApiTest"
were merged at the same time, breaking the build

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 916bca2f3d93..61cfab3288bd 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1819,12 +1819,10 @@ void SdExportTest::testTdf112126()
 
 void SdExportTest::testCellProperties()
 {
-auto xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odg/tablestyles.fodg"), 
FODG);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), ODG, );
+loadFromURL(u"odg/tablestyles.fodg");
+saveAndReload("draw8");
 
-const SdrPage* pPage = GetPage(1, xDocShRef);
+const SdrPage* pPage = GetPage(1);
 auto pTableObj = dynamic_cast(pPage->GetObj(0));
 CPPUNIT_ASSERT(pTableObj != nullptr);
 uno::Reference 
xCell(pTableObj->getTable()->getCellByPosition(0, 0),
@@ -1844,9 +1842,6 @@ void SdExportTest::testCellProperties()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(300), nPadding);
 xCell->getPropertyValue("TextVerticalAdjust") >>= aTextAdjust;
 
CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust::TextVerticalAdjust_CENTER, 
aTextAdjust);
-
-xDocShRef->DoClose();
-tempFile.EnableKillingFile();
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);


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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   27 ++
 1 file changed, 11 insertions(+), 16 deletions(-)

New commits:
commit a5a487832820cd1f82d3f5dd73aa22045e805917
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 11:59:23 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 15:32:15 2022 +0100

CppunitTest_sd_tiledrendering: inherit from UnoApiTest (part2)

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

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 12b83754dbd6..d47cb3700ce3 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -33,13 +33,13 @@
 
 using namespace css;
 
-class LOKitSearchTest : public SdModelTestBase, public XmlTestTools
+class LOKitSearchTest : public UnoApiTest, public XmlTestTools
 {
-private:
-static constexpr OUStringLiteral DATA_DIRECTORY = 
u"/sd/qa/unit/tiledrendering/data/";
-
 public:
-LOKitSearchTest() = default;
+LOKitSearchTest()
+: UnoApiTest("/sd/qa/unit/tiledrendering/data/")
+{
+}
 
 virtual void setUp() override;
 virtual void tearDown() override;
@@ -85,42 +85,37 @@ private:
   const uno::Sequence& 
rArguments
   = uno::Sequence());
 
-uno::Reference mxComponent;
 std::unique_ptr mpCallbackRecorder;
 };
 
 void LOKitSearchTest::setUp()
 {
-test::BootstrapFixture::setUp();
+UnoApiTest::setUp();
 
 // prevent showing warning message box
 setenv("OOX_NO_SMARTART_WARNING", "1", 1);
 comphelper::LibreOfficeKit::setActive(true);
 
-mxDesktop.set(
-
css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory(;
 mpCallbackRecorder = std::make_unique();
 }
 
 void LOKitSearchTest::tearDown()
 {
 if (mxComponent.is())
+{
 mxComponent->dispose();
+mxComponent.clear();
+}
 
 comphelper::LibreOfficeKit::setActive(false);
 
-test::BootstrapFixture::tearDown();
+UnoApiTest::tearDown();
 }
 
 SdXImpressDocument*
 LOKitSearchTest::createDoc(const char* pName, const 
uno::Sequence& rArguments)
 {
-if (mxComponent.is())
-mxComponent->dispose();
-
-mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY)
-  + OUString::createFromAscii(pName));
-
+loadFromURL(OUString::createFromAscii(pName));
 SdXImpressDocument* pImpressDocument = 
dynamic_cast(mxComponent.get());
 CPPUNIT_ASSERT(pImpressDocument);
 pImpressDocument->initializeForTiledRendering(rArguments);


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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/sdmodeltestbase.hxx |   17 -
 1 file changed, 17 deletions(-)

New commits:
commit 6baffb816eb2b5b4223059c3bfadb8d3d8cac7d0
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 10:55:05 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 12:26:46 2022 +0100

SdModelTestBaseXML is now unused

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

diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 100f0e322f59..a571f753c44d 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -441,23 +441,6 @@ protected:
 
 };
 
-class SdModelTestBaseXML
-: public SdModelTestBase, public XmlTestTools
-{
-
-public:
-xmlDocUniquePtr parseExport(utl::TempFileNamed const & rTempFile, OUString 
const& rStreamName)
-{
-std::unique_ptr const pStream(parseExportStream(rTempFile, 
rStreamName));
-xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
-OUString const url(rTempFile.GetURL());
-pXmlDoc->name = reinterpret_cast(xmlStrdup(
-reinterpret_cast(OUStringToOString(url, 
RTL_TEXTENCODING_UTF8).getStr(;
-return pXmlDoc;
-}
-
-};
-
 class SdUnoApiTest : public UnoApiTest
 {
 public:


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

2022-10-31 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests.cxx |  672 
 1 file changed, 246 insertions(+), 426 deletions(-)

New commits:
commit c66def668e43bb40eee54fe91e752ba1330cb911
Author: Xisco Fauli 
AuthorDate: Mon Oct 31 10:53:53 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 31 12:25:25 2022 +0100

CppunitTest_sd_export_tests: inherit from UnoApiTest

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index f219e936ca9f..916bca2f3d93 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -48,9 +48,14 @@
 using namespace css;
 using namespace css::animations;
 
-class SdExportTest : public SdModelTestBaseXML
+class SdExportTest : public SdUnoApiTestXml
 {
 public:
+SdExportTest()
+: SdUnoApiTestXml("/sd/qa/unit/data/")
+{
+}
+
 void testBackgroundImage();
 void testMediaEmbedding();
 void testFillBitmapUnused();
@@ -156,13 +161,11 @@ public:
 
 namespace
 {
-uno::Reference getBitmapFromTable(const sd::DrawDocShellRef& 
xDocShRef,
-OUString const& rName)
+uno::Reference getBitmapFromTable(SdDrawDocument* pDoc, OUString 
const& rName)
 {
 uno::Reference xBitmap;
 
-uno::Reference 
xFactory(xDocShRef->GetDoc()->getUnoModel(),
-uno::UNO_QUERY);
+uno::Reference 
xFactory(pDoc->getUnoModel(), uno::UNO_QUERY);
 
 try
 {
@@ -189,16 +192,18 @@ void SdExportTest::testBackgroundImage()
 // Check if Slide background image is imported from PPTX and exported to 
PPTX, PPT and ODP correctly
 
 OUString bgImageName;
-sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/n821567.pptx"), 
PPTX);
+loadFromURL(u"pptx/n821567.pptx");
 
 // Check that imported background image from PPTX exists
 {
-uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
- uno::UNO_QUERY_THROW);
+SdXImpressDocument* pXImpressDocument
+= dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pXImpressDocument);
+SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
+uno::Reference xDoc(pDoc->getUnoModel(), 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", 
static_cast(1),
  xDoc->getDrawPages()->getCount());
-uno::Reference xPage(getPage(0, xDocShRef));
+uno::Reference xPage(getPage(0));
 
 uno::Reference xPropertySet(xPage, 
uno::UNO_QUERY);
 uno::Any aAny = xPropertySet->getPropertyValue("Background");
@@ -212,19 +217,22 @@ void SdExportTest::testBackgroundImage()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Slide Background is not imported from 
PPTX correctly",
  OUString("msFillBitmap 1"), bgImageName);
 
-uno::Reference xBitmap = getBitmapFromTable(xDocShRef, 
bgImageName);
+uno::Reference xBitmap = getBitmapFromTable(pDoc, 
bgImageName);
 CPPUNIT_ASSERT_MESSAGE("Slide Background Bitmap is missing when 
imported from PPTX",
xBitmap.is());
 }
 
 // Save as PPTX, reload and check again so we make sure exporting to PPTX 
is working correctly
 {
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
-uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
- uno::UNO_QUERY_THROW);
+saveAndReload("Impress Office Open XML");
+SdXImpressDocument* pXImpressDocument
+= dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pXImpressDocument);
+SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
+uno::Reference xDoc(pDoc->getUnoModel(), 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", 
static_cast(1),
  xDoc->getDrawPages()->getCount());
-uno::Reference xPage(getPage(0, xDocShRef));
+uno::Reference xPage(getPage(0));
 
 uno::Reference xPropertySet(xPage, 
uno::UNO_QUERY);
 uno::Any aAny = xPropertySet->getPropertyValue("Background");
@@ -238,19 +246,22 @@ void SdExportTest::testBackgroundImage()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Slide Background is not exported from 
PPTX correctly",
  OUString("msFillBitmap 1"), bgImageName);
 
-uno::Reference xBitmap = getBitmapFromTable(xDocShRef, 
bgImageName);
+uno::Reference xBitmap = getBitmapFromTable(pDoc, 
bgImageName);
 CPPUNIT_ASSERT_MESSAGE("Slide Background Bitmap is missing when 
exported from PPTX",
xBitmap.is());

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

2022-10-31 Thread Maxim Monastirsky (via logerrit)
 sd/qa/unit/data/odg/tablestyles.fodg   |   34 ++
 sd/qa/unit/export-tests.cxx|   35 +++
 xmloff/source/table/XMLTableExport.cxx |   14 ++-
 xmloff/source/table/XMLTableImport.cxx |   42 -
 4 files changed, 123 insertions(+), 2 deletions(-)

New commits:
commit 6f32f1a12be06c4da92b807d8a35cb079984e26a
Author: Maxim Monastirsky 
AuthorDate: Fri Oct 28 12:20:49 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Mon Oct 31 11:49:11 2022 +0100

tdf#72238 xmloff,sd: Import of 

Handles fo:border*, fo:padding*, fo:background-color and
style:vertical-align attributes.

Export is unchanged for now, as older versions still
can't read this, and on the other hand we probably want
to keep the import of the wrong attributes for the long
term, to not break existing documents. Also, we can't
fully export fill properties anyway because of tdf#103602.

Change-Id: I8687507b98602ffcd05adb2087c894bb45aa3c6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142058
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 

diff --git a/sd/qa/unit/data/odg/tablestyles.fodg 
b/sd/qa/unit/data/odg/tablestyles.fodg
new file mode 100644
index ..7b54e73955f9
--- /dev/null
+++ b/sd/qa/unit/data/odg/tablestyles.fodg
@@ -0,0 +1,34 @@
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer; 
xmlns:xlink="http://www.w3.org/1999/xli
 nk" xmlns:drawooo="http://openoffice.org/2010/draw; 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form: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:officeooo="http://openoffice.org/2009/office; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:o
 oo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.graphics">
+  
+  
+  
+
+  
+
+
+  
+
+
+
+  
+
+  
+  
+
+  
+  
+
+  
+
+  
+
+
+  
+
+  
+
+  
+
+  
+
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 1a4060731387..f219e936ca9f 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -95,6 +96,7 @@ public:
 void testMasterPageBackgroundFullSize();
 void testColumnsODG();
 void testTdf112126();
+void testCellProperties();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -143,6 +145,7 @@ public:
 CPPUNIT_TEST(testMasterPageBackgroundFullSize);
 CPPUNIT_TEST(testColumnsODG);
 CPPUNIT_TEST(testTdf112126);
+CPPUNIT_TEST(testCellProperties);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -1994,6 +1997,38 @@ void SdExportTest::testTdf112126()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testCellProperties()
+{
+auto xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odg/tablestyles.fodg"), 
FODG);
+utl::TempFileNamed tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), ODG, );
+
+const SdrPage* pPage = GetPage(1, xDocShRef);
+auto pTableObj = dynamic_cast(pPage->GetObj(0));
+

[Libreoffice-commits] core.git: sd/qa solenv/clang-format

2022-10-28 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests.cxx |  820 +---
 solenv/clang-format/excludelist |1 
 2 files changed, 520 insertions(+), 301 deletions(-)

New commits:
commit 57b88487295bfbae056361d3614e477491c34055
Author: Xisco Fauli 
AuthorDate: Fri Oct 28 17:13:12 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 28 23:04:14 2022 +0200

CppunitTest_sd_export_tests: use clang-format

Do it before changing the inheritance

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

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index a040438fb103..1a4060731387 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -149,7 +149,6 @@ public:
 {
 XmlTestTools::registerODFNamespaces(pXmlXPathCtx);
 }
-
 };
 
 namespace
@@ -159,24 +158,25 @@ uno::Reference getBitmapFromTable(const 
sd::DrawDocShellRef& xDocS
 {
 uno::Reference xBitmap;
 
-uno::Reference 
xFactory(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
+uno::Reference 
xFactory(xDocShRef->GetDoc()->getUnoModel(),
+uno::UNO_QUERY);
 
 try
 {
-uno::Reference 
xBitmapTable(xFactory->createInstance("com.sun.star.drawing.BitmapTable"), 
uno::UNO_QUERY);
+uno::Reference xBitmapTable(
+xFactory->createInstance("com.sun.star.drawing.BitmapTable"), 
uno::UNO_QUERY);
 uno::Any rValue = xBitmapTable->getByName(rName);
 if (rValue.has>())
 {
 return rValue.get>();
 }
 }
-catch (const uno::Exception & /*rEx*/)
+catch (const uno::Exception& /*rEx*/)
 {
 }
 
 return xBitmap;
 }
-
 }
 
 void SdExportTest::testBackgroundImage()
@@ -186,12 +186,15 @@ void SdExportTest::testBackgroundImage()
 // Check if Slide background image is imported from PPTX and exported to 
PPTX, PPT and ODP correctly
 
 OUString bgImageName;
-sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/n821567.pptx"), 
PPTX);
+sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/n821567.pptx"), 
PPTX);
 
 // Check that imported background image from PPTX exists
 {
-uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", 
static_cast(1), xDoc->getDrawPages()->getCount());
+uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", 
static_cast(1),
+ xDoc->getDrawPages()->getCount());
 uno::Reference xPage(getPage(0, xDocShRef));
 
 uno::Reference xPropertySet(xPage, 
uno::UNO_QUERY);
@@ -203,17 +206,21 @@ void SdExportTest::testBackgroundImage()
 aAny = xBackgroundPropSet->getPropertyValue("FillBitmapName");
 aAny >>= bgImageName;
 }
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Slide Background is not imported from 
PPTX correctly", OUString("msFillBitmap 1"), bgImageName);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Slide Background is not imported from 
PPTX correctly",
+ OUString("msFillBitmap 1"), bgImageName);
 
 uno::Reference xBitmap = getBitmapFromTable(xDocShRef, 
bgImageName);
-CPPUNIT_ASSERT_MESSAGE("Slide Background Bitmap is missing when 
imported from PPTX", xBitmap.is());
+CPPUNIT_ASSERT_MESSAGE("Slide Background Bitmap is missing when 
imported from PPTX",
+   xBitmap.is());
 }
 
 // Save as PPTX, reload and check again so we make sure exporting to PPTX 
is working correctly
 {
 xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
-uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", 
static_cast(1), xDoc->getDrawPages()->getCount());
+uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", 
static_cast(1),
+ xDoc->getDrawPages()->getCount());
 uno::Reference xPage(getPage(0, xDocShRef));
 
 uno::Reference xPropertySet(xPage, 
uno::UNO_QUERY);
@@ -225,17 +232,21 @@ void SdExportTest::testBackgroundImage()
 aAny = xBackgroundPropSet->getPropertyValue("FillBitmapName");
 aAny >>= bgImageName;
 }
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Slide Background is not exported from 
PPTX correctly", OUString("msFillBitmap 1"), bgImageName);
+

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

2022-10-28 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml3.cxx |  799 +
 1 file changed, 285 insertions(+), 514 deletions(-)

New commits:
commit 615d7d5b98e972c985f0db786a161250b23a4cee
Author: Xisco Fauli 
AuthorDate: Fri Oct 28 17:08:23 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 28 22:11:03 2022 +0200

CppunitTest_sd_export_tests-ooxml3: inherit from UnoApiTest

Adapt code in testTdf115005_FallBack_Images to ignore
Thumbnails/thumbnail.png. Now they are generated when saving

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

diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index aa0249a56d7d..9f4aec9ad41d 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -33,9 +33,14 @@
 
 #include 
 
-class SdOOXMLExportTest3 : public SdModelTestBaseXML
+class SdOOXMLExportTest3 : public SdUnoApiTestXml
 {
 public:
+SdOOXMLExportTest3()
+: SdUnoApiTestXml("/sd/qa/unit/data/")
+{
+}
+
 void testTdf129430();
 void testTdf114848();
 void testTdf147586();
@@ -224,11 +229,8 @@ public:
 
 void SdOOXMLExportTest3::testTdf129430()
 {
-sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf129430.odp"), 
ODP);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
-xDocShRef->DoClose();
+loadFromURL(u"odp/tdf129430.odp");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDoc1 = parseExport(tempFile, "ppt/slides/slide1.xml");
 assertXPath(pXmlDoc1, 
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:pPr/a:lnSpc/a:spcPct",
@@ -237,11 +239,8 @@ void SdOOXMLExportTest3::testTdf129430()
 
 void SdOOXMLExportTest3::testTdf114848()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf114848.pptx"), 
PPTX);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
-xDocShRef->DoClose();
+loadFromURL(u"pptx/tdf114848.pptx");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocTheme1 = parseExport(tempFile, 
"ppt/theme/theme1.xml");
 assertXPath(pXmlDocTheme1, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val",
@@ -253,11 +252,8 @@ void SdOOXMLExportTest3::testTdf114848()
 
 void SdOOXMLExportTest3::testTdf147586()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf147586.pptx"), 
PPTX);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
-xDocShRef->DoClose();
+loadFromURL(u"pptx/tdf147586.pptx");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 // Without the fix in place, this test would have failed with
@@ -273,11 +269,8 @@ void SdOOXMLExportTest3::testTdf147586()
 
 void SdOOXMLExportTest3::testTdf68759()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf68759.odp"), ODP);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
-xDocShRef->DoClose();
+loadFromURL(u"odp/tdf68759.odp");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:pic[1]/p:spPr/a:xfrm/a:off", "x",
@@ -299,11 +292,8 @@ void SdOOXMLExportTest3::testTdf68759()
 
 void SdOOXMLExportTest3::testTdf127901()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf127901.odp"), ODP);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
-xDocShRef->DoClose();
+loadFromURL(u"odp/tdf127901.odp");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 assertXPath(pXmlDocContent1, 
"/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:lum", "bright",
@@ -321,11 +311,8 @@ void SdOOXMLExportTest3::testTdf127901()
 
 void SdOOXMLExportTest3::testTdf48735()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf48735.odp"), ODP);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
-xDocShRef->DoClose();
+loadFromURL(u"odp/tdf48735.odp");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 

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

2022-10-28 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/misc-tests.cxx |   84 --
 sd/qa/unit/uiimpress.cxx  |   47 +
 2 files changed, 48 insertions(+), 83 deletions(-)

New commits:
commit 8c0117a5abd03026d8ea2a06fc4f6fc534e04f48
Author: Xisco Fauli 
AuthorDate: Fri Oct 28 12:53:06 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 28 16:15:05 2022 +0200

sd: get rid of duplicated code...

... by moving a couple of tests to a place with
similar tests
Surprisingly, testTdf96708 fails now with

sd/qa/unit/uiimpress.cxx:372:testTdf96708::TestBody
equality assertion failed
- Expected: 4
- Actual  : 5

which also fails when tested manually, so it seems
the tests didn't work properly before.
Issue reported in tdf#151802

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

diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 3ea3ec4a9064..aec8dafd75ed 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -40,11 +40,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -66,8 +61,6 @@ using namespace ::com::sun::star;
 class SdMiscTest : public SdModelTestBaseXML
 {
 public:
-void testTdf96206();
-void testTdf96708();
 void testTdf99396();
 void testTableObjectUndoTest();
 void testFillGradient();
@@ -89,8 +82,6 @@ public:
 void testTdf136956();
 
 CPPUNIT_TEST_SUITE(SdMiscTest);
-CPPUNIT_TEST(testTdf96206);
-CPPUNIT_TEST(testTdf96708);
 CPPUNIT_TEST(testTdf99396);
 CPPUNIT_TEST(testTableObjectUndoTest);
 CPPUNIT_TEST(testFillGradient);
@@ -154,83 +145,9 @@ sd::DrawDocShellRef SdMiscTest::Load(const OUString& rURL, 
sal_Int32 nFormat)
 // introduce model/view/controller to each other
 utl::ConnectFrameControllerModel(xTargetFrame, xController, xModel2);
 
-sd::ViewShell* pViewShell = xDocSh->GetViewShell();
-CPPUNIT_ASSERT(pViewShell);
-
-// Draw has no slidesorter, Impress never shows a LayerTabBar
-if (sd::ViewShell::ST_DRAW == pViewShell->GetShellType())
-{
-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
-Scheduler::ProcessEventsToIdle();
-if ((pSSVS = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(
- pViewShell->GetViewShellBase()))
-!= nullptr)
-break;
-osl::Thread::wait(std::chrono::milliseconds(100));
-}
-CPPUNIT_ASSERT(pSSVS);
-}
-
 return xDocSh;
 }
 
-void SdMiscTest::testTdf96206()
-{
-// Copying/pasting slide referring to a non-default master with a text 
duplicated the master
-
-sd::DrawDocShellRef xDocSh
-= 
Load(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf96206.odp"), ODP);
-sd::ViewShell* pViewShell = xDocSh->GetViewShell();
-auto pSSVS
-= 
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase());
-auto& rSSController = pSSVS->GetSlideSorter().GetController();
-
-const sal_uInt16 nMasterPageCnt1 = 
xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
-CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), nMasterPageCnt1);
-rSSController.GetClipboard().DoCopy();
-rSSController.GetClipboard().DoPaste();
-const sal_uInt16 nMasterPageCnt2 = 
xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
-CPPUNIT_ASSERT_EQUAL(nMasterPageCnt1, nMasterPageCnt2);
-
-xDocSh->DoClose();
-}
-
-void SdMiscTest::testTdf96708()
-{
-sd::DrawDocShellRef xDocSh
-= 
Load(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf96708.odp"), ODP);
-sd::ViewShell* pViewShell = xDocSh->GetViewShell();
-auto pSSVS
-= 
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase());
-auto& rSSController = pSSVS->GetSlideSorter().GetController();
-auto& rPageSelector = rSSController.GetPageSelector();
-
-const sal_uInt16 nMasterPageCnt1 = 
xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
-CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), nMasterPageCnt1);
-rPageSelector.SelectAllPages();
-rSSController.GetClipboard().DoCopy();
-
-// Now wait for timers to trigger creation of auto-layout
-osl::Thread::wait(std::chrono::milliseconds(100));
-Scheduler::ProcessEventsToIdle();
-
-rSSController.GetClipboard().DoPaste();
-const sal_uInt16 nMasterPageCnt2 = 

[Libreoffice-commits] core.git: sd/qa solenv/clang-format

2022-10-28 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/misc-tests.cxx   |  379 +---
 solenv/clang-format/excludelist |1 
 2 files changed, 240 insertions(+), 140 deletions(-)

New commits:
commit 2fce155c8939c83d80cacc4ead8110ff75ce1b4c
Author: Xisco Fauli 
AuthorDate: Thu Oct 27 19:39:47 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 28 15:50:01 2022 +0200

CppunitTest_sd_misc_tests: use clang-format

Do it before changing the inheritance

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

diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 275ee32dbb12..3ea3ec4a9064 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -112,7 +112,7 @@ public:
 CPPUNIT_TEST(testTdf136956);
 CPPUNIT_TEST_SUITE_END();
 
-virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
+virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
 {
 XmlTestTools::registerODFNamespaces(pXmlXPathCtx);
 }
@@ -123,11 +123,12 @@ private:
 
 sd::DrawDocShellRef SdMiscTest::Load(const OUString& rURL, sal_Int32 nFormat)
 {
-uno::Reference< frame::XDesktop2 > xDesktop = 
frame::Desktop::create(::comphelper::getProcessComponentContext());
+uno::Reference xDesktop
+= frame::Desktop::create(::comphelper::getProcessComponentContext());
 CPPUNIT_ASSERT(xDesktop.is());
 
 // create a frame
-uno::Reference< frame::XFrame > xTargetFrame = 
xDesktop->findFrame("_blank", 0);
+uno::Reference xTargetFrame = xDesktop->findFrame("_blank", 
0);
 CPPUNIT_ASSERT(xTargetFrame.is());
 
 // This ContainerWindow corresponds to the outermost window of a running 
LibreOffice.
@@ -143,22 +144,24 @@ sd::DrawDocShellRef SdMiscTest::Load(const OUString& 
rURL, sal_Int32 nFormat)
 sd::DrawDocShellRef xDocSh = loadURL(rURL, nFormat);
 CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.is());
 
-uno::Reference< frame::XModel2 > xModel2 = xDocSh->GetModel();
+uno::Reference xModel2 = xDocSh->GetModel();
 CPPUNIT_ASSERT(xModel2.is());
 
-uno::Reference< frame::XController2 > xController = 
xModel2->createDefaultViewController(xTargetFrame);
+uno::Reference xController
+= xModel2->createDefaultViewController(xTargetFrame);
 CPPUNIT_ASSERT(xController.is());
 
 // introduce model/view/controller to each other
 utl::ConnectFrameControllerModel(xTargetFrame, xController, xModel2);
 
-sd::ViewShell *pViewShell = xDocSh->GetViewShell();
+sd::ViewShell* pViewShell = xDocSh->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
 
 // Draw has no slidesorter, Impress never shows a LayerTabBar
 if (sd::ViewShell::ST_DRAW == pViewShell->GetShellType())
 {
-sd::LayerTabBar* pLayerTabBar = 
static_cast(pViewShell)->GetLayerTabControl();
+sd::LayerTabBar* pLayerTabBar
+= 
static_cast(pViewShell)->GetLayerTabControl();
 CPPUNIT_ASSERT(pLayerTabBar);
 pLayerTabBar->StateChanged(StateChangedType::InitShow);
 }
@@ -169,7 +172,9 @@ sd::DrawDocShellRef SdMiscTest::Load(const OUString& rURL, 
sal_Int32 nFormat)
 {
 // Process all Tasks - slide sorter is created here
 Scheduler::ProcessEventsToIdle();
-if ((pSSVS = 
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase()))
 != nullptr)
+if ((pSSVS = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(
+ pViewShell->GetViewShellBase()))
+!= nullptr)
 break;
 osl::Thread::wait(std::chrono::milliseconds(100));
 }
@@ -183,9 +188,11 @@ void SdMiscTest::testTdf96206()
 {
 // Copying/pasting slide referring to a non-default master with a text 
duplicated the master
 
-sd::DrawDocShellRef xDocSh = 
Load(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf96206.odp"), ODP);
-sd::ViewShell *pViewShell = xDocSh->GetViewShell();
-auto pSSVS = 
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase());
+sd::DrawDocShellRef xDocSh
+= 
Load(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf96206.odp"), ODP);
+sd::ViewShell* pViewShell = xDocSh->GetViewShell();
+auto pSSVS
+= 
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase());
 auto& rSSController = pSSVS->GetSlideSorter().GetController();
 
 const sal_uInt16 nMasterPageCnt1 = 
xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
@@ -200,9 +207,11 @@ void SdMiscTest::testTdf96206()
 
 void SdMiscTest::testTdf96708()
 {
-sd::DrawDocShellRef xDocSh = 
Load(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf96708.odp"), ODP);
-sd::ViewShell *pViewShell = xDocSh->GetViewShell();
-auto pSSVS = 

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

2022-10-27 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx |  648 -
 1 file changed, 213 insertions(+), 435 deletions(-)

New commits:
commit 02db1642c9ce4394f4f85755c4a0a831e547e4fb
Author: Xisco Fauli 
AuthorDate: Thu Oct 27 19:12:17 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 27 22:24:17 2022 +0200

CppunitTest_sd_export_tests-ooxml2: inherit from UnoApiTest

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

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index fcb6b3653f27..493d6be5b64c 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -68,9 +68,14 @@ static void assertMotionPath(std::u16string_view rStr1, 
std::u16string_view rStr
 assertEquals(sal_Int32(-1), nIdx2, rSourceLine, sMessage.getStr());
 }
 
-class SdOOXMLExportTest2 : public SdModelTestBaseXML
+class SdOOXMLExportTest2 : public SdUnoApiTestXml
 {
 public:
+SdOOXMLExportTest2()
+: SdUnoApiTestXml("/sd/qa/unit/data/")
+{
+}
+
 void testTdf151492();
 void testTdf149697();
 void testTdf149126();
@@ -219,29 +224,22 @@ public:
 
 void SdOOXMLExportTest2::testTdf151492()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf151492.odp"), 
ODP);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+loadFromURL(u"odp/tdf151492.odp");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn",
 "idx", "0");
-
-xDocShRef->DoClose();
 }
 
 void SdOOXMLExportTest2::testTdf149697()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149697.pptx"), 
PPTX);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+loadFromURL(u"pptx/tdf149697.pptx");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 assertXPath(pXmlDocContent,
 
"/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", 
"5");
-
 assertXPath(pXmlDocContent,
 
"/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", 
"4");
 
@@ -250,30 +248,22 @@ void SdOOXMLExportTest2::testTdf149697()
 
 assertXPath(pXmlDocContent,
 
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", 
"1");
-
-xDocShRef->DoClose();
 }
 
 void SdOOXMLExportTest2::testTdf149126()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf149126.odp"), 
ODP);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+loadFromURL(u"odp/tdf149126.odp");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom", "prst",
 "triangle");
-
-xDocShRef->DoClose();
 }
 
 void SdOOXMLExportTest2::testTdf131905()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf131905.pptx"), 
PPTX);
-utl::TempFileNamed tempFile;
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+loadFromURL(u"pptx/tdf131905.pptx");
+utl::TempFileNamed tempFile = save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, 
"ppt/slides/slide1.xml");
 assertXPath(
@@ -290,16 +280,13 @@ void SdOOXMLExportTest2::testTdf131905()
 pXmlDocContent,
 
"/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[3]/a:tc/a:tcPr",
 "anchor", "b");
-
-xDocShRef->DoClose();
 }
 
 void SdOOXMLExportTest2::testTdf93883()
 {
-::sd::DrawDocShellRef xDocShRef
-= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf93883.odp"), ODP);
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
-uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
+loadFromURL(u"odp/tdf93883.odp");
+saveAndReload("Impress Office Open XML");
+uno::Reference xShape(getShapeFromPage(0, 0));
 uno::Reference const xParagraph(getParagraphFromShape(0, 
xShape));
 uno::Reference xPropSet(xParagraph, 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT(!xPropSet->getPropertyValue("NumberingLevel").hasValue());
@@ -308,39 +295,36 @@ void SdOOXMLExportTest2::testTdf93883()
 void 

[Libreoffice-commits] core.git: sd/qa solenv/clang-format

2022-10-27 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx | 1285 +++--
 solenv/clang-format/excludelist|1 
 2 files changed, 801 insertions(+), 485 deletions(-)

New commits:
commit ba994b6ce2af211cdb89f8f7d91b3ae64ecfb5cd
Author: Xisco Fauli 
AuthorDate: Thu Oct 27 19:11:14 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 27 22:23:56 2022 +0200

CppunitTest_sd_export_tests-ooxml2: use clang-format

Do it before changing the inheritance

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

diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 6b7e934a176f..fcb6b3653f27 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -31,35 +31,36 @@
 using namespace css;
 using namespace css::animations;
 
-namespace {
-
+namespace
+{
 bool checkBeginWithNumber(std::u16string_view aStr)
 {
 sal_Unicode aChar = (aStr.size() > 1) ? aStr[0] : '\0';
 return aChar == '.' || aChar == '-' || rtl::isAsciiDigit(aChar);
 }
-
 }
 
-#define CPPUNIT_ASSERT_MOTIONPATH(expect, actual) \
-  assertMotionPath(expect, actual, CPPUNIT_SOURCELINE())
+#define CPPUNIT_ASSERT_MOTIONPATH(expect, actual)  
\
+assertMotionPath(expect, actual, CPPUNIT_SOURCELINE())
 
-static void assertMotionPath(std::u16string_view rStr1, std::u16string_view 
rStr2, const CppUnit::SourceLine )
+static void assertMotionPath(std::u16string_view rStr1, std::u16string_view 
rStr2,
+ const CppUnit::SourceLine& rSourceLine)
 {
 sal_Int32 nIdx1 = 0;
 sal_Int32 nIdx2 = 0;
 
-OString sMessage = "Motion path values mismatch.\nExpect: " +
-OUStringToOString(rStr1, RTL_TEXTENCODING_UTF8) +
-"\nActual: " + OUStringToOString(rStr2, RTL_TEXTENCODING_UTF8);
+OString sMessage
+= "Motion path values mismatch.\nExpect: " + OUStringToOString(rStr1, 
RTL_TEXTENCODING_UTF8)
+  + "\nActual: " + OUStringToOString(rStr2, RTL_TEXTENCODING_UTF8);
 
-while(nIdx1 != -1 && nIdx2 != -1)
+while (nIdx1 != -1 && nIdx2 != -1)
 {
-OUString aToken1( o3tl::getToken(rStr1, 0, ' ', nIdx1) );
-OUString aToken2( o3tl::getToken(rStr2, 0, ' ', nIdx2) );
+OUString aToken1(o3tl::getToken(rStr1, 0, ' ', nIdx1));
+OUString aToken2(o3tl::getToken(rStr2, 0, ' ', nIdx2));
 
 if (checkBeginWithNumber(aToken1) && checkBeginWithNumber(aToken2))
-assertDoubleEquals(aToken1.toDouble(), aToken2.toDouble(), 
DBL_EPSILON, rSourceLine, sMessage.getStr());
+assertDoubleEquals(aToken1.toDouble(), aToken2.toDouble(), 
DBL_EPSILON, rSourceLine,
+   sMessage.getStr());
 else
 assertEquals(aToken1, aToken2, rSourceLine, sMessage.getStr());
 }
@@ -238,17 +239,17 @@ void SdOOXMLExportTest2::testTdf149697()
 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
 
 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, 
"ppt/slides/slide1.xml");
-assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn",
-"idx", "5");
+assertXPath(pXmlDocContent,
+
"/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", 
"5");
 
-assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn",
-"idx", "4");
+assertXPath(pXmlDocContent,
+
"/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", 
"4");
 
-assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn",
-"idx", "3");
+assertXPath(pXmlDocContent,
+
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", 
"3");
 
-assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn",
-"idx", "1");
+assertXPath(pXmlDocContent,
+
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", 
"1");
 
 xDocShRef->DoClose();
 }
@@ -295,79 +296,79 @@ void SdOOXMLExportTest2::testTdf131905()
 
 void SdOOXMLExportTest2::testTdf93883()
 {
-::sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf93883.odp"), ODP);
-xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
-uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, 
xDocShRef ) );
-uno::Reference const xParagraph( getParagraphFromShape( 
0, xShape ) );
-uno::Reference< beans::XPropertySet > xPropSet( xParagraph, 
uno::UNO_QUERY_THROW );
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf93883.odp"), ODP);
+xDocShRef = 

[Libreoffice-commits] core.git: sd/qa solenv/clang-format

2022-10-27 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/export-tests-ooxml1.cxx |  795 -
 solenv/clang-format/excludelist|1 
 2 files changed, 451 insertions(+), 345 deletions(-)

New commits:
commit 58220942d65b81c8586f1c2984a0faf84ed9172c
Author: Xisco Fauli 
AuthorDate: Thu Oct 27 18:10:02 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 27 19:29:54 2022 +0200

CppunitTest_sd_export_tests-ooxml1: use clang-format

Do it before changing the inheritance

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

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 624dcede7eb3..f9254ad6cfcc 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -200,25 +200,24 @@ public:
 }
 };
 
-namespace {
-
-template< typename ItemValue, typename ItemType >
-void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 
nId)
+namespace
+{
+template 
+void checkFontAttributes(const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 
nId)
 {
-CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
+CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
 const EditTextObject& aEdit = 
pObj->GetOutlinerParaObject()->GetTextObject();
 std::vector rLst;
 aEdit.GetCharAttribs(0, rLst);
-for( std::vector::reverse_iterator it = rLst.rbegin(); 
it!=rLst.rend(); ++it)
+for (std::vector::reverse_iterator it = rLst.rbegin(); it != 
rLst.rend(); ++it)
 {
-const ItemType* pAttrib = dynamic_cast((*it).pAttr);
+const ItemType* pAttrib = dynamic_cast((*it).pAttr);
 if (pAttrib && pAttrib->Which() == nId)
 {
-CPPUNIT_ASSERT_EQUAL( nVal, 
static_cast(pAttrib->GetValue()));
+CPPUNIT_ASSERT_EQUAL(nVal, 
static_cast(pAttrib->GetValue()));
 }
 }
 }
-
 }
 
 void SdOOXMLExportTest1::testTdf149311()
@@ -244,10 +243,14 @@ void SdOOXMLExportTest1::testTdf149128()
 xDocShRef->DoClose();
 
 xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
-assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id", "42");
-assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", "0");
-assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "id", "43");
-assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", "2");
+assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id",
+"42");
+assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx",
+"0");
+assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "id",
+"43");
+assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx",
+"2");
 }
 
 void SdOOXMLExportTest1::testTdf66228()
@@ -260,7 +263,7 @@ void SdOOXMLExportTest1::testTdf66228()
 
 xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", 
"prst",
-"bentConnector3");
+"bentConnector3");
 }
 
 void SdOOXMLExportTest1::testTdf147919()
@@ -275,23 +278,29 @@ void SdOOXMLExportTest1::testTdf147919()
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:spPr/a:prstGeom", "prst",
 "bentConnector2");
 
-assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom/a:avLst/a:gd", "name", 
"adj1");
+assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom/a:avLst/a:gd", "name",
+"adj1");
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom", "prst",
 "bentConnector3");
 
 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", 
"flipH", "1");
 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", 
"rot", "1620");
-assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", 
"adj1");
-assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", "name", 
"adj2");
+assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
+"name", "adj1");
+assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
+"name", "adj2");
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom", "prst",
 "bentConnector4");
 
 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", 
"flipH", "1");
 assertXPath(pXmlDoc, 

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

2022-10-13 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/uiimpress.cxx |   25 +
 1 file changed, 25 insertions(+)

New commits:
commit ed99b776d59d6293a97e61dc5284619cc873e35b
Author: Xisco Fauli 
AuthorDate: Thu Oct 13 13:21:54 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 13 17:40:51 2022 +0200

tdf#151417: sd_uiimpress: Add unittest

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

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index fafd3fe4cc56..627a652da622 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -899,6 +899,31 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf38669)
 CPPUNIT_ASSERT_EQUAL(OUString(u"°"), xShape->getString());
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf151417)
+{
+mxComponent = loadFromDesktop("private:factory/simpress",
+  
"com.sun.star.presentation.PresentationDocument");
+auto pImpressDocument = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pImpressDocument);
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference xDraws = 
xDrawPagesSupplier->getDrawPages();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
+
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDrawPage->getCount());
+
+uno::Sequence aArgs(
+comphelper::InitPropertySequence({ { "KeyModifier", uno::Any(KEY_MOD1) 
} }));
+
+// Without the fix in place, this test would have crashed here
+dispatchCommand(mxComponent, ".uno:Edit", aArgs);
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123841)
 {
 // To check if selecting unfilled rectangle produces unfilled rectangle


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

2022-09-16 Thread Regina Henschel (via logerrit)
 sd/qa/unit/data/odp/tdf149551_btlr.odp   |binary
 sd/qa/unit/data/odp/tdf149551_tbrl90.odp |binary
 sd/qa/unit/export-tests-ooxml3.cxx   |   77 +++
 3 files changed, 77 insertions(+)

New commits:
commit 6c635fb11af389d88f36d4bf6b43421af062086a
Author: Regina Henschel 
AuthorDate: Fri Sep 16 13:11:33 2022 +0200
Commit: Regina Henschel 
CommitDate: Fri Sep 16 18:05:03 2022 +0200

tdf#149551 unit test writing mode in shape in Impress

Commit c70ee4a6b9071468255e5d4fdb893e9c9bdf4fad has among other things
enabled, that a shape in Impress can use a writing mode corresponding to
vert='vert' in a pptx file. It is new value text::WritingMode2::TB_RL90
for property WritingMode. It is written with value 'tb-rl90' to attribute
loext:writing-mode in ODF.

The same commit has enabled, that the writing mode 'bt-rl' can be used
not only for frames in Writer but for shapes in Impress too.

The unit tests here test round-trip of these property values.

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

diff --git a/sd/qa/unit/data/odp/tdf149551_btlr.odp 
b/sd/qa/unit/data/odp/tdf149551_btlr.odp
new file mode 100644
index ..41db04d782d1
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf149551_btlr.odp differ
diff --git a/sd/qa/unit/data/odp/tdf149551_tbrl90.odp 
b/sd/qa/unit/data/odp/tdf149551_tbrl90.odp
new file mode 100644
index ..486fcea58b78
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf149551_tbrl90.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index d80518f2e844..dd79bb47f6a7 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -118,6 +119,8 @@ public:
 void testTdf109169_OctagonBevel();
 void testTdf109169_DiamondBevel();
 void testTdf144092_emptyShapeTextProps();
+void testTdf149551_tbrl90();
+void testTdf149551_btlr();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
 
@@ -202,6 +205,8 @@ public:
 CPPUNIT_TEST(testTdf109169_OctagonBevel);
 CPPUNIT_TEST(testTdf109169_DiamondBevel);
 CPPUNIT_TEST(testTdf144092_emptyShapeTextProps);
+CPPUNIT_TEST(testTdf149551_tbrl90);
+CPPUNIT_TEST(testTdf149551_btlr);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -2141,6 +2146,78 @@ void 
SdOOXMLExportTest3::testTdf144092_emptyShapeTextProps()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest3::testTdf149551_tbrl90()
+{
+// The document contains a shape with writing mode TB_RL90. That is the 
same as vert="vert" in
+// OOXML. Without the patch it was not possible to use this writing mode 
at all.
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf149551_tbrl90.odp"),
 ODP);
+
+// Test, that the shape has writing mode TB_RL90.
+uno::Reference xShapeProps(getShapeFromPage(0, 0, 
xDocShRef));
+sal_Int16 eWritingMode;
+xShapeProps->getPropertyValue("WritingMode") >>= eWritingMode;
+CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL90, eWritingMode);
+
+// Test, that it is exported to vert="vert"
+utl::TempFile aTempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDoc, "//a:bodyPr", "vert", "vert");
+
+// Test, that the shape has writing mode TB_RL90 after read from pptx
+uno::Reference xShapeProps2(getShapeFromPage(0, 0, 
xDocShRef));
+sal_Int16 eWritingMode2;
+xShapeProps2->getPropertyValue("WritingMode") >>= eWritingMode2;
+CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL90, eWritingMode2);
+
+// Test, that it is written to odp with loext:writing-mode="tb-rl90"
+aTempFile.EnableKillingFile();
+save(xDocShRef.get(), getFormat(ODP), aTempFile);
+pXmlDoc = parseExport(aTempFile, "content.xml");
+assertXPath(
+pXmlDoc,
+
"//style:style[@style:name='gr1']/style:graphic-properties[@loext:writing-mode='tb-rl90']");
+
+xDocShRef->DoClose();
+}
+
+void SdOOXMLExportTest3::testTdf149551_btlr()
+{
+// The document contains a shape with writing mode BT_LR. That is the same 
as vert="vert270" in
+// OOXML. Without the patch it was not possible to use this writing mode 
at all for shapes.
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf149551_btlr.odp"), 
ODP);
+
+// Test, that the shape has writing mode BT_LR.
+uno::Reference xShapeProps(getShapeFromPage(0, 0, 
xDocShRef));
+sal_Int16 eWritingMode;
+xShapeProps->getPropertyValue("WritingMode") >>= eWritingMode;
+

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

2022-09-14 Thread Xisco Fauli (via logerrit)
 sd/qa/uitest/impress_tests2/tdf148620.py |   89 -
 sd/qa/unit/uiimpress.cxx |  128 +--
 2 files changed, 106 insertions(+), 111 deletions(-)

New commits:
commit 3592c2e1af98b3fad00c43a4e886c29f3a4bb934
Author: Xisco Fauli 
AuthorDate: Wed Sep 14 13:59:02 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 14 17:08:19 2022 +0200

tdf#148620: sd: move UITest to CppUnittest

hopefully this will fix the sporadic failures of
UITest_impress_tests2 in Jenkins

Change-Id: I3df2484b07a0cf7a0efdafb7235c3ff83f187200
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139928
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/uitest/impress_tests2/tdf148620.py 
b/sd/qa/uitest/impress_tests2/tdf148620.py
deleted file mode 100644
index f52284fbaf2c..
--- a/sd/qa/uitest/impress_tests2/tdf148620.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# This file is part of the LibreOffice project.
-#
-# 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.uihelper.common import get_state_as_dict
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.framework import UITestCase
-
-class Tdf148620(UITestCase):
-
-def test_Tdf148620(self):
-with self.ui_test.create_doc_in_start_center("impress") as document:
-
-xTemplateDlg = self.xUITest.getTopFocusWindow()
-xCancelBtn = xTemplateDlg.getChild("close")
-self.ui_test.close_dialog_through_button(xCancelBtn)
-
-xDoc = self.xUITest.getTopFocusWindow()
-xEditWin = xDoc.getChild("impress_win")
-
-xEditWin.executeAction("SELECT", 
mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
-self.assertEqual("com.sun.star.drawing.SvxShapeCollection", 
document.CurrentSelection.getImplementationName())
-
-xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"one"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"two"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"three"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"four"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"five"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
-xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"six"}))
-
-self.assertEqual("One\nTwo\nThree\nFour\nFive\nsix", 
document.DrawPages[0].getByIndex(1).String)
-
-xToolkit = 
self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
-
-xArgs = mkPropertyValues({"KeyModifier": 0})
-self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
-xToolkit.processEventsToIdle()
-self.assertEqual("One\nTwo\nThree\nFour\nsix\nFive", 
document.DrawPages[0].getByIndex(1).String)
-
-self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
-xToolkit.processEventsToIdle()
-self.assertEqual("One\nTwo\nThree\nsix\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
-
-self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
-xToolkit.processEventsToIdle()
-self.assertEqual("One\nTwo\nsix\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
-
-self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
-xToolkit.processEventsToIdle()
-self.assertEqual("One\nsix\nTwo\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
-
-self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
-xToolkit.processEventsToIdle()
-self.assertEqual("six\nOne\nTwo\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
-
-self.xUITest.executeCommandWithParameters(".uno:OutlineDown", 
xArgs)
-xToolkit.processEventsToIdle()
-
-# Without the fix in place, this test would have failed with
-# AssertionError: 'One\nsix\nTwo\nThree\nFour\nFive' != 
'One\nTwo\nsix\nThree\nFour\nFive'
-self.assertEqual("One\nsix\nTwo\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
-
-self.xUITest.executeCommandWithParameters(".uno:OutlineDown", 
xArgs)
- 

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

2022-09-08 Thread Mike Kaganski (via logerrit)
 sd/qa/unit/export-tests-ooxml3.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit d6ddd7a6c242cbe13a87266fa2e34b42454d2ed9
Author: Mike Kaganski 
AuthorDate: Thu Sep 8 16:13:53 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Sep 8 17:12:02 2022 +0200

Fix CppunitTest_sd_export_tests-ooxml3 on non-default DPI

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

diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 6d3026326b17..d80518f2e844 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -2005,6 +2005,12 @@ void SdOOXMLExportTest3::testTdf147121()
 
 void SdOOXMLExportTest3::testTdf140912_PicturePlaceholder()
 {
+// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
+// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
+// -8490 in the test below turns into -8014 on my Windows box with 150% 
scaling.
+if (!IsDefaultDPI())
+return;
+
 ::sd::DrawDocShellRef xDocShRef = loadURL(
 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdfpictureplaceholder.pptx"),
 PPTX);
 


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

2022-09-08 Thread Mike Kaganski (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit d83b84e00b33a694a28a6a08ce39d9da03b45ab7
Author: Mike Kaganski 
AuthorDate: Thu Sep 8 16:22:30 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Sep 8 16:34:31 2022 +0200

Fix CppunitTest_sd_png_export_tests on non-default DPI

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index d38e8826a8c9..a03350d8c882 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -84,8 +84,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998)
 // make sure only the shape is exported
 Size aSize = aBMPEx.GetSizePixel();
 const auto[scalingX, scalingY] = getDPIScaling();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingX, aSize.getWidth(), 1.0);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingY, aSize.getHeight(), 1.0);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingX, aSize.getWidth(), 1.5);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingY, aSize.getHeight(), 1.5);
 if (!IsDefaultDPI())
 return;
 
@@ -149,8 +149,10 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
 // make sure only the shape is exported
 Size aSize = aBMPEx.GetSizePixel();
 const auto[scalingX, scalingY] = getDPIScaling();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(295 * scalingX, aSize.getWidth(), 1.0);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(134 * scalingY, aSize.getHeight(), 1.0);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(295 * scalingX, aSize.getWidth(), 1.5);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(134 * scalingY, aSize.getHeight(), 1.5);
+if (!IsDefaultDPI())
+return;
 
 // Check all borders are red or similar. Ignore the corners
 Bitmap aBMP = aBMPEx.GetBitmap();


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

2022-09-08 Thread Andrea Gelmini (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 686d9caaba6e1fe0bb1e1caedc6869fa9f2bddc7
Author: Andrea Gelmini 
AuthorDate: Thu Sep 8 12:33:19 2022 +0200
Commit: Julien Nabet 
CommitDate: Thu Sep 8 12:48:12 2022 +0200

Fix typo

Change-Id: I0dc42449baa4bed54aa1fdd60c1b62d4a9cb358e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139647
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 4d1091fbf536..d38e8826a8c9 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -160,7 +160,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
 {
 const Color aColorTop = pReadAccess->GetColor(0, nX);
 // tdf#150102 the exported graphic now has no longer an empty 
bottom
-// row, so test with '-1' in height , same as alrteady in test
+// row, so test with '-1' in height , same as already in test
 // testTdf105998 above
 const Color aColorBottom = pReadAccess->GetColor(aSize.Height() - 
1, nX);
 
@@ -176,7 +176,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
 {
 const Color aColorLeft = pReadAccess->GetColor(nY, 0);
 // tdf#150102 the exported graphic now has no longer an empty right
-// column, so test with '-1' in width , same as alrteady in test
+// column, so test with '-1' in width , same as already in test
 // testTdf105998 above
 const Color aColorRight = pReadAccess->GetColor(nY, aSize.Width() 
- 1);
 


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

2022-09-08 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/data/pptx/tdf150770.pptx |binary
 sd/qa/unit/import-tests2.cxx|   14 ++
 2 files changed, 14 insertions(+)

New commits:
commit db85b90b52e87a97f62c15900801e3297bde4de3
Author: Xisco Fauli 
AuthorDate: Thu Sep 8 10:27:55 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Sep 8 12:08:13 2022 +0200

tdf#150770: sd_import_tests2: Add unittest

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

diff --git a/sd/qa/unit/data/pptx/tdf150770.pptx 
b/sd/qa/unit/data/pptx/tdf150770.pptx
new file mode 100644
index ..72a2dc322e72
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf150770.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 4357719597d9..23e92530b479 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -121,6 +121,7 @@ public:
 void testTdf149206();
 void testTdf149785();
 void testTdf149985();
+void testTdf150770();
 void testTdf120028();
 void testDescriptionImport();
 void testTdf83247();
@@ -188,6 +189,7 @@ public:
 CPPUNIT_TEST(testTdf149206);
 CPPUNIT_TEST(testTdf149785);
 CPPUNIT_TEST(testTdf149985);
+CPPUNIT_TEST(testTdf150770);
 CPPUNIT_TEST(testTdf120028);
 CPPUNIT_TEST(testDescriptionImport);
 CPPUNIT_TEST(testTdf83247);
@@ -1601,6 +1603,18 @@ void SdImportTest2::testTdf149985()
 xDocShRef->DoClose();
 }
 
+void SdImportTest2::testTdf150770()
+{
+// Without the fix in place, this test would have failed to load the file
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf150770.pptx"), 
PPTX);
+uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xDoc->getDrawPages()->getCount());
+
+xDocShRef->DoClose();
+}
+
 void SdImportTest2::testTdf120028()
 {
 // Check that the text shape has 4 columns.


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

2022-09-08 Thread Armin Le Grand (allotropia) (via logerrit)
 sd/qa/unit/PNGExportTests.cxx |   10 --
 svx/source/unodraw/UnoGraphicExporter.cxx |   12 +---
 2 files changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 392b2cd4889cf944ed47b3473c6dd2cc1f89e7e7
Author: Armin Le Grand (allotropia) 
AuthorDate: Wed Sep 7 16:49:56 2022 +0200
Commit: Armin Le Grand 
CommitDate: Thu Sep 8 09:46:26 2022 +0200

tdf#150102 Correct PrefSize for UNO API Metafile exporter

Checked that in aBound is indeed the size - 1 (probably
due to old integer stuff using Size()/Rectangle() and
getWidth()/GetWidth() with the old one-less paradigm
somewhere), so just correct to the correct size. Be aware
that checking of tdf#126319 is needed, but looks good in
my tests. Still: Changing the central UNO API Metafile
export is always a risky thing, so it will have to show
if this will not influence something else.

Adapted a unit test to take into account that the exported
object as PNG no longer has an empty column at the right and
lo longer an empty row at the bottom. That test testTdf126319
uses now the same test-indexing as the test testTdf105998
already used. This shows a more correct PNG conversion, it
was curious anyways that two identical exports of objects
with a light-red border from dfferent apps had that
difference at all.

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

diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index 6af1b6ea0bb4..4d1091fbf536 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -159,7 +159,10 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
 for (tools::Long nX = 2; nX < aSize.Width() - 2; ++nX)
 {
 const Color aColorTop = pReadAccess->GetColor(0, nX);
-const Color aColorBottom = pReadAccess->GetColor(aSize.Height() - 
2, nX);
+// tdf#150102 the exported graphic now has no longer an empty 
bottom
+// row, so test with '-1' in height , same as alrteady in test
+// testTdf105998 above
+const Color aColorBottom = pReadAccess->GetColor(aSize.Height() - 
1, nX);
 
 assertColorsAreSimilar("Incorrect top border", COL_LIGHTRED, 
aColorTop, 5);
 
@@ -172,7 +175,10 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
 for (tools::Long nY = 2; nY < aSize.Height() - 2; ++nY)
 {
 const Color aColorLeft = pReadAccess->GetColor(nY, 0);
-const Color aColorRight = pReadAccess->GetColor(nY, aSize.Width() 
- 2);
+// tdf#150102 the exported graphic now has no longer an empty right
+// column, so test with '-1' in width , same as alrteady in test
+// testTdf105998 above
+const Color aColorRight = pReadAccess->GetColor(nY, aSize.Width() 
- 1);
 
 assertColorsAreSimilar("Incorrect left border", COL_LIGHTRED, 
aColorLeft, 5);
 assertColorsAreSimilar("Incorrect right border", COL_LIGHTRED, 
aColorRight, 5);
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx 
b/svx/source/unodraw/UnoGraphicExporter.cxx
index 55eabdcd85fc..b1ffa6449007 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -962,10 +962,16 @@ bool GraphicExporter::GetGraphic( ExportSettings const & 
rSettings, Graphic& aGr
 aMtf.WindStart();
 
 // tdf#126319 Immediately add needed size to target's PrefSize
+// tdf#150102 Checked that in aBound is indeed the size - 1 
(probably
+// due to old integer stuff using Size()/Rectangle() and 
getWidth()/GetWidth()
+// with the old one-less paradigm somewhere), so just correct to 
the
+// correct size. Be aware that checking of tdf#126319 is needed, 
but
+// looks good in my tests. Still: Changing the central UNO API 
Metafile
+// export is always a risky thing, so it will have to show if this 
will
+// not influence something else.
 const Size aBoundSize(
-basegfx::fround(aBound.getWidth() + 
aHalfPixelInMtf.getWidth()),
-basegfx::fround(aBound.getHeight() + 
aHalfPixelInMtf.getHeight()));
-
+basegfx::fround(aBound.getWidth() + 1),
+basegfx::fround(aBound.getHeight() + 1));
 aMtf.SetPrefMapMode( aMap );
 aMtf.SetPrefSize( aBoundSize );
 


[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, 

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

2022-08-31 Thread Sarper Akdemir (via logerrit)
 sd/qa/uitest/impress_tests2/tdf91762.py |4 +--
 svx/source/table/tablelayouter.cxx  |   40 +---
 2 files changed, 4 insertions(+), 40 deletions(-)

New commits:
commit 1a0ceb76e2fe12cdfff7cabf06ef43cfba296a34
Author: Sarper Akdemir 
AuthorDate: Mon Aug 22 08:49:57 2022 +0300
Commit: Miklos Vajna 
CommitDate: Wed Aug 31 13:34:24 2022 +0200

tdf#144092 tdf#139511: revert parts of tdf#91762 tdf#137949 tdf#139511

Reverts parts that have wrong assumptions wrt layouting a table in svx.

The problems reverted commits solved previously, were refixed by commits:
- tdf#144092 pptx import: correct table height during import
  (a5126a21351c87138ff86a6636326eb6cd6a0f8c)
- tdf#144092 pptx import: fix import of empty cell and shape text properties
  (57f9b4b7d1ad164c56af12009ef1dafbc1be8369)

So hopefully, reverting these now won't cause many regressions.

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

diff --git a/sd/qa/uitest/impress_tests2/tdf91762.py 
b/sd/qa/uitest/impress_tests2/tdf91762.py
index 56a1596b9e5b..2b3282413e15 100644
--- a/sd/qa/uitest/impress_tests2/tdf91762.py
+++ b/sd/qa/uitest/impress_tests2/tdf91762.py
@@ -39,8 +39,8 @@ class tdf91762(UITestCase):
 xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
 
 # tdf#138011: Without the fix in place, this test would have 
failed with
-# AssertionError: 5494 != 3559
-self.assertEqual(5494, 
document.DrawPages[0].getByIndex(1).BoundRect.Height)
+# AssertionError: 5504 != 3559
+self.assertEqual(5504, 
document.DrawPages[0].getByIndex(1).BoundRect.Height)
 
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/svx/source/table/tablelayouter.cxx 
b/svx/source/table/tablelayouter.cxx
index d3238042fbe0..72c692c96748 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -743,14 +743,9 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& 
rArea, bool bFit )
 sal_Int32 nCol, nRow;
 for( nRow = 0; nRow < nRowCount; ++nRow )
 {
-Reference< XPropertySet > xRowSet( xRows->getByIndex(nRow), 
UNO_QUERY_THROW );
-sal_Int32 nRowPropHeight = 0;
-xRowSet->getPropertyValue( gsSize ) >>= nRowPropHeight;
 sal_Int32 nMinHeight = 0;
 
 bool bIsEmpty = true; // check if all cells in this row are merged
-bool bRowHasText = false;
-bool bRowHasCellInEditMode = false;
 
 for( nCol = 0; nCol < nColCount; ++nCol )
 {
@@ -767,39 +762,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& 
rArea, bool bFit )
 }
 else
 {
-// WARNING: tdf#144092 / tdf#139511 suggest this entire 
section is invalid.
-// Empty cells should not be ignored in regards to row 
height,
-// especially MS formats, despite this code being added to 
import MS files...
-// The problem is getMinimumHeight can give wrong values 
for empty cells.
-
-bool bCellHasText = xCell->hasText();
-bool bCellInEditMode = xCell->IsTextEditActive();
-
-if (!bRowHasCellInEditMode && bCellInEditMode)
-bRowHasCellInEditMode = true;
-
-if ((bRowHasText == bCellHasText) || (bRowHasText && 
bCellInEditMode))
-{
-nMinHeight = std::max( nMinHeight, 
xCell->getMinimumHeight() );
-}
-else if ( !bRowHasText && bCellHasText )
-{
-bRowHasText = true;
-nMinHeight = xCell->getMinimumHeight();
-}
-
-// tdf#137949  We should consider "Height" property while 
calculating minimum height.
-// This control decides when we use "Height" property 
value instead of calculated minimum height
-// Case 1: * Row has "Height" property
-// * Calculated minimum height is smaller than 
Height property value.
-// Case 2: * Row has "Height" property
-// * Calculated minimum height is bigger than 
Height property value and
-// * Row has not any text of any cell in edit 
mode in the row (means completely empty)
-if ((nMinHeight < nRowPropHeight && nRowPropHeight > 0 && 
(bRowHasText || bRowHasCellInEditMode)) ||
-(nMinHeight > nRowPropHeight && nRowPropHeight > 0 && 
(!bRowHasText && !bRowHasCellInEditMode)))
-{
-nMinHeight = nRowPropHeight;
- 

[Libreoffice-commits] core.git: sd/qa svgio/qa vcl/qa writerperfect/CppunitTest_writerperfect_import.mk writerperfect/qa

2022-08-30 Thread cutamar (via logerrit)
 sd/qa/unit/export-tests-ooxml2.cxx|4 ++--
 sd/qa/unit/export-tests-ooxml3.cxx|8 
 svgio/qa/cppunit/SvgRead.cxx  |8 
 vcl/qa/cppunit/drawmode.cxx   |8 ++--
 vcl/qa/cppunit/outdev.cxx |4 +---
 writerperfect/CppunitTest_writerperfect_import.mk |1 +
 writerperfect/qa/unit/ImportTest.cxx  |4 ++--
 7 files changed, 16 insertions(+), 21 deletions(-)

New commits:
commit 45394fcf7e45f623add7ed3c6dc43e6d6f89158c
Author: cutamar 
AuthorDate: Sun Aug 28 02:42:21 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 30 22:33:06 2022 +0200

tdf#141908 Replace usage of sal_Int32 with Color in unit tests

Change-Id: Ifb5ff2e6d5ed28bcb9e190d7f2deaaa970693cbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138938
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 c74f5e41d925..6787133e3705 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1034,8 +1034,8 @@ void SdOOXMLExportTest2::testTdf105739()
 com::sun::star::awt::Gradient aFillGradient;
 aXBackgroundPropSet->getPropertyValue("FillGradient") >>= 
aFillGradient;
 CPPUNIT_ASSERT_EQUAL(int(awt::GradientStyle_LINEAR), 
static_cast(aFillGradient.Style));
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff), aFillGradient.StartColor);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00b050), aFillGradient.EndColor);
+CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, Color(ColorTransparency, 
aFillGradient.StartColor));
+CPPUNIT_ASSERT_EQUAL(Color(0x00b050), Color(ColorTransparency, 
aFillGradient.EndColor));
 }
 
 xShell->DoClose();
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 6100a9f64db6..d20c56d71766 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1531,8 +1531,8 @@ void SdOOXMLExportTest3::testTdf127372()
 uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
 awt::Gradient aTransparenceGradient;
 xShape->getPropertyValue("FillTransparenceGradient") >>= 
aTransparenceGradient;
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00), 
aTransparenceGradient.StartColor);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00), aTransparenceGradient.EndColor);
+CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, 
aTransparenceGradient.StartColor));
+CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, 
aTransparenceGradient.EndColor));
 }
 
 void SdOOXMLExportTest3::testTdf127379()
@@ -1558,8 +1558,8 @@ void SdOOXMLExportTest3::testTdf127379()
 
 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_ASSERT_EQUAL(COL_LIGHTRED, Color(ColorTransparency, 
aGradient.StartColor));
+CPPUNIT_ASSERT_EQUAL(Color(0x2A6099), Color(ColorTransparency, 
aGradient.EndColor));
 }
 
 void SdOOXMLExportTest3::testTdf98603()
diff --git a/svgio/qa/cppunit/SvgRead.cxx b/svgio/qa/cppunit/SvgRead.cxx
index 127de19a7bbd..a26556dd7a5c 100644
--- a/svgio/qa/cppunit/SvgRead.cxx
+++ b/svgio/qa/cppunit/SvgRead.cxx
@@ -81,9 +81,9 @@ void TestParsing::testSimpleRectangle()
 CPPUNIT_ASSERT_EQUAL(basegfx::B2DRange(10, 10, 110, 110), 
pDrawRect->maRectangle);
 CPPUNIT_ASSERT_EQUAL(3.0, pDrawRect->mnStrokeWidth);
 CPPUNIT_ASSERT(bool(pDrawRect->mpStrokeColor));
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff), 
sal_Int32(Color(*pDrawRect->mpStrokeColor)));
+CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, Color(*pDrawRect->mpStrokeColor));
 CPPUNIT_ASSERT(bool(pDrawRect->mpFillColor));
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00cc00), 
sal_Int32(Color(*pDrawRect->mpFillColor)));
+CPPUNIT_ASSERT_EQUAL(Color(0x00cc00), Color(*pDrawRect->mpFillColor));
 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.1, pDrawRect->mnOpacity, 1E-12);
 }
 
@@ -113,9 +113,9 @@ void TestParsing::testPath()
  
basegfx::utils::exportToSvgD(pDrawPath->maPolyPolygon, true, true, false));
 CPPUNIT_ASSERT_EQUAL(0.0, pDrawPath->mnStrokeWidth);
 CPPUNIT_ASSERT(bool(pDrawPath->mpStrokeColor));
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff), 
sal_Int32(Color(*pDrawPath->mpStrokeColor)));
+CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(*pDrawPath->mpStrokeColor));
 CPPUNIT_ASSERT(bool(pDrawPath->mpFillColor));
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0x007aff), 
sal_Int32(Color(*pDrawPath->mpFillColor)));
+CPPUNIT_ASSERT_EQUAL(Color(0x007aff), Color(*pDrawPath->mpFillColor));
 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.1, pDrawPath->mnOpacity, 1E-12);
 }
 
diff --git a/vcl/qa/cppunit/drawmode.cxx b/vcl/qa/cppunit/drawmode.cxx
index f2b59dc8440c..e3792ae1f29f 

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

2022-08-24 Thread Caolán McNamara (via logerrit)
 sd/qa/uitest/impress_tests2/tdf148620.py |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 51d2e734099e5c5c56393ef9f08007a7df441794
Author: Caolán McNamara 
AuthorDate: Wed Aug 24 08:48:52 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 24 10:52:18 2022 +0200

try and make test_Tdf148620 more reliable

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

diff --git a/sd/qa/uitest/impress_tests2/tdf148620.py 
b/sd/qa/uitest/impress_tests2/tdf148620.py
index a703d722d8dd..f52284fbaf2c 100644
--- a/sd/qa/uitest/impress_tests2/tdf148620.py
+++ b/sd/qa/uitest/impress_tests2/tdf148620.py
@@ -40,38 +40,50 @@ class Tdf148620(UITestCase):
 
 self.assertEqual("One\nTwo\nThree\nFour\nFive\nsix", 
document.DrawPages[0].getByIndex(1).String)
 
+xToolkit = 
self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+
 xArgs = mkPropertyValues({"KeyModifier": 0})
 self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nTwo\nThree\nFour\nsix\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nTwo\nThree\nsix\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nTwo\nsix\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nsix\nTwo\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineUp", xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("six\nOne\nTwo\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineDown", 
xArgs)
+xToolkit.processEventsToIdle()
 
 # Without the fix in place, this test would have failed with
 # AssertionError: 'One\nsix\nTwo\nThree\nFour\nFive' != 
'One\nTwo\nsix\nThree\nFour\nFive'
 self.assertEqual("One\nsix\nTwo\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineDown", 
xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nTwo\nsix\nThree\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineDown", 
xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nTwo\nThree\nsix\nFour\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineDown", 
xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nTwo\nThree\nFour\nsix\nFive", 
document.DrawPages[0].getByIndex(1).String)
 
 self.xUITest.executeCommandWithParameters(".uno:OutlineDown", 
xArgs)
+xToolkit.processEventsToIdle()
 self.assertEqual("One\nTwo\nThree\nFour\nFive\nsix", 
document.DrawPages[0].getByIndex(1).String)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-08-11 Thread Xisco Fauli (via logerrit)
 sd/qa/uitest/data/tdf119246.odp |binary
 sd/qa/uitest/impress_tests/tdf119246.py |   48 
 sd/qa/uitest/impress_tests/tdf134734.py |3 ++
 sd/qa/uitest/impress_tests/tdf137729.py |3 ++
 4 files changed, 54 insertions(+)

New commits:
commit 957bc2fe7093aa060f2e0abbc52cf107156e9a43
Author: Xisco Fauli 
AuthorDate: Tue Aug 9 17:16:10 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Aug 11 10:20:26 2022 +0200

tdf#119246: sd: Add UItest

Change-Id: I587c42e658d6f3dca2203d95cda2a972a4ddff91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138058
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/uitest/data/tdf119246.odp b/sd/qa/uitest/data/tdf119246.odp
new file mode 100644
index ..0d2ac4c56e78
Binary files /dev/null and b/sd/qa/uitest/data/tdf119246.odp differ
diff --git a/sd/qa/uitest/impress_tests/tdf119246.py 
b/sd/qa/uitest/impress_tests/tdf119246.py
new file mode 100644
index ..8ccd057d40c8
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/tdf119246.py
@@ -0,0 +1,48 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import change_measurement_unit
+from uitest.uihelper.common import get_url_for_data_file
+
+class tdf119246(UITestCase):
+
+def test_tdf119246(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf119246.odp")) as 
document:
+
+change_measurement_unit(self, "Centimeter")
+
+xImpressDoc = self.xUITest.getTopFocusWindow()
+
+self.assertIsNone(document.CurrentSelection)
+
+xEditWin = xImpressDoc.getChild("impress_win")
+xEditWin.executeAction("SELECT", 
mkPropertyValues({"OBJECT":"DimensionShape"}))
+self.assertEqual("com.sun.star.drawing.SvxShapeCollection", 
document.CurrentSelection.getImplementationName())
+
+with 
self.ui_test.execute_dialog_through_command(".uno:MeasureAttributes") as 
xDialog:
+xLineDist = xDialog.getChild('MTR_LINE_DIST')
+xGuideOvergang = xDialog.getChild('MTR_FLD_HELPLINE_OVERHANG')
+xGuideDist = xDialog.getChild('MTR_FLD_HELPLINE_DIST')
+xLeftDist = xDialog.getChild('MTR_FLD_HELPLINE1_LEN')
+xRightDist = xDialog.getChild('MTR_FLD_HELPLINE2_LEN')
+xDecimalPlace = xDialog.getChild('MTR_FLD_DECIMALPLACES')
+
+# Without the fix in place, this test would have failed with
+# AssertionError: '2.80 cm' != '1.00 cm'
+self.assertEqual("2.80 cm", 
get_state_as_dict(xLineDist)['Text'])
+self.assertEqual("0.20 cm", 
get_state_as_dict(xGuideOvergang)['Text'])
+self.assertEqual("0.50 cm", 
get_state_as_dict(xGuideDist)['Text'])
+self.assertEqual("4.00 cm", 
get_state_as_dict(xLeftDist)['Text'])
+self.assertEqual("-1.40 cm", 
get_state_as_dict(xRightDist)['Text'])
+self.assertEqual("2", get_state_as_dict(xDecimalPlace)['Text'])
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/qa/uitest/impress_tests/tdf134734.py 
b/sd/qa/uitest/impress_tests/tdf134734.py
index 404e75dd7707..57559c4ead52 100644
--- a/sd/qa/uitest/impress_tests/tdf134734.py
+++ b/sd/qa/uitest/impress_tests/tdf134734.py
@@ -10,6 +10,7 @@
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict, select_pos
+from uitest.uihelper.common import change_measurement_unit
 from com.sun.star.drawing.FillStyle import SOLID
 import importlib
 
@@ -20,6 +21,8 @@ class TestClass(UITestCase):
 close = TemplateDialog.getChild("close")
 self.ui_test.close_dialog_through_button(close)
 
+change_measurement_unit(self, "Inch")
+
 # set margins and fill color
 with self.ui_test.execute_dialog_through_command(".uno:PageSetup") 
as DrawPageDialog:
 xTabs = DrawPageDialog.getChild("tabcontrol")
diff --git a/sd/qa/uitest/impress_tests/tdf137729.py 
b/sd/qa/uitest/impress_tests/tdf137729.py
index e5b3d1fb610d..9180e460d0f8 100644
--- a/sd/qa/uitest/impress_tests/tdf137729.py
+++ b/sd/qa/uitest/impress_tests/tdf137729.py
@@ -11,6 +11,7 @@ from uitest.framework import UITestCase
 from uitest.uihelper.common import select_pos
 from com.sun.star.drawing.HatchStyle import SINGLE
 from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common 

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

2022-07-20 Thread Regina Henschel (via logerrit)
 sd/qa/unit/data/pptx/tdf149551_SmartArt_Gear.pptx|binary
 sd/qa/unit/data/pptx/tdf149551_SmartArt_Pie.pptx |binary
 sd/qa/unit/data/pptx/tdf149551_SmartArt_Pyramid.pptx |binary
 sd/qa/unit/data/pptx/tdf149551_SmartArt_Venn.pptx|binary
 sd/qa/unit/import-tests-smartart.cxx |  106 +++
 5 files changed, 106 insertions(+)

New commits:
commit 2f3b87d18a688b022a18a8b20b69b10cd6af7748
Author: Regina Henschel 
AuthorDate: Wed Jul 20 13:16:04 2022 +0200
Commit: Regina Henschel 
CommitDate: Wed Jul 20 20:48:22 2022 +0200

tdf#149551 Unit tests for insets in SmartArt

This is followup to commit 7e23cbdb. That commit contains for several
types of shapes a correction of the position and size of the text area
rectangle.
That commit fixes bugs tdf#59802, tdf#136234, tdf#118009 and duplicate
tdf#142841 were the here tested shape types are involved.

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

diff --git a/sd/qa/unit/data/pptx/tdf149551_SmartArt_Gear.pptx 
b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Gear.pptx
new file mode 100644
index ..2b4781972a04
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Gear.pptx 
differ
diff --git a/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pie.pptx 
b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pie.pptx
new file mode 100644
index ..d7fa44431597
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pie.pptx 
differ
diff --git a/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pyramid.pptx 
b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pyramid.pptx
new file mode 100644
index ..4e9157e82ac3
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pyramid.pptx differ
diff --git a/sd/qa/unit/data/pptx/tdf149551_SmartArt_Venn.pptx 
b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Venn.pptx
new file mode 100644
index ..12e033a8b903
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149551_SmartArt_Venn.pptx 
differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx 
b/sd/qa/unit/import-tests-smartart.cxx
index e41a635dff8b..8c28518c3b70 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -119,6 +120,10 @@ public:
 void testAutofitSync();
 void testSnakeRows();
 void testCompositeInferRight();
+void testTdf149551Pie();
+void testTdf149551Pyramid();
+void testTdf149551Venn();
+void testTdf149551Gear();
 
 CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
 
@@ -174,6 +179,10 @@ public:
 CPPUNIT_TEST(testAutofitSync);
 CPPUNIT_TEST(testSnakeRows);
 CPPUNIT_TEST(testCompositeInferRight);
+CPPUNIT_TEST(testTdf149551Pie);
+CPPUNIT_TEST(testTdf149551Pyramid);
+CPPUNIT_TEST(testTdf149551Venn);
+CPPUNIT_TEST(testTdf149551Gear);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1844,6 +1853,103 @@ void SdImportTestSmartArt::testCompositeInferRight()
 xDocShRef->DoClose();
 }
 
+void SdImportTestSmartArt::testTdf149551Pie()
+{
+// The file contains a diagram of type "Basic Pie".
+sd::DrawDocShellRef xDocShRef = loadURL(
+
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pie.pptx"),
 PPTX);
+uno::Reference xGroup(getShapeFromPage(0, 0, xDocShRef), 
uno::UNO_QUERY);
+// shape at index 0 is the background shape
+uno::Reference xShape = getChildShape(xGroup, 1);
+CPPUNIT_ASSERT(xShape.is());
+auto pCustomShape = 
dynamic_cast(SdrObject::getSdrObjectFromXShape(xShape));
+CPPUNIT_ASSERT(pCustomShape);
+tools::Rectangle aTextRect;
+pCustomShape->TakeTextAnchorRect(aTextRect);
+// without fix the text area rectangle had LT [7787,3420] and 
RB[16677,12312]. The values from
+// txXfrm were ignored.
+// The used tolerance is estimated.
+CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(12658), 
sal_Int32(aTextRect.Left()), 4);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(5073), sal_Int32(aTextRect.Top()), 
4);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(15627), 
sal_Int32(aTextRect.Right()), 4);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(7990), 
sal_Int32(aTextRect.Bottom()), 4);
+
+xDocShRef->DoClose();
+}
+
+void SdImportTestSmartArt::testTdf149551Pyramid()
+{
+// The file contains a diagram of type "Basic Pyramid".
+sd::DrawDocShellRef xDocShRef = loadURL(
+
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149551_SmartArt_Pyramid.pptx"),
+PPTX);
+uno::Reference xGroup(getShapeFromPage(0, 0, xDocShRef), 
uno::UNO_QUERY);
+// shape at index 0 is the background shape
+uno::Reference xShape = getChildShape(xGroup, 1);
+CPPUNIT_ASSERT(xShape.is());
+auto pCustomShape = 
dynamic_cast(SdrObject::getSdrObjectFromXShape(xShape));
+

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

2022-07-19 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/data/pptx/tdf149985.pptx |binary
 sd/qa/unit/import-tests2.cxx|   16 
 2 files changed, 16 insertions(+)

New commits:
commit 93b07a377b93875b28464546f1292e4aa5f9e17d
Author: Xisco Fauli 
AuthorDate: Tue Jul 19 17:17:52 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jul 19 19:48:37 2022 +0200

tdf#149985: sd_import_tests2: Add unittest

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

diff --git a/sd/qa/unit/data/pptx/tdf149985.pptx 
b/sd/qa/unit/data/pptx/tdf149985.pptx
new file mode 100644
index ..fedc3234a1e3
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149985.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index d7273967be67..a1750c34042b 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -120,6 +120,7 @@ public:
 void testPptCrop();
 void testTdf149206();
 void testTdf149785();
+void testTdf149985();
 void testTdf120028();
 void testDescriptionImport();
 void testTdf83247();
@@ -185,6 +186,7 @@ public:
 CPPUNIT_TEST(testPptCrop);
 CPPUNIT_TEST(testTdf149206);
 CPPUNIT_TEST(testTdf149785);
+CPPUNIT_TEST(testTdf149985);
 CPPUNIT_TEST(testTdf120028);
 CPPUNIT_TEST(testDescriptionImport);
 CPPUNIT_TEST(testTdf83247);
@@ -1583,6 +1585,20 @@ void SdImportTest2::testTdf149785()
 xDocShRef->DoClose();
 }
 
+void SdImportTest2::testTdf149985()
+{
+// Without the fix in place, this test would have failed to load the file
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149985.pptx"), 
PPTX);
+uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
+
+const SdrPage* pPage = GetPage(1, xDocShRef);
+CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount());
+
+xDocShRef->DoClose();
+}
+
 void SdImportTest2::testTdf120028()
 {
 // Check that the text shape has 4 columns.


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

2022-07-01 Thread Xisco Fauli (via logerrit)
 sd/qa/uitest/impress_tests/tdf149787.py |   40 
 1 file changed, 40 insertions(+)

New commits:
commit c62587987f2046b3b4b22af3d9897dd17077d5a8
Author: Xisco Fauli 
AuthorDate: Fri Jul 1 11:33:21 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jul 1 16:47:54 2022 +0200

tdf#149787: sd: Add unittest

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

diff --git a/sd/qa/uitest/impress_tests/tdf149787.py 
b/sd/qa/uitest/impress_tests/tdf149787.py
new file mode 100644
index ..3d65f1c0bb87
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/tdf149787.py
@@ -0,0 +1,40 @@
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.framework import UITestCase
+from uitest.uihelper.common import select_pos
+
+class TestTdf149787(UITestCase):
+
+def testTdf149787(self):
+with self.ui_test.create_doc_in_start_center("impress") as document:
+
+xTemplateDlg = self.xUITest.getTopFocusWindow()
+xCancelBtn = xTemplateDlg.getChild("close")
+self.ui_test.close_dialog_through_button(xCancelBtn)
+
+xImpressDoc = self.xUITest.getTopFocusWindow()
+
+self.assertIsNone(document.CurrentSelection)
+
+xEditWin = xImpressDoc.getChild("impress_win")
+xEditWin.executeAction("SELECT", 
mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
+self.assertEqual("com.sun.star.drawing.SvxShapeCollection", 
document.CurrentSelection.getImplementationName())
+
+with 
self.ui_test.execute_dialog_through_command(".uno:FormatArea", 
close_button="cancel") as xDialog:
+tabControl = xDialog.getChild("tabcontrol")
+select_pos(tabControl, "0")
+btnColor = xDialog.getChild("btncolor")
+btnColor.executeAction("CLICK", tuple())
+btnMoreColors = xDialog.getChild("btnMoreColors")
+
+with 
self.ui_test.execute_blocking_action(btnMoreColors.executeAction, 
args=('CLICK', ()), close_button="buttonClose") as dialog:
+xCloseBtn = dialog.getChild("buttonClose")
+self.ui_test.wait_until_property_is_updated(xCloseBtn, 
"Enabled", "true")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


  1   2   3   4   5   6   >