Commits

Anonymous committed ad6fbf5

#i10000# build fix

Comments (0)

Files changed (3)

package/source/xstor/owriteablestream.cxx

 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,
 
 }
 
-// ================================================================
-namespace
-{
 //-----------------------------------------------
 void StaticAddLog( const ::rtl::OUString& aMessage )
 {
 }
 } // namespace package
 
+// ================================================================
+namespace
+{
 //-----------------------------------------------
 void SetEncryptionKeyProperty_Impl( const uno::Reference< beans::XPropertySet >& xPropertySet,
 									const uno::Sequence< sal_Int8 >& aKey )
             {
                 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" ) ) );
             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" ) ) );
         {
             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" ) ) );
 			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
 	}
 	else
 	{
-		SetEncryptionKeyProperty_Impl( xPropertySet, MakeKeyFromPass( aPass, sal_True ) );
+		SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_True ) );
 
 		try {
 			xResultStream = GetStream_Impl( nStreamMode, bHierarchyAccess );
 		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 );
 	{
 		// 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() )
 	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();
 		}
 		catch( packages::WrongPasswordException& aWrongPasswordException )
 		{
-			SetEncryptionKeyProperty_Impl( xPropertySet, MakeKeyFromPass( aPass, sal_False ) );
+			SetEncryptionKeyProperty_Impl( xPropertySet, ::package::MakeKeyFromPass( aPass, sal_False ) );
 			try {
 				xDataToCopy = m_xPackageStream->getDataStream();
 

package/source/xstor/owriteablestream.hxx

 
 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

package/source/xstor/xstorage.cxx

 };
 
 //=========================================================
-
-extern uno::Sequence< sal_Int8 > MakeKeyFromPass( ::rtl::OUString aPass, sal_Bool bUseUTF );
-
 ::rtl::OUString GetNewTempFileURL( const uno::Reference< lang::XMultiServiceFactory > xFactory );
 
 // static
 		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;