Kaydet (Commit) bbf40e3b authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Kohei Yoshida

Use the old-fashion way to instantiate a UNO service.

Change-Id: Ibc5c55dbe9c4c5101ebb292696f79e4e8c8a35c5
Reviewed-on: https://gerrit.libreoffice.org/33293Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst acbcec11
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <com/sun/star/packages/zip/ZipException.idl> #include <com/sun/star/packages/zip/ZipException.idl>
#include <com/sun/star/ucb/ContentCreationException.idl> #include <com/sun/star/ucb/ContentCreationException.idl>
#include <com/sun/star/ucb/InteractiveIOException.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 { module com { module sun { module star { module packages { module zip {
...@@ -38,12 +38,6 @@ service ZipFileAccess : XZipFileAccess2 ...@@ -38,12 +38,6 @@ service ZipFileAccess : XZipFileAccess2
com::sun::star::ucb::ContentCreationException, com::sun::star::ucb::ContentCreationException,
com::sun::star::ucb::InteractiveIOException, com::sun::star::ucb::InteractiveIOException,
com::sun::star::packages::zip::ZipException ); 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 );
}; };
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
#include <unotest/filters-test.hxx> #include <unotest/filters-test.hxx>
#include <unotest/bootstrapfixturebase.hxx> #include <unotest/bootstrapfixturebase.hxx>
#include <comphelper/threadpool.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> #include <iterator>
...@@ -96,14 +97,22 @@ namespace ...@@ -96,14 +97,22 @@ namespace
OUString aURL = m_directories.getURLFromSrc("/package/qa/cppunit/data/a2z.zip"); OUString aURL = m_directories.getURLFromSrc("/package/qa/cppunit/data/a2z.zip");
uno::Sequence<beans::NamedValue> aArgs(2); uno::Sequence<beans::NamedValue> aNVs(2);
aArgs[0].Name = "URL"; aNVs[0].Name = "URL";
aArgs[0].Value <<= aURL; aNVs[0].Value <<= aURL;
aArgs[1].Name = "UseBufferedStream"; aNVs[1].Name = "UseBufferedStream";
aArgs[1].Value <<= true; 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( 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()); CPPUNIT_ASSERT(xZip.is());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment