diff options
Diffstat (limited to 'package/source')
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 17 | ||||
-rw-r--r-- | package/source/xstor/owriteablestream.hxx | 1 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 9 | ||||
-rw-r--r-- | package/source/xstor/xstorage.hxx | 3 |
4 files changed, 30 insertions, 0 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 56b308b60478..29afc8649228 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -2750,6 +2750,23 @@ void SAL_CALL OWriteStream::setEncryptionData( const uno::Sequence< beans::Named } //----------------------------------------------- +sal_Bool SAL_CALL OWriteStream::hasEncryptionData() + throw (uno::RuntimeException) +{ + ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + + if (!m_pImpl) + return sal_False; + + sal_Bool bRet = m_pImpl->IsEncrypted(); + + if (!bRet && m_pImpl->m_bUseCommonEncryption && m_pImpl->m_pParent) + bRet = m_pImpl->m_pParent->m_bHasCommonEncryptionData; + + return bRet; +} + +//----------------------------------------------- sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) throw ( io::IOException, uno::RuntimeException ) diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx index 0e9884bd75cb..aefe0b82002c 100644 --- a/package/source/xstor/owriteablestream.hxx +++ b/package/source/xstor/owriteablestream.hxx @@ -372,6 +372,7 @@ public: //XEncryptionProtectedSource2 virtual void SAL_CALL setEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasEncryptionData() throw (::com::sun::star::uno::RuntimeException); //XRelationshipAccess virtual ::sal_Bool SAL_CALL hasByID( const ::rtl::OUString& sID ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 9c0c117f5e35..40b129ff509a 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -4806,6 +4806,15 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu } } +sal_Bool SAL_CALL OStorage::hasEncryptionData() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + + return m_pImpl && m_pImpl->m_bHasCommonEncryptionData; +} + + //____________________________________________________________________________________________________ // XEncryptionProtectedStorage //____________________________________________________________________________________________________ diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index f472444556c2..f1770e5e372f 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -647,6 +647,9 @@ public: throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasEncryptionData() + throw ( ::com::sun::star::uno::RuntimeException ); + //____________________________________________________________________________________________________ // XEncryptionProtectedStorage //____________________________________________________________________________________________________ |