summaryrefslogtreecommitdiff
path: root/sd/qa/unit/import-tests.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-29 10:02:01 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-30 23:13:41 +0200
commit94f34c57be79187c7108eea845e1303ddc6319e5 (patch)
treeddf02496de0ce17308246d0a54c8678fa5e76e9e /sd/qa/unit/import-tests.cxx
parent2afbef0037f022a59ed1198f1f84e454d070df92 (diff)
Prepare for removal of non-const operator[] from Sequence in sd
Change-Id: I82dc012188f846161beeb54901c2f5d298e5c3b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124385 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd/qa/unit/import-tests.cxx')
-rw-r--r--sd/qa/unit/import-tests.cxx64
1 files changed, 28 insertions, 36 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 561f5b71abc5..e1b71fd788cf 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -91,6 +91,7 @@
#include <stlpool.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/graphicmimetype.hxx>
#include <comphelper/lok.hxx>
@@ -1741,22 +1742,19 @@ void SdImportTest::testTdf113163()
uno::Reference < uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
uno::Reference< drawing::XGraphicExportFilter > xGraphicExporter = drawing::GraphicExportFilter::create(xContext);
- uno::Sequence< beans::PropertyValue > aFilterData(2);
- aFilterData[0].Name = "PixelWidth";
- aFilterData[0].Value <<= sal_Int32(100);
- aFilterData[1].Name = "PixelHeight";
- aFilterData[1].Value <<= sal_Int32(100);
+ uno::Sequence< beans::PropertyValue > aFilterData{
+ comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
+ comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
+ };
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
- uno::Sequence< beans::PropertyValue > aDescriptor(3);
- aDescriptor[0].Name = "URL";
- aDescriptor[0].Value <<= aTempFile.GetURL();
- aDescriptor[1].Name = "FilterName";
- aDescriptor[1].Value <<= OUString("PNG");
- aDescriptor[2].Name = "FilterData";
- aDescriptor[2].Value <<= aFilterData;
+ uno::Sequence< beans::PropertyValue > aDescriptor{
+ comphelper::makePropertyValue("URL", aTempFile.GetURL()),
+ comphelper::makePropertyValue("FilterName", OUString("PNG")),
+ comphelper::makePropertyValue("FilterData", aFilterData)
+ };
uno::Reference< lang::XComponent > xPage(getPage(0, xDocShRef), uno::UNO_QUERY);
xGraphicExporter->setSourceDocument(xPage);
@@ -1794,22 +1792,19 @@ void SdImportTest::testTdf93124()
uno::Reference < uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
uno::Reference< drawing::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);
+ uno::Sequence< beans::PropertyValue > aFilterData{
+ comphelper::makePropertyValue("PixelWidth", sal_Int32(320)),
+ comphelper::makePropertyValue("PixelHeight", 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::Sequence< beans::PropertyValue > aDescriptor{
+ comphelper::makePropertyValue("URL", aTempFile.GetURL()),
+ comphelper::makePropertyValue("FilterName", OUString("PNG")),
+ comphelper::makePropertyValue("FilterData", aFilterData)
+ };
uno::Reference< lang::XComponent > xPage(getPage(0, xDocShRef), uno::UNO_QUERY);
xGraphicExporter->setSourceDocument(xPage);
@@ -1856,22 +1851,19 @@ void SdImportTest::testTdf99729()
uno::Reference< drawing::XGraphicExportFilter > xGraphicExporter = drawing::GraphicExportFilter::create(xContext);
CPPUNIT_ASSERT(xGraphicExporter.is());
- 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(240);
+ uno::Sequence< beans::PropertyValue > aFilterData{
+ comphelper::makePropertyValue("PixelWidth", sal_Int32(320)),
+ comphelper::makePropertyValue("PixelHeight", sal_Int32(240))
+ };
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
- uno::Sequence< beans::PropertyValue > aDescriptor(3);
- aDescriptor[0].Name = "URL";
- aDescriptor[0].Value <<= aTempFile.GetURL();
- aDescriptor[1].Name = "FilterName";
- aDescriptor[1].Value <<= OUString("PNG");
- aDescriptor[2].Name = "FilterData";
- aDescriptor[2].Value <<= aFilterData;
+ uno::Sequence< beans::PropertyValue > aDescriptor{
+ comphelper::makePropertyValue("URL", aTempFile.GetURL()),
+ comphelper::makePropertyValue("FilterName", OUString("PNG")),
+ comphelper::makePropertyValue("FilterData", aFilterData)
+ };
uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(xComponent, uno::UNO_QUERY);
uno::Reference<lang::XComponent> xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),