summaryrefslogtreecommitdiff
path: root/svl/source/fsstor/fsstorage.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/fsstor/fsstorage.cxx')
-rw-r--r--svl/source/fsstor/fsstorage.cxx84
1 files changed, 42 insertions, 42 deletions
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 628bb7563759..d310916488c4 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -100,16 +100,16 @@ sal_Bool isLocalFile_Impl( ::rtl::OUString aURL )
struct FSStorage_Impl
{
::rtl::OUString m_aURL;
-
+
::ucbhelper::Content* m_pContent;
sal_Int32 m_nMode;
-
+
::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners
::cppu::OTypeCollection* m_pTypeCollection;
uno::Reference< lang::XMultiServiceFactory > m_xFactory;
-
+
FSStorage_Impl( const ::rtl::OUString& aURL, sal_Int32 nMode, uno::Reference< lang::XMultiServiceFactory > xFactory )
: m_aURL( aURL )
, m_pContent( NULL )
@@ -192,7 +192,7 @@ sal_Bool FSStorage::MakeFolderNoUI( const String& rFolder, sal_Bool )
uno::Reference< ucb::XCommandEnvironment >(),
aParent ) )
return ::utl::UCBContentHelper::MakeFolder( aParent, aTitle, aResultContent, sal_False );
-
+
return sal_False;
}
@@ -236,7 +236,7 @@ void FSStorage::CopyStreamToSubStream( const ::rtl::OUString& aSourceURL,
embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
if ( !xSubStream.is() )
throw uno::RuntimeException();
-
+
uno::Reference< io::XOutputStream > xDestOutput = xSubStream->getOutputStream();
if ( !xDestOutput.is() )
throw uno::RuntimeException();
@@ -271,7 +271,7 @@ void FSStorage::CopyContentToStorage_Impl( ::ucbhelper::Content* pContent, const
{
::rtl::OUString aSourceURL( xRow->getString( 1 ) );
sal_Bool bIsFolder( xRow->getBoolean(2) );
-
+
// TODO/LATER: not sure whether the entry name must be encoded
::rtl::OUString aNewEntryName( INetURLObject( aSourceURL ).getName( INetURLObject::LAST_SEGMENT,
true,
@@ -282,7 +282,7 @@ void FSStorage::CopyContentToStorage_Impl( ::ucbhelper::Content* pContent, const
embed::ElementModes::READWRITE );
if ( !xSubStorage.is() )
throw uno::RuntimeException();
-
+
uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
::ucbhelper::Content aSourceContent( aSourceURL, xDummyEnv );
CopyContentToStorage_Impl( &aSourceContent, xSubStorage );
@@ -308,7 +308,7 @@ void FSStorage::CopyContentToStorage_Impl( ::ucbhelper::Content* pContent, const
}
//____________________________________________________________________________________________________
-// XInterface
+// XInterface
//____________________________________________________________________________________________________
//-----------------------------------------------
@@ -317,14 +317,14 @@ uno::Any SAL_CALL FSStorage::queryInterface( const uno::Type& rType )
{
uno::Any aReturn;
aReturn <<= ::cppu::queryInterface
- ( rType
- , static_cast<lang::XTypeProvider*> ( this )
- , static_cast<embed::XStorage*> ( this )
- , static_cast<embed::XHierarchicalStorageAccess*> ( this )
- , static_cast<container::XNameAccess*> ( this )
- , static_cast<container::XElementAccess*> ( this )
- , static_cast<lang::XComponent*> ( this )
- , static_cast<beans::XPropertySet*> ( this ) );
+ ( rType
+ , static_cast<lang::XTypeProvider*> ( this )
+ , static_cast<embed::XStorage*> ( this )
+ , static_cast<embed::XHierarchicalStorageAccess*> ( this )
+ , static_cast<container::XNameAccess*> ( this )
+ , static_cast<container::XElementAccess*> ( this )
+ , static_cast<lang::XComponent*> ( this )
+ , static_cast<beans::XPropertySet*> ( this ) );
if ( aReturn.hasValue() == sal_True )
return aReturn ;
@@ -345,7 +345,7 @@ void SAL_CALL FSStorage::release() throw()
}
//____________________________________________________________________________________________________
-// XTypeProvider
+// XTypeProvider
//____________________________________________________________________________________________________
//-----------------------------------------------
@@ -359,10 +359,10 @@ uno::Sequence< uno::Type > SAL_CALL FSStorage::getTypes()
if ( m_pImpl->m_pTypeCollection == NULL )
{
m_pImpl->m_pTypeCollection = new ::cppu::OTypeCollection
- ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
- , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL )
- , ::getCppuType( ( const uno::Reference< embed::XHierarchicalStorageAccess >* )NULL )
- , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
+ ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
+ , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL )
+ , ::getCppuType( ( const uno::Reference< embed::XHierarchicalStorageAccess >* )NULL )
+ , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
}
}
@@ -391,7 +391,7 @@ uno::Sequence< sal_Int8 > SAL_CALL FSStorage::getImplementationId()
}
//____________________________________________________________________________________________________
-// XStorage
+// XStorage
//____________________________________________________________________________________________________
//-----------------------------------------------
@@ -484,7 +484,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement(
if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
{
uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess(
- m_pImpl->m_xFactory->createInstance(
+ m_pImpl->m_xFactory->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) ) ),
uno::UNO_QUERY_THROW );
xResult = xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) );
@@ -502,10 +502,10 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement(
delete pStream;
}
}
-
+
if ( !xResult.is() )
throw io::IOException();
-
+
if ( ( nOpenMode & embed::ElementModes::TRUNCATE ) )
{
uno::Reference< io::XTruncate > xTrunc( xResult->getOutputStream(), uno::UNO_QUERY_THROW );
@@ -517,7 +517,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement(
if ( ( nOpenMode & embed::ElementModes::TRUNCATE )
|| !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
throw io::IOException(); // TODO: access denied
-
+
::ucbhelper::Content aResultContent( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
uno::Reference< io::XInputStream > xInStream = aResultContent.openStream();
xResult = static_cast< io::XStream* >( new OFSInputStreamContainer( xInStream ) );
@@ -559,7 +559,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement(
}
//-----------------------------------------------
-uno::Reference< io::XStream > SAL_CALL FSStorage::openEncryptedStreamElement(
+uno::Reference< io::XStream > SAL_CALL FSStorage::openEncryptedStreamElement(
const ::rtl::OUString&, sal_Int32, const ::rtl::OUString& )
throw ( embed::InvalidStorageException,
lang::IllegalArgumentException,
@@ -629,8 +629,8 @@ uno::Reference< embed::XStorage > SAL_CALL FSStorage::openStorageElement(
throw io::IOException(); // there is no such folder
::ucbhelper::Content aResultContent( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
- xResult = uno::Reference< embed::XStorage >(
- static_cast< OWeakObject* >( new FSStorage( aResultContent,
+ xResult = uno::Reference< embed::XStorage >(
+ static_cast< OWeakObject* >( new FSStorage( aResultContent,
nStorageMode,
uno::Sequence< beans::PropertyValue >(),
m_pImpl->m_xFactory ) ),
@@ -939,7 +939,7 @@ void SAL_CALL FSStorage::renameElement( const ::rtl::OUString& aElementName, con
}
//-----------------------------------------------
-void SAL_CALL FSStorage::copyElementTo( const ::rtl::OUString& aElementName,
+void SAL_CALL FSStorage::copyElementTo( const ::rtl::OUString& aElementName,
const uno::Reference< embed::XStorage >& xDest,
const ::rtl::OUString& aNewName )
throw ( embed::InvalidStorageException,
@@ -976,7 +976,7 @@ void SAL_CALL FSStorage::copyElementTo( const ::rtl::OUString& aElementName,
uno::Reference< embed::XStorage > xDestSubStor(
xDest->openStorageElement( aNewName, embed::ElementModes::READWRITE ),
uno::UNO_QUERY_THROW );
-
+
CopyContentToStorage_Impl( &aSourceContent, xDestSubStor );
}
else if ( ::utl::UCBContentHelper::IsDocument( aOwnURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
@@ -1024,7 +1024,7 @@ void SAL_CALL FSStorage::copyElementTo( const ::rtl::OUString& aElementName,
}
//-----------------------------------------------
-void SAL_CALL FSStorage::moveElementTo( const ::rtl::OUString& aElementName,
+void SAL_CALL FSStorage::moveElementTo( const ::rtl::OUString& aElementName,
const uno::Reference< embed::XStorage >& xDest,
const ::rtl::OUString& aNewName )
throw ( embed::InvalidStorageException,
@@ -1045,7 +1045,7 @@ void SAL_CALL FSStorage::moveElementTo( const ::rtl::OUString& aElementName,
}
//____________________________________________________________________________________________________
-// XNameAccess
+// XNameAccess
//____________________________________________________________________________________________________
//-----------------------------------------------
@@ -1234,7 +1234,7 @@ sal_Bool SAL_CALL FSStorage::hasElements()
if ( !GetContent() )
throw io::IOException(); // TODO: error handling
-
+
uno::Sequence< ::rtl::OUString > aProps( 1 );
aProps[0] = ::rtl::OUString::createFromAscii( "TargetURL" );
::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
@@ -1252,7 +1252,7 @@ sal_Bool SAL_CALL FSStorage::hasElements()
//____________________________________________________________________________________________________
-// XDisposable
+// XDisposable
//____________________________________________________________________________________________________
//-----------------------------------------------
@@ -1305,7 +1305,7 @@ void SAL_CALL FSStorage::removeEventListener(
}
//____________________________________________________________________________________________________
-// XPropertySet
+// XPropertySet
//____________________________________________________________________________________________________
//-----------------------------------------------
@@ -1430,7 +1430,7 @@ void SAL_CALL FSStorage::removeVetoableChangeListener(
}
//____________________________________________________________________________________________________
-// XHierarchicalStorageAccess
+// XHierarchicalStorageAccess
//____________________________________________________________________________________________________
//-----------------------------------------------
uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode )
@@ -1476,7 +1476,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
{
uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess(
- m_pImpl->m_xFactory->createInstance(
+ m_pImpl->m_xFactory->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) ) ),
uno::UNO_QUERY_THROW );
uno::Reference< io::XStream > xStream =
@@ -1501,10 +1501,10 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
delete pStream;
}
}
-
+
if ( !xResult.is() )
throw io::IOException();
-
+
if ( ( nOpenMode & embed::ElementModes::TRUNCATE ) )
{
uno::Reference< io::XTruncate > xTrunc( xResult->getOutputStream(), uno::UNO_QUERY_THROW );
@@ -1516,7 +1516,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
if ( ( nOpenMode & embed::ElementModes::TRUNCATE )
|| !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
throw io::IOException(); // TODO: access denied
-
+
::ucbhelper::Content aResultContent( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
uno::Reference< io::XInputStream > xInStream = aResultContent.openStream();
xResult = static_cast< io::XStream* >( new OFSInputStreamContainer( xInStream ) );