summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-08 13:50:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-08 15:29:53 +0100
commitf57baefbd3c4c5d8e5ec28e8702c91d60ffc5de2 (patch)
tree79e65468b9b8aba28c14533a89314389a5f4d727 /package
parent4a90740fcee07996469ff702daa04953f39be191 (diff)
add chaff to encrypted documents
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/owriteablestream.cxx17
-rw-r--r--package/source/xstor/owriteablestream.hxx1
-rw-r--r--package/source/xstor/xstorage.cxx9
-rw-r--r--package/source/xstor/xstorage.hxx3
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
//____________________________________________________________________________________________________