summaryrefslogtreecommitdiff
path: root/comphelper/inc/comphelper
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-08-16 21:47:01 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-08-16 21:54:18 +0200
commite3648d4ebc7378cc31b6ce73716328f48b8903e5 (patch)
treec8cd2fc0fce09d92910728ed8f9949d4e54f975c /comphelper/inc/comphelper
parent72777a66bb8d9e71c4786c282c7971d7ededa729 (diff)
Revert "Cleanup comphelper::storagehelper"
This reverts commit 72777a66bb8d9e71c4786c282c7971d7ededa729. +using namespace com::sun::star::uno; in header is not a good idea Fails to compile and is hard to parse and figure out what was the point, so just reverting. Also +using rtl::OUString; is automatic nowadays whenever possible and RTL_CONSTASCII_USTRINGPARAM is obsoleted. Change-Id: I24cb24b7f1a6007734d26cbba41d46323cb55b18
Diffstat (limited to 'comphelper/inc/comphelper')
-rw-r--r--comphelper/inc/comphelper/storagehelper.hxx177
1 files changed, 91 insertions, 86 deletions
diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx
index 5e4916ef4e2b..f255dc842fb5 100644
--- a/comphelper/inc/comphelper/storagehelper.hxx
+++ b/comphelper/inc/comphelper/storagehelper.hxx
@@ -33,20 +33,14 @@
#include <com/sun/star/io/XStream.hpp>
#include "comphelper/comphelperdllapi.h"
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::embed;
-using namespace com::sun::star::io;
-using namespace com::sun::star::beans;
-using rtl::OUString;
-#define PACKAGE_STORAGE_FORMAT_STRING OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageFormat" ) )
-#define ZIP_STORAGE_FORMAT_STRING OUString( RTL_CONSTASCII_USTRINGPARAM( "ZipFormat" ) )
-#define OFOPXML_STORAGE_FORMAT_STRING OUString( RTL_CONSTASCII_USTRINGPARAM( "OFOPXMLFormat" ) )
+#define PACKAGE_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageFormat" ) )
+#define ZIP_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ZipFormat" ) )
+#define OFOPXML_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OFOPXMLFormat" ) )
-#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA256UTF8EncryptionKey" ) )
-#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1UTF8EncryptionKey" ) )
-#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1MS1252EncryptionKey" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA256UTF8EncryptionKey" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1UTF8EncryptionKey" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1MS1252EncryptionKey" ) )
namespace comphelper {
@@ -69,120 +63,131 @@ public:
class COMPHELPER_DLLPUBLIC OStorageHelper
{
public:
- static Reference< XSingleServiceFactory >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
GetStorageFactory(
- const Reference< XMultiServiceFactory >& xSF = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSF
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XSingleServiceFactory >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
GetFileSystemStorageFactory(
- const Reference< XMultiServiceFactory >& xSF = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSF
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XStorage >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetTemporaryStorage(
- const Reference< XMultiServiceFactory >& xFactory = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+ throw ( ::com::sun::star::uno::Exception );
- // this one will only return Storage
- static Reference< XStorage >
+ /// this one will only return Storage
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetStorageFromURL(
- const OUString& aURL, sal_Int32 nStorageMode,
- const Reference< XMultiServiceFactory >& xFactory = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::rtl::OUString& aURL,
+ sal_Int32 nStorageMode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+ throw ( ::com::sun::star::uno::Exception );
- // this one will return either Storage or FileSystemStorage
- static Reference< XStorage >
+ /// this one will return either Storage or FileSystemStorage
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetStorageFromURL2(
- const OUString& aURL, sal_Int32 nStorageMode,
- const Reference< XMultiServiceFactory >& xFactory = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::rtl::OUString& aURL,
+ sal_Int32 nStorageMode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XStorage >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetStorageFromInputStream(
- const Reference < XInputStream >& xStream,
- const Reference< XMultiServiceFactory >& xFactory = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >& xStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XStorage >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetStorageFromStream(
- const Reference < XStream >& xStream,
- sal_Int32 nStorageMode = ElementModes::READWRITE,
- const Reference< XMultiServiceFactory >& xFactory = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream >& xStream,
+ sal_Int32 nStorageMode = ::com::sun::star::embed::ElementModes::READWRITE,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+ throw ( ::com::sun::star::uno::Exception );
static void CopyInputToOutput(
- const Reference< XInputStream >& xInput,
- const Reference< XOutputStream >& xOutput )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutput )
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XInputStream >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
GetInputStreamFromURL(
- const OUString& aURL,
- const Reference< XMultiServiceFactory >& xFactory = Reference< XMultiServiceFactory >() )
- throw ( Exception );
+ const ::rtl::OUString& aURL,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
+ throw ( ::com::sun::star::uno::Exception );
static void SetCommonStorageEncryptionData(
- const Reference< XStorage >& xStorage,
- const Sequence< NamedValue >& aEncryptionData )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
+ throw ( ::com::sun::star::uno::Exception );
// the following method supports only storages of OOo formats
static sal_Int32 GetXStorageFormat(
- const Reference< XStorage >& xStorage )
- throw ( Exception );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage )
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XStorage >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetStorageOfFormatFromURL(
- const OUString& aFormat,
- const OUString& aURL,
+ const ::rtl::OUString& aFormat,
+ const ::rtl::OUString& aURL,
sal_Int32 nStorageMode,
- const Reference< XMultiServiceFactory >& xFactory
- = Reference< XMultiServiceFactory >(),
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >(),
sal_Bool bRepairStorage = sal_False )
- throw ( Exception );
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XStorage >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetStorageOfFormatFromInputStream(
- const OUString& aFormat,
- const Reference < XInputStream >& xStream,
- const Reference< XMultiServiceFactory >& xFactory
- = Reference< XMultiServiceFactory >(),
+ const ::rtl::OUString& aFormat,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >& xStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >(),
sal_Bool bRepairStorage = sal_False )
- throw ( Exception );
+ throw ( ::com::sun::star::uno::Exception );
- static Reference< XStorage >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetStorageOfFormatFromStream(
- const OUString& aFormat,
- const Reference < XStream >& xStream,
- sal_Int32 nStorageMode = ElementModes::READWRITE,
- const Reference< XMultiServiceFactory >& xFactory = Reference< XMultiServiceFactory >(),
+ const ::rtl::OUString& aFormat,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream >& xStream,
+ sal_Int32 nStorageMode = ::com::sun::star::embed::ElementModes::READWRITE,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >(),
sal_Bool bRepairStorage = sal_False )
- throw ( Exception );
+ throw ( ::com::sun::star::uno::Exception );
- static Sequence< NamedValue >
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
CreatePackageEncryptionData(
- const OUString& aPassword,
- const Reference< XMultiServiceFactory >& xSF = Reference< XMultiServiceFactory >() );
+ const ::rtl::OUString& aPassword,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSF
+ = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() );
- static sal_Bool IsValidZipEntryFileName( const OUString& aName, sal_Bool bSlashAllowed );
+ static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed );
static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed );
- static sal_Bool PathHasSegment( const OUString& aPath, const OUString& aSegment );
+ static sal_Bool PathHasSegment( const ::rtl::OUString& aPath, const ::rtl::OUString& aSegment );
// Methods to allow easy use of hierachical names inside storages
- static Reference< XStorage > GetStorageAtPath(
- const Reference< XStorage > &xStorage,
- const OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness );
-
- static Reference< XStream > GetStreamAtPath(
- const Reference< XStorage > &xStorage,
- const OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness );
-
- static Reference< XStream > GetStreamAtPackageURL(
- const Reference< XStorage > &xStorage,
- const OUString& rURL, sal_uInt32 const nOpenMode,
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorageAtPath(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage,
+ const ::rtl::OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStreamAtPath(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage,
+ const ::rtl::OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStreamAtPackageURL(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage,
+ const ::rtl::OUString& rURL, sal_uInt32 const nOpenMode,
LifecycleProxy & rNastiness );
};