Kaydet (Commit) 28e3aff5 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Use service constructor for ZipFileAccess

Change-Id: I9c3f8e2df56953487329bdbbac251b3af8cd9917
üst 8d281104
......@@ -11,6 +11,7 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/style/TabStop.hpp>
#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
#include <com/sun/star/text/XTextTable.hpp>
......@@ -586,9 +587,7 @@ void Test::testCellBtlr()
save("Office Open XML Text", aTempFile);
// Read the XML stream we're interested in.
uno::Sequence<uno::Any> aArgs(1);
aArgs[0] <<= OUString(aTempFile.GetURL());
uno::Reference<container::XNameAccess> xNameAccess(m_xSFactory->createInstanceWithArguments("com.sun.star.packages.zip.ZipFileAccess", aArgs), uno::UNO_QUERY);
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), aTempFile.GetURL());
uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName("word/document.xml"), uno::UNO_QUERY);
boost::shared_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, sal_True));
pStream->Seek(STREAM_SEEK_TO_END);
......
......@@ -299,14 +299,8 @@ bool ImplImageTree::find(
}
if (!m_path.second.is()) {
css::uno::Sequence< css::uno::Any > args(1);
args[0] <<= m_path.first + ".zip";
try {
m_path.second.set(
comphelper::getProcessServiceFactory()->createInstanceWithArguments(
OUString( "com.sun.star.packages.zip.ZipFileAccess"),
args),
css::uno::UNO_QUERY_THROW);
m_path.second = css::packages::zip::ZipFileAccess::createWithURL(comphelper::getProcessComponentContext(), m_path.first + ".zip");
} catch (css::uno::RuntimeException &) {
throw;
} catch (const css::uno::Exception & e) {
......@@ -346,15 +340,9 @@ void ImplImageTree::loadImageLinks()
if ( !m_path.second.is() )
{
css::uno::Sequence< css::uno::Any > args(1);
args[0] <<= m_path.first + ".zip";
try
{
m_path.second.set(
comphelper::getProcessServiceFactory()->createInstanceWithArguments(
OUString( "com.sun.star.packages.zip.ZipFileAccess"),
args),
css::uno::UNO_QUERY_THROW);
m_path.second = css::packages::zip::ZipFileAccess::createWithURL(comphelper::getProcessComponentContext(), m_path.first + ".zip");
}
catch (css::uno::RuntimeException &)
{
......
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