diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-07 08:07:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-08 08:06:45 +0200 |
commit | ae0cb395d8e2b887054e5cfd4fc5525a94fab240 (patch) | |
tree | 447facca919631537422f8fae621a9efec1beb07 | |
parent | 782bbfc65666272497f9c36a9c59d8b32231aa06 (diff) |
fdo#46808, Convert ZipFileAccess service to new style
Dropped XComponent from merged interface because noone is using it.
Change-Id: Id22c49e63679f42d86f617a919fdfd7cea4d5381
-rw-r--r-- | offapi/UnoApi_offapi.mk | 7 | ||||
-rw-r--r-- | offapi/com/sun/star/packages/zip/XZipFileAccess.idl | 4 | ||||
-rw-r--r-- | offapi/com/sun/star/packages/zip/XZipFileAccess2.idl | 45 | ||||
-rw-r--r-- | offapi/com/sun/star/packages/zip/ZipFileAccess.idl | 14 | ||||
-rw-r--r-- | package/inc/zipfileaccess.hxx | 9 | ||||
-rw-r--r-- | vcl/source/gdi/impimagetree.cxx | 9 |
6 files changed, 63 insertions, 25 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index de96093ab3ce..8022e5ebf522 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -243,6 +243,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/m ManifestReader \ ManifestWriter \ )) +$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/zip,\ + ZipFileAccess \ +)) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/plugin,\ PluginManager \ )) @@ -969,9 +972,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/package PackageFolderEnumeration \ PackageStream \ )) -$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/packages/zip,\ - ZipFileAccess \ -)) $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/presentation,\ ChartShape \ CustomPresentation \ @@ -2879,6 +2879,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/packages/manifes )) $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/packages/zip,\ XZipFileAccess \ + XZipFileAccess2 \ ZipConstants \ ZipEntry \ ZipException \ diff --git a/offapi/com/sun/star/packages/zip/XZipFileAccess.idl b/offapi/com/sun/star/packages/zip/XZipFileAccess.idl index b80417cd393e..24cc3132d114 100644 --- a/offapi/com/sun/star/packages/zip/XZipFileAccess.idl +++ b/offapi/com/sun/star/packages/zip/XZipFileAccess.idl @@ -19,10 +19,10 @@ #ifndef __com_sun_star_packages_zip_XZipFileAccess_idl__ #define __com_sun_star_packages_zip_XZipFileAccess_idl__ -#include <com/sun/star/uno/XInterface.idl> -#include <com/sun/star/packages/zip/ZipEntry.idl> #include <com/sun/star/container/NoSuchElementException.idl> +#include <com/sun/star/io/XInputStream.idl> #include <com/sun/star/io/IOException.idl> +#include <com/sun/star/uno/XInterface.idl> diff --git a/offapi/com/sun/star/packages/zip/XZipFileAccess2.idl b/offapi/com/sun/star/packages/zip/XZipFileAccess2.idl new file mode 100644 index 000000000000..796ecf4cedcf --- /dev/null +++ b/offapi/com/sun/star/packages/zip/XZipFileAccess2.idl @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_packages_zip_XZipFileAccess2_idl__ +#define __com_sun_star_packages_zip_XZipFileAccess2_idl__ + +#include <com/sun/star/packages/zip/XZipFileAccess.idl> +#include <com/sun/star/container/XNameAccess.idl> + + +module com { module sun { module star { module packages { module zip { + + +/** + Merged interface for ZipFileAccess service. + @since LibreOffice 4.1 + */ +interface XZipFileAccess2 +{ + interface XZipFileAccess; + interface com::sun::star::container::XNameAccess; + +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/packages/zip/ZipFileAccess.idl b/offapi/com/sun/star/packages/zip/ZipFileAccess.idl index e0ac0ed3f2c6..a53362bc6e1f 100644 --- a/offapi/com/sun/star/packages/zip/ZipFileAccess.idl +++ b/offapi/com/sun/star/packages/zip/ZipFileAccess.idl @@ -19,11 +19,8 @@ #ifndef __com_sun_star_packages_zip_ZipFileAccess_idl__ #define __com_sun_star_packages_zip_ZipFileAccess_idl__ -#include <com/sun/star/packages/zip/XZipFileAccess.idl> -#include <com/sun/star/lang/XInitialization.idl> -#include <com/sun/star/lang/XComponent.idl> -#include <com/sun/star/container/XNameAccess.idl> -#include <com/sun/star/io/IOException.idl> +#include <com/sun/star/packages/zip/XZipFileAccess2.idl> +#include <com/sun/star/ucb/InteractiveIOException.idl> @@ -32,12 +29,9 @@ module com { module sun { module star { module packages { module zip { /** allows to get reading access to non-encrypted entries inside zip file. */ -service ZipFileAccess +service ZipFileAccess : XZipFileAccess2 { - interface XZipFileAccess; - interface ::com::sun::star::container::XNameAccess; - interface ::com::sun::star::lang::XInitialization; - interface ::com::sun::star::lang::XComponent; + createWithURL([in] string URL) raises ( com::sun::star::io::IOException, com::sun::star::ucb::InteractiveIOException ); }; diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx index 8b1fc0d962f7..e84d7aca86ed 100644 --- a/package/inc/zipfileaccess.hxx +++ b/package/inc/zipfileaccess.hxx @@ -20,7 +20,7 @@ #ifndef _ZIPFILEACCESS_HXX_ #define _ZIPFILEACCESS_HXX_ -#include <com/sun/star/packages/zip/XZipFileAccess.hpp> +#include <com/sun/star/packages/zip/XZipFileAccess2.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -28,16 +28,15 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <cppuhelper/interfacecontainer.h> -#include <cppuhelper/implbase5.hxx> +#include <cppuhelper/implbase4.hxx> #include <mutexholder.hxx> #include <ZipFile.hxx> #include <HashMaps.hxx> -class OZipFileAccess : public ::cppu::WeakImplHelper5< - ::com::sun::star::packages::zip::XZipFileAccess, - ::com::sun::star::container::XNameAccess, +class OZipFileAccess : public ::cppu::WeakImplHelper4< + ::com::sun::star::packages::zip::XZipFileAccess2, ::com::sun::star::lang::XInitialization, ::com::sun::star::lang::XComponent, ::com::sun::star::lang::XServiceInfo > diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx index 7a2fbdddb5db..a2cab8b4ad9b 100644 --- a/vcl/source/gdi/impimagetree.cxx +++ b/vcl/source/gdi/impimagetree.cxx @@ -31,6 +31,7 @@ #include "com/sun/star/io/XInputStream.hpp" #include "com/sun/star/lang/Locale.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/packages/zip/ZipFileAccess.hpp" #include "com/sun/star/uno/Any.hxx" #include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Reference.hxx" @@ -344,13 +345,11 @@ bool ImplImageTree::find( for (Paths::iterator i(m_paths.begin()); i != m_paths.end();) { if (!i->second.is()) { - css::uno::Sequence< css::uno::Any > args(1); - args[0] <<= i->first + ".zip"; try { i->second.set( - comphelper::getProcessServiceFactory()->createInstanceWithArguments( - OUString( "com.sun.star.packages.zip.ZipFileAccess"), - args), + css::packages::zip::ZipFileAccess::createWithURL( + comphelper::getProcessComponentContext(), + i->first + ".zip"), css::uno::UNO_QUERY_THROW); } catch (css::uno::RuntimeException &) { throw; |