[Libreoffice-commits] core.git: offapi/com package/qa
Kohei Yoshida
kohei.yoshida at collabora.com
Thu Jan 19 01:45:32 UTC 2017
offapi/com/sun/star/packages/zip/ZipFileAccess.idl | 8 -------
package/qa/cppunit/test_package.cxx | 23 ++++++++++++++-------
2 files changed, 17 insertions(+), 14 deletions(-)
New commits:
commit bbf40e3b5d06bd1437b097ed2703179026d1e871
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Jan 18 20:05:40 2017 -0500
Use the old-fashion way to instantiate a UNO service.
Change-Id: Ibc5c55dbe9c4c5101ebb292696f79e4e8c8a35c5
Reviewed-on: https://gerrit.libreoffice.org/33293
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
diff --git a/offapi/com/sun/star/packages/zip/ZipFileAccess.idl b/offapi/com/sun/star/packages/zip/ZipFileAccess.idl
index 7677c94..6d54509 100644
--- a/offapi/com/sun/star/packages/zip/ZipFileAccess.idl
+++ b/offapi/com/sun/star/packages/zip/ZipFileAccess.idl
@@ -23,7 +23,7 @@
#include <com/sun/star/packages/zip/ZipException.idl>
#include <com/sun/star/ucb/ContentCreationException.idl>
#include <com/sun/star/ucb/InteractiveIOException.idl>
-#include <com/sun/star/beans/NamedValue.idl>
+
module com { module sun { module star { module packages { module zip {
@@ -38,12 +38,6 @@ service ZipFileAccess : XZipFileAccess2
com::sun::star::ucb::ContentCreationException,
com::sun::star::ucb::InteractiveIOException,
com::sun::star::packages::zip::ZipException );
-
- createWithArguments( [in] sequence<com::sun::star::beans::NamedValue> args )
- raises ( com::sun::star::io::IOException,
- com::sun::star::ucb::ContentCreationException,
- com::sun::star::ucb::InteractiveIOException,
- com::sun::star::packages::zip::ZipException );
};
diff --git a/package/qa/cppunit/test_package.cxx b/package/qa/cppunit/test_package.cxx
index 80f02d8e..335f490 100644
--- a/package/qa/cppunit/test_package.cxx
+++ b/package/qa/cppunit/test_package.cxx
@@ -11,7 +11,8 @@
#include <unotest/filters-test.hxx>
#include <unotest/bootstrapfixturebase.hxx>
#include <comphelper/threadpool.hxx>
-#include "com/sun/star/packages/zip/ZipFileAccess.hpp"
+#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <iterator>
@@ -96,14 +97,22 @@ namespace
OUString aURL = m_directories.getURLFromSrc("/package/qa/cppunit/data/a2z.zip");
- uno::Sequence<beans::NamedValue> aArgs(2);
- aArgs[0].Name = "URL";
- aArgs[0].Value <<= aURL;
- aArgs[1].Name = "UseBufferedStream";
- aArgs[1].Value <<= true;
+ uno::Sequence<beans::NamedValue> aNVs(2);
+ aNVs[0].Name = "URL";
+ aNVs[0].Value <<= aURL;
+ aNVs[1].Name = "UseBufferedStream";
+ aNVs[1].Value <<= true;
+
+ uno::Sequence<uno::Any> aArgs(1);
+ aArgs[0] <<= aNVs;
+
+ uno::Reference<uno::XComponentContext> xCxt = comphelper::getProcessComponentContext();
+ uno::Reference<lang::XMultiComponentFactory> xSvcMgr = xCxt->getServiceManager();
uno::Reference<packages::zip::XZipFileAccess2> xZip(
- packages::zip::ZipFileAccess::createWithArguments(comphelper::getProcessComponentContext(), aArgs));
+ xSvcMgr->createInstanceWithArgumentsAndContext(
+ "com.sun.star.packages.zip.ZipFileAccess", aArgs, xCxt),
+ uno::UNO_QUERY);
CPPUNIT_ASSERT(xZip.is());
More information about the Libreoffice-commits
mailing list