summaryrefslogtreecommitdiff
path: root/sd/qa/unit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-09-23 15:05:08 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-09-23 17:37:45 +0200
commit2db32eb614c9138e64779d5e5fc58e8cd6a9cf00 (patch)
tree4967dc00810d99a6b42f6b2f5eeba24f76f0e442 /sd/qa/unit
parente9a16702ba025ca340bcded4fda37235d22410a1 (diff)
Revert "tdf#104722: sd_import_tests: Add unittest"
This reverts commit 0e66570eeb97d2c6779383d5b2f027e99f661c1d. Reason for revert: Sometimes it fails. working on another solution based on XML parsing Change-Id: Ibb137a381f1598b743b1fb2fc7a5495e58c4e8f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103195 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'sd/qa/unit')
-rw-r--r--sd/qa/unit/data/pptx/tdf104722.pptxbin40497 -> 0 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx70
2 files changed, 0 insertions, 70 deletions
diff --git a/sd/qa/unit/data/pptx/tdf104722.pptx b/sd/qa/unit/data/pptx/tdf104722.pptx
deleted file mode 100644
index 27ea41958029..000000000000
--- a/sd/qa/unit/data/pptx/tdf104722.pptx
+++ /dev/null
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 91d796bc40a8..dfba89895168 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -173,7 +173,6 @@ public:
void testTdf93097();
void testTdf62255();
void testTdf93124();
- void testTdf104722();
void testTdf99729();
void testTdf89927();
void testTdf93868();
@@ -285,7 +284,6 @@ public:
CPPUNIT_TEST(testTdf93097);
CPPUNIT_TEST(testTdf62255);
CPPUNIT_TEST(testTdf93124);
- CPPUNIT_TEST(testTdf104722);
CPPUNIT_TEST(testTdf99729);
CPPUNIT_TEST(testTdf89927);
CPPUNIT_TEST(testTdf93868);
@@ -1615,74 +1613,6 @@ void SdImportTest::testTdf93124()
xDocShRef->DoClose();
}
-void SdImportTest::testTdf104722()
-{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf104722.pptx"), PPTX);
- uno::Reference < uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- uno::Reference< drawing::XGraphicExportFilter > xGraphicExporter = drawing::GraphicExportFilter::create(xContext);
-
- uno::Sequence< beans::PropertyValue > aFilterData(2);
- aFilterData[0].Name = "PixelWidth";
- aFilterData[0].Value <<= sal_Int32(320);
- aFilterData[1].Name = "PixelHeight";
- aFilterData[1].Value <<= sal_Int32(180);
-
- utl::TempFile aTempFile;
- aTempFile.EnableKillingFile();
-
- uno::Sequence< beans::PropertyValue > aDescriptor(3);
- aDescriptor[0].Name = "URL";
- aDescriptor[0].Value <<= aTempFile.GetURL();
- aDescriptor[1].Name = "FilterName";
- aDescriptor[1].Value <<= OUString("PNG");
- aDescriptor[2].Name = "FilterData";
- aDescriptor[2].Value <<= aFilterData;
-
- uno::Reference< lang::XComponent > xPage(getPage(0, xDocShRef), uno::UNO_QUERY);
- xGraphicExporter->setSourceDocument(xPage);
- xGraphicExporter->filter(aDescriptor);
-
- SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ);
- vcl::PNGReader aPNGReader(aFileStream);
- BitmapEx aBMPEx = aPNGReader.Read();
-
- // make sure the bitmap is not empty and correct size (PNG export->import was successful)
- CPPUNIT_ASSERT_EQUAL(Size(320, 180), aBMPEx.GetSizePixel());
- Bitmap aBMP = aBMPEx.GetBitmap();
- Bitmap::ScopedReadAccess pReadAccess(aBMP);
-
- {
- int nNonWhiteCount = 0;
- // Check the left part of the document has text. 0,45 to 80,90
- for (long nY = 45; nY < 90; ++nY)
- {
- for (long nX = 0; nX < 80; ++nX)
- {
- const Color aColor = pReadAccess->GetColor(nY, nX);
- if ((aColor.GetRed() != 0xff) || (aColor.GetGreen() != 0xff) || (aColor.GetBlue() != 0xff))
- ++nNonWhiteCount;
- }
- }
- CPPUNIT_ASSERT_MESSAGE("Tdf104722: horizontal alignment of text is incorrect!", nNonWhiteCount > 300);
- }
- {
- int nNonWhiteCount = 0;
- // Check the right part of the document has text. 240,45 to 320,90
- for (long nY = 45; nY < 90; ++nY)
- {
- for (long nX = 240; nX < 320; ++nX)
- {
- const Color aColor = pReadAccess->GetColor(nY, nX);
- if ((aColor.GetRed() != 0xff) || (aColor.GetGreen() != 0xff) || (aColor.GetBlue() != 0xff))
- ++nNonWhiteCount;
- }
- }
- // Without the fix in place, this test would have failed here as the text would have been shifted to the left
- CPPUNIT_ASSERT_MESSAGE("Tdf104722: horizontal alignment of text is incorrect!", nNonWhiteCount > 300);
- }
- xDocShRef->DoClose();
-}
-
void SdImportTest::testTdf99729()
{
const OUString filenames[] = { "/sd/qa/unit/data/odp/tdf99729-new.odp", "/sd/qa/unit/data/odp/tdf99729-legacy.odp" };