summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2001-02-19 12:14:44 +0000
committerMathias Bauer <mba@openoffice.org>2001-02-19 12:14:44 +0000
commit31821432199303d90e6a553244b467fc2c16ab49 (patch)
tree5302a8303745e36e1624287b4b06c90af15cd6f0 /sot
parent8cb29fd2259e4aca333fad5767a0c4429951b861 (diff)
allow setting properties on UCBStorage elements
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/storage.cxx59
-rw-r--r--sot/source/sdstor/ucbstorage.cxx70
2 files changed, 126 insertions, 3 deletions
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 3c6a54d60b96..8c8f62e2edba 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: storage.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: mba $ $Date: 2001-02-12 17:18:09 $
+ * last change: $Author: mba $ $Date: 2001-02-19 13:14:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -397,6 +397,34 @@ BOOL SotStorageStream::Revert()
return GetError() == SVSTREAM_OK;
}
+BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+{
+ UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm );
+ if ( pStg )
+ {
+ return pStg->SetProperty( rName, rValue );
+ }
+ else
+ {
+ DBG_ERROR("Not implemented!")
+ return FALSE;
+ }
+}
+
+BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+{
+ UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm );
+ if ( pStg )
+ {
+ return pStg->GetProperty( rName, rValue );
+ }
+ else
+ {
+ DBG_ERROR("Not implemented!")
+ return FALSE;
+ }
+}
+
/************** class SotStorage ******************************************
*************************************************************************/
class SotStorageFactory : public SotFactory
@@ -1100,4 +1128,31 @@ BOOL SotStorage::Validate()
return TRUE;
}
+BOOL SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+{
+ UCBStorage* pStg = PTR_CAST( UCBStorage, pOwnStg );
+ if ( pStg )
+ {
+ return pStg->SetProperty( rName, rValue );
+ }
+ else
+ {
+ DBG_ERROR("Not implemented!")
+ return FALSE;
+ }
+}
+
+BOOL SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+{
+ UCBStorage* pStg = PTR_CAST( UCBStorage, pOwnStg );
+ if ( pStg )
+ {
+ return pStg->GetProperty( rName, rValue );
+ }
+ else
+ {
+ DBG_ERROR("Not implemented!")
+ return FALSE;
+ }
+}
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index bd8f97700109..c1c09b8bfebe 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -87,7 +87,6 @@ sal_Int32 GetFormatId_Impl( SvGlobalName aName )
}
-
SvGlobalName GetClassId_Impl( sal_Int32 nFormat )
{
switch ( nFormat )
@@ -689,6 +688,40 @@ BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm )
return TRUE;
}
+BOOL UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+{
+ try
+ {
+ if ( pImp->m_pContent )
+ {
+ pImp->m_pContent->setPropertyValue( rName, rValue );
+ return TRUE;
+ }
+ }
+ catch ( Exception& )
+ {
+ }
+
+ return FALSE;
+}
+
+BOOL UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+{
+ try
+ {
+ if ( pImp->m_pContent )
+ {
+ rValue = pImp->m_pContent->getPropertyValue( rName );
+ return TRUE;
+ }
+ }
+ catch ( Exception& )
+ {
+ }
+
+ return FALSE;
+}
+
UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect )
{
// pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
@@ -1782,3 +1815,38 @@ BOOL UCBStorage::IsStorageFile( SvStream* pFile )
pFile->Seek( nPos );
return bRet;
}
+
+BOOL UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+{
+ try
+ {
+ if ( pImp->m_pContent )
+ {
+ pImp->m_pContent->setPropertyValue( rName, rValue );
+ return TRUE;
+ }
+ }
+ catch ( Exception& )
+ {
+ }
+
+ return FALSE;
+}
+
+BOOL UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+{
+ try
+ {
+ if ( pImp->m_pContent )
+ {
+ rValue = pImp->m_pContent->getPropertyValue( rName );
+ return TRUE;
+ }
+ }
+ catch ( Exception& )
+ {
+ }
+
+ return FALSE;
+}
+