diff options
author | Thomas Benisch <tbe@openoffice.org> | 2001-12-18 10:26:25 +0000 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2001-12-18 10:26:25 +0000 |
commit | 385a7859dc4b3bacfb4e97b2bd97b22753a96280 (patch) | |
tree | e802085f94d85fd107a6fac9e222b6f08026a6a0 /basctl | |
parent | 1d2166daa484277c54858a2abad9e78c3f29ab1b (diff) |
#86383# Basic libraries cannot be added
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 7 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 7 | ||||
-rw-r--r-- | basctl/source/basicide/bastype3.cxx | 7 | ||||
-rw-r--r-- | basctl/source/basicide/bastypes.cxx | 9 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 49 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 7 |
6 files changed, 56 insertions, 30 deletions
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 150c387b83f2..71c6f19f4f81 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: basides1.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: tbe $ $Date: 2001-12-14 16:56:58 $ + * last change: $Author: tbe $ $Date: 2001-12-18 11:26:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -610,7 +610,8 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq ) Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY ); if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) { - bOK = QueryPassword( xModLibContainer, aLibName ); + String aPassword; + bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); } } } diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index b675a09658bf..d2d376e9d546 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bastype2.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: tbe $ $Date: 2001-12-13 18:27:59 $ + * last change: $Author: tbe $ $Date: 2001-12-18 11:26:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -416,7 +416,8 @@ long BasicTreeListBox::ExpandingHdl() Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY ); if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) { - bOK = QueryPassword( xModLibContainer, aLibName ); + String aPassword; + bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); } } } diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index 6363efed0821..fa5b99ec4801 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bastype3.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: tbe $ $Date: 2001-12-14 16:57:58 $ + * last change: $Author: tbe $ $Date: 2001-12-18 11:26:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,7 +121,8 @@ void __EXPORT BasicTreeListBox::RequestingChilds( SvLBoxEntry* pEntry ) Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY ); if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) { - bOK = QueryPassword( xModLibContainer, aLibName ); + String aPassword; + bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); } } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 72566c4e1803..6d0d59148421 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bastypes.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: tbe $ $Date: 2001-12-13 18:29:39 $ + * last change: $Author: tbe $ $Date: 2001-12-18 11:26:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1060,7 +1060,7 @@ BOOL QueryDelModule( const String& rName, Window* pParent ) return QueryDel( rName, IDEResId( RID_STR_QUERYDELMODULE ), pParent ); } -BOOL QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, const String& rLibName, BOOL bRepeat, BOOL bNewTitle ) +BOOL QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, const String& rLibName, String& rPassword, BOOL bRepeat, BOOL bNewTitle ) { BOOL bOK = FALSE; USHORT nRet = 0; @@ -1091,7 +1091,8 @@ BOOL QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, Reference< script::XLibraryContainerPassword > xPasswd( xLibContainer, UNO_QUERY ); if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) { - ::rtl::OUString aOUPassword( pDlg->GetPassword() ); + rPassword = pDlg->GetPassword(); + ::rtl::OUString aOUPassword( rPassword ); bOK = xPasswd->verifyLibraryPassword( aOULibName, aOUPassword ); if ( !bOK ) diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index f792be3b045e..3ebd0ca10139 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: moduldl2.cxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.32 $ * - * last change: $Author: tbe $ $Date: 2001-12-13 18:29:39 $ + * last change: $Author: tbe $ $Date: 2001-12-18 11:26:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1065,12 +1065,14 @@ void LibPage::InsertLib() } // check, if the library is password protected + BOOL bOK = FALSE; + String aPassword; if ( xModLibContImport.is() && xModLibContImport->hasByName( aOULibName ) ) { Reference< script::XLibraryContainerPassword > xPasswd( xModLibContImport, UNO_QUERY ); - if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) + if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) && !bReference ) { - BOOL bOK = QueryPassword( xModLibContImp, aLibName, TRUE, TRUE ); + bOK = QueryPassword( xModLibContImp, aLibName, aPassword, TRUE, TRUE ); if ( !bOK ) { @@ -1106,14 +1108,15 @@ void LibPage::InsertLib() if ( bReference ) { // storage URL + INetURLObject aModStorageURLObj( aModURLObj ); if ( aExtension == aContExtension ) { - sal_Int32 nCount = aModURLObj.getSegmentCount(); - aModURLObj.insertName( aLibName, false, nCount-1 ); - aModURLObj.setExtension( aLibExtension ); - aModURLObj.setFinalSlash(); + sal_Int32 nCount = aModStorageURLObj.getSegmentCount(); + aModStorageURLObj.insertName( aLibName, false, nCount-1 ); + aModStorageURLObj.setExtension( aLibExtension ); + aModStorageURLObj.setFinalSlash(); } - ::rtl::OUString aModStorageURL( aModURLObj.GetMainURL() ); + ::rtl::OUString aModStorageURL( aModStorageURLObj.GetMainURL() ); // create library link xModLib = Reference< container::XNameContainer >( xModLibContainer->createLibraryLink( aOULibName, aModStorageURL, TRUE ), UNO_QUERY); @@ -1145,6 +1148,23 @@ void LibPage::InsertLib() Any aElement = xModLibImport->getByName( aOUModName ); xModLib->insertByName( aOUModName, aElement ); } + + // set password + if ( bOK ) + { + Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY ); + if ( xPasswd.is() ) + { + try + { + ::rtl::OUString aOUPassword( aPassword ); + xPasswd->changeLibraryPassword( aOULibName, ::rtl::OUString(), aOUPassword ); + } + catch (...) + { + } + } + } } } } @@ -1157,14 +1177,15 @@ void LibPage::InsertLib() if ( bReference ) { // storage URL + INetURLObject aDlgStorageURLObj( aDlgURLObj ); if ( aExtension == aContExtension ) { - sal_Int32 nCount = aDlgURLObj.getSegmentCount(); - aDlgURLObj.insertName( aLibName, false, nCount - 1 ); - aDlgURLObj.setExtension( aLibExtension ); - aDlgURLObj.setFinalSlash(); + sal_Int32 nCount = aDlgStorageURLObj.getSegmentCount(); + aDlgStorageURLObj.insertName( aLibName, false, nCount - 1 ); + aDlgStorageURLObj.setExtension( aLibExtension ); + aDlgStorageURLObj.setFinalSlash(); } - ::rtl::OUString aDlgStorageURL( aDlgURLObj.GetMainURL() ); + ::rtl::OUString aDlgStorageURL( aDlgStorageURLObj.GetMainURL() ); // create library link xDlgLib = Reference< container::XNameContainer >( xDlgLibContainer->createLibraryLink( aOULibName, aDlgStorageURL, TRUE ), UNO_QUERY); diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 47cbaaaaa427..495c52c98a26 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: moduldlg.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: tbe $ $Date: 2001-12-14 16:59:17 $ + * last change: $Author: tbe $ $Date: 2001-12-18 11:26:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -846,7 +846,8 @@ StarBASIC* ObjectPage::GetSelectedBasic() Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY ); if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) { - bOK = QueryPassword( xModLibContainer, aLibName ); + String aPassword; + bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); } // load library |