summaryrefslogtreecommitdiff
path: root/basic/source/uno/namecont.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2007-01-29 14:06:29 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2007-01-29 14:06:29 +0000
commit07bf3a97395fb3fca2fc21501f19a7924d61a9e8 (patch)
treea46e22d3f1954a5a21271c2069eb1e72a1dc0dd4 /basic/source/uno/namecont.cxx
parent8cc5ab9e79bc37fb3a7ee9e6826a97ba7592e874 (diff)
INTEGRATION: CWS npower5 (1.3.20); FILE MERGED
2007/01/24 12:46:10 npower 1.3.20.4: #i71380# fix warning 2007/01/22 12:56:57 npower 1.3.20.3: #i71380# correct bad header include 2007/01/22 12:56:00 npower 1.3.20.2: #i71380# correct bad header include 2007/01/17 16:53:06 npower 1.3.20.1: #i71380# re-add code to raise ui when trying to save password protected libraries containing modules that exceed the size limit
Diffstat (limited to 'basic/source/uno/namecont.cxx')
-rw-r--r--basic/source/uno/namecont.cxx58
1 files changed, 52 insertions, 6 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 1c22d1a8b3..b909090946 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: namecont.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: hr $ $Date: 2007-01-02 15:41:19 $
+ * last change: $Author: rt $ $Date: 2007-01-29 15:06:29 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -121,6 +121,8 @@
#ifndef _CPPUHELPER_EXC_HLP_HXX_
#include <cppuhelper/exc_hlp.hxx>
#endif
+#include "sbmod.hxx"
+
namespace basic
{
@@ -1106,7 +1108,7 @@ SfxLibrary* SfxLibraryContainer::getImplLib( const String& rLibraryName )
sal_Bool SfxLibraryContainer::implStorePasswordLibrary(
SfxLibrary*,
const OUString&,
- const uno::Reference< embed::XStorage >& )
+ const uno::Reference< embed::XStorage >&, const uno::Reference< task::XInteractionHandler >& )
{
return sal_False;
}
@@ -1116,7 +1118,8 @@ sal_Bool SfxLibraryContainer::implStorePasswordLibrary(
const ::rtl::OUString& /*aName*/,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& /*xStorage*/,
const ::rtl::OUString& /*aTargetURL*/,
- const Reference< XSimpleFileAccess > /*xToUseSFI*/ )
+ const Reference< XSimpleFileAccess > /*xToUseSFI*/,
+ const uno::Reference< task::XInteractionHandler >& )
{
return sal_False;
}
@@ -1675,7 +1678,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
loadLibrary( rLib.aName );
if( pImplLib->mbPasswordProtected )
- implStorePasswordLibrary( pImplLib, rLib.aName, xLibraryStor );
+ implStorePasswordLibrary( pImplLib, rLib.aName, xLibraryStor, uno::Reference< task::XInteractionHandler >() );
// TODO: Check return value
else
implStoreLibrary( pImplLib, rLib.aName, xLibraryStor );
@@ -2314,7 +2317,7 @@ void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OU
uno::Reference< ::com::sun::star::embed::XStorage > xDummyStor;
if( pImplLib->mbPasswordProtected )
- implStorePasswordLibrary( pImplLib, Name, xDummyStor, URL, xToUseSFI );
+ implStorePasswordLibrary( pImplLib, Name, xDummyStor, URL, xToUseSFI, Handler );
else
implStoreLibrary( pImplLib, Name, xDummyStor, URL, xToUseSFI, Handler );
@@ -2386,6 +2389,49 @@ OUString SfxLibraryContainer::expand_url( const OUString& url )
}
+bool SfxLibraryContainer::LegacyPsswdBinaryLimitExceeded( Sequence< rtl::OUString >& rNames )
+{
+ Sequence< OUString > aNames = maNameContainer.getElementNames();
+ const OUString* pNames = aNames.getConstArray();
+ sal_Int32 i, nNameCount = aNames.getLength();
+ for( i = 0 ; i < nNameCount ; i++ )
+ {
+ SfxLibrary* pLib = getImplLib( pNames[ i ] );
+ if( !pLib->mbSharedIndexFile && pLib->mbPasswordProtected )
+ {
+ StarBASIC* pBasicLib = ( mpBasMgr ? mpBasMgr->GetLib( pNames[ i ] ) : NULL );
+ if ( pBasicLib )
+ {
+ Sequence< OUString > aElementNames = pLib->getElementNames();
+ sal_Int32 nLen = aElementNames.getLength();
+ const OUString* pStr = aElementNames.getConstArray();
+ Sequence< OUString > aBigModules( nLen );
+ sal_Int32 nBigModules = 0;
+
+ for( sal_Int32 index = 0 ; index < nLen ; index++ )
+ {
+ OUString aElementName = pStr[ index ];
+ SbModule* pMod = pBasicLib->FindModule( aElementName );
+ if ( pMod )
+ {
+ if ( pMod->ExceedsLegacyModuleSize() )
+ {
+ aBigModules[ nBigModules++ ] = aElementName;
+ }
+ }
+ }
+ if ( nBigModules )
+ {
+ aBigModules.realloc( nBigModules );
+ rNames = aBigModules;
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
//============================================================================
// Implementation class SfxLibrary