summaryrefslogtreecommitdiff
path: root/package/source/xstor
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2009-06-22 11:31:54 +0000
committerRelease Engineers <releng@openoffice.org>2009-06-22 11:31:54 +0000
commitea54c0553eb7255bee02f07c2ad60831fed532da (patch)
treee3a8db7aeda4d7cdc33f5e02e987e0f9448dfd12 /package/source/xstor
parent88586c15cf929e0ab72ac461cbd41a9867b8c3e3 (diff)
#i10000# build fix
Diffstat (limited to 'package/source/xstor')
-rw-r--r--package/source/xstor/owriteablestream.cxx28
-rw-r--r--package/source/xstor/owriteablestream.hxx1
-rw-r--r--package/source/xstor/xstorage.cxx5
3 files changed, 16 insertions, 18 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 45df6d306a8c..8b02a6114227 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -65,7 +65,7 @@ using namespace ::com::sun::star;
namespace package
{
//-----------------------------------------------
-uno::Sequence< sal_Int8 > MakeKeyFromPass( ::rtl::OUString aPass, sal_Bool bUseUTF )
+uno::Sequence< sal_Int8 > MakeKeyFromPass( const ::rtl::OUString& aPass, sal_Bool bUseUTF )
{
// MS_1252 encoding was used for SO60 document format password encoding,
// this encoding supports only a minor subset of nonascii characters,
@@ -90,9 +90,6 @@ uno::Sequence< sal_Int8 > MakeKeyFromPass( ::rtl::OUString aPass, sal_Bool bUseU
}
-// ================================================================
-namespace
-{
//-----------------------------------------------
void StaticAddLog( const ::rtl::OUString& aMessage )
{
@@ -112,6 +109,9 @@ void StaticAddLog( const ::rtl::OUString& aMessage )
}
} // namespace package
+// ================================================================
+namespace
+{
//-----------------------------------------------
void SetEncryptionKeyProperty_Impl( const uno::Reference< beans::XPropertySet >& xPropertySet,
const uno::Sequence< sal_Int8 >& aKey )
@@ -723,7 +723,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetTempFileAsInputStream()
{
xInputStream = xTempAccess->openFileRead( m_aTempURL );
}
- catch( uno::Exception& )
+ catch( uno::Exception& aException )
{
AddLog( aException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) );
@@ -764,7 +764,7 @@ void OWriteStream_Impl::CopyTempFileToOutput( uno::Reference< io::XOutputStream
if ( xTempInp.is() )
::comphelper::OStorageHelper::CopyInputToOutput( xTempInStream, xOutStream );
}
- catch( uno::Exception& )
+ catch( uno::Exception& aException )
{
AddLog( aException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) );
@@ -789,7 +789,7 @@ void OWriteStream_Impl::CopyTempFileToOutput( uno::Reference< io::XOutputStream
{
xTempInStream = xTempAccess->openFileRead( m_aTempURL );
}
- catch( uno::Exception& )
+ catch( uno::Exception& aException )
{
AddLog( aException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) );
@@ -995,7 +995,7 @@ void OWriteStream_Impl::Commit()
throw uno::RuntimeException();
xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ),
- uno::makeAny( MakeKeyFromPass( m_aPass, sal_True ) ) );
+ uno::makeAny( ::package::MakeKeyFromPass( m_aPass, sal_True ) ) );
}
// the stream should be free soon, after package is stored
@@ -1328,7 +1328,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
}
else
{
- SetEncryptionKeyProperty_Impl( xPropertySet, MakeKeyFromPass( aPass, sal_True ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_True ) );
try {
xResultStream = GetStream_Impl( nStreamMode, bHierarchyAccess );
@@ -1340,7 +1340,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
catch( packages::WrongPasswordException& )
{
// retry with different encoding
- SetEncryptionKeyProperty_Impl( xPropertySet, MakeKeyFromPass( aPass, sal_False ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_False ) );
try {
// the stream must be cashed to be resaved
xResultStream = GetStream_Impl( nStreamMode | embed::ElementModes::SEEKABLE, bHierarchyAccess );
@@ -1688,8 +1688,8 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
{
// TODO: introduce last commited cashed password information and use it here
// that means "use common pass" also should be remembered on flash
- uno::Sequence< sal_Int8 > aNewKey = MakeKeyFromPass( aPass, sal_True );
- uno::Sequence< sal_Int8 > aOldKey = MakeKeyFromPass( aPass, sal_False );
+ uno::Sequence< sal_Int8 > aNewKey = ::package::MakeKeyFromPass( aPass, sal_True );
+ uno::Sequence< sal_Int8 > aOldKey = ::package::MakeKeyFromPass( aPass, sal_False );
uno::Reference< beans::XPropertySet > xProps( m_xPackageStream, uno::UNO_QUERY );
if ( !xProps.is() )
@@ -1711,7 +1711,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
else
{
uno::Reference< beans::XPropertySet > xPropertySet( m_xPackageStream, uno::UNO_QUERY );
- SetEncryptionKeyProperty_Impl( xPropertySet, MakeKeyFromPass( aPass, sal_True ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_True ) );
try {
xDataToCopy = m_xPackageStream->getDataStream();
@@ -1724,7 +1724,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
}
catch( packages::WrongPasswordException& aWrongPasswordException )
{
- SetEncryptionKeyProperty_Impl( xPropertySet, MakeKeyFromPass( aPass, sal_False ) );
+ SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_False ) );
try {
xDataToCopy = m_xPackageStream->getDataStream();
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index cc0d0731e3a5..107ffd8f0ba8 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -78,6 +78,7 @@ namespace cppu {
namespace package {
void StaticAddLog( const ::rtl::OUString& aMessage );
+ ::com::sun::star::uno::Sequence< sal_Int8 > MakeKeyFromPass( const ::rtl::OUString& aPass, sal_Bool bUseUTF );
}
struct WSInternalData_Impl
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index a782780f13bc..b49fbd67b98d 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -99,9 +99,6 @@ struct StorInternalData_Impl
};
//=========================================================
-
-extern uno::Sequence< sal_Int8 > MakeKeyFromPass( ::rtl::OUString aPass, sal_Bool bUseUTF );
-
::rtl::OUString GetNewTempFileURL( const uno::Reference< lang::XMultiServiceFactory > xFactory );
// static
@@ -4657,7 +4654,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass )
try
{
xPackPropSet->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionKey" ) ),
- uno::makeAny( MakeKeyFromPass( aPass, sal_True ) ) );
+ uno::makeAny( ::package::MakeKeyFromPass( aPass, sal_True ) ) );
m_pImpl->m_bHasCommonPassword = sal_True;
m_pImpl->m_aCommonPassword = aPass;