summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2000-11-30 11:22:03 +0000
committerMathias Bauer <mba@openoffice.org>2000-11-30 11:22:03 +0000
commit8acc67a72d6b80dc764617973fd246e34e1e6a44 (patch)
treed55c4d547d12f8937c7db07a397701bef37b5abc /sot
parent47bec81896b3458e15eba538e4c2bb89319bcd50 (diff)
#80466#: bug in ctor/Init of UCBStorage_Impl
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/ucbstorage.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 8d0876b2e1bf..c5b360419c55 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -120,7 +120,7 @@ public:
UCBStorage_Impl( const String&, StreamMode, UCBStorage*, BOOL );
UCBStorage_Impl( SvStream&, UCBStorage*, BOOL );
- void Init( const String&, StreamMode, UCBStorage* );
+ void Init();
BOOL Commit();
BOOL Revert();
};
@@ -494,6 +494,7 @@ UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect )
// to class UCBStorage !
pImp = new UCBStorage_Impl( rStrm, this, bDirect );
pImp->AddRef();
+ pImp->Init();
StorageBase::nMode = pImp->m_nMode;
}
@@ -503,6 +504,7 @@ UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect )
// to class UCBStorage !
pImp = new UCBStorage_Impl( rName, nMode, this, bDirect );
pImp->AddRef();
+ pImp->Init();
StorageBase::nMode = pImp->m_nMode;
}
@@ -529,6 +531,7 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor
, m_pContent( NULL )
, m_pSource( NULL )
, m_pStream( NULL )
+ , m_nMode( nMode )
, m_bIsRoot( TRUE )
, m_bDirect( bDirect )
{
@@ -544,7 +547,6 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor
String aTemp = String::CreateFromAscii("vnd.sun.star.pkg://");
aTemp += INetURLObject::encode( aName, INetURLObject::PART_AUTHORITY, '%', INetURLObject::ENCODE_ALL );
m_aURL = aTemp;
- Init( m_aURL, nMode, pStorage );
}
UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, BOOL bDirect )
@@ -568,23 +570,20 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, BOOL
rStream >> *m_pStream;
// check opening mode
- StreamMode nMode = STREAM_READ;
+ m_nMode = STREAM_READ;
if( rStream.IsWritable() )
- nMode = STREAM_READ | STREAM_WRITE;
-
- // proceed as usual
- Init( m_aURL, nMode, pStorage );
+ m_nMode = STREAM_READ | STREAM_WRITE;
}
-void UCBStorage_Impl::Init( const String& rName, StreamMode nMode, UCBStorage* pStorage )
+void UCBStorage_Impl::Init()
{
- INetURLObject aObj( rName );
+ INetURLObject aObj( m_aURL );
m_aName = m_aOriginalName = aObj.GetLastName();
try
{
// create content; where to put StreamMode ?! ( already done when opening the file of the package ? )
- m_pContent = new ::ucb::Content( rName, Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ m_pContent = new ::ucb::Content( m_aURL, Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
}
catch( ... )
{
@@ -598,10 +597,10 @@ void UCBStorage_Impl::Init( const String& rName, StreamMode nMode, UCBStorage* p
// make methods like IsStream or IsStorage and FillInfoList possible
Sequence< ::rtl::OUString > aProps(4);
::rtl::OUString* pProps = aProps.getArray();
- pProps[0] == ::rtl::OUString::createFromAscii( "Title" );
- pProps[1] == ::rtl::OUString::createFromAscii( "IsFolder" );
- pProps[2] == ::rtl::OUString::createFromAscii( "MediaType" );
- pProps[3] == ::rtl::OUString::createFromAscii( "Size" );
+ pProps[0] = ::rtl::OUString::createFromAscii( "Title" );
+ pProps[1] = ::rtl::OUString::createFromAscii( "IsFolder" );
+ pProps[2] = ::rtl::OUString::createFromAscii( "MediaType" );
+ pProps[3] = ::rtl::OUString::createFromAscii( "Size" );
::ucb::ResultSetInclude eInclude = ::ucb::INCLUDE_FOLDERS_AND_DOCUMENTS;
try
@@ -612,16 +611,17 @@ void UCBStorage_Impl::Init( const String& rName, StreamMode nMode, UCBStorage* p
while ( xResultSet->next() )
{
// insert all into the children list
- ::rtl::OUString aId = xContentAccess->queryContentIdentifierString();
+// ::rtl::OUString aId = xContentAccess->queryContentIdentifierString();
+ ::rtl::OUString aTitle( xRow->getString(1) );
BOOL bIsFolder( xRow->getBoolean(2) );
sal_Int64 nSize = xRow->getLong(4);
::rtl::OUString aContentType= xRow->getString(3);
- UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aId, aContentType, bIsFolder, (ULONG) nSize );
+ UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, aContentType, bIsFolder, (ULONG) nSize );
m_aChildrenList.Insert( pElement, LIST_APPEND );
if ( !bIsFolder )
{
// will be replaced by a detection using the MediaType
- BaseStorageStream* pStream = m_pAntiImpl->OpenStream( xRow->getString(1), nMode, m_bDirect );
+ BaseStorageStream* pStream = m_pAntiImpl->OpenStream( xRow->getString(1), m_nMode, m_bDirect );
if ( Storage::IsStorageFile( const_cast < SvStream* > ( pStream->GetSvStream() ) ) )
pElement->m_bIsStorage = TRUE;
delete pStream;