summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-31 13:22:53 +0200
committerNoel Grandin <noel@peralex.com>2013-06-03 10:00:02 +0200
commit28e3aff576f06b0b02c7232da5d723e865b3c7ed (patch)
tree681ef3e9564f59aeeed9c20379cf51bfa66b578c
parent8d28110439a9d069a7d1041423deef3de4472dc6 (diff)
fdo#46808, Use service constructor for ZipFileAccess
Change-Id: I9c3f8e2df56953487329bdbbac251b3af8cd9917
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx5
-rw-r--r--vcl/source/gdi/impimagetree.cxx16
2 files changed, 4 insertions, 17 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 278d71c33f88..ca6fad612ffa 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -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);
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 857a080f4756..6f7c566f8d8d 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -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 &)
{