diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-06-13 09:38:27 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-06-13 09:38:27 +0000 |
commit | 6fa0add0b47b86b1f769aa7468659247f4a52e23 (patch) | |
tree | e4f7fc299f777f8b91860e3f5ac72f9dc88d1b30 /basic/source/classes/eventatt.cxx | |
parent | e4fd76b99f7c0563768a26684f63f6d29d063920 (diff) |
#88056# Changed RTL function CreateUnoDialog()
Diffstat (limited to 'basic/source/classes/eventatt.cxx')
-rw-r--r-- | basic/source/classes/eventatt.cxx | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 48161e7f978a..e756511f135d 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: eventatt.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: ab $ $Date: 2001-05-17 09:11:11 $ + * last change: $Author: ab $ $Date: 2001-06-13 10:38:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -524,51 +524,36 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) if( !xMSF.is() ) return; - // We need at least 2 parameters - if ( rPar.Count() < 3 ) + // We need at least 1 parameter + if ( rPar.Count() < 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - // Get library + // Get dialog SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject(); if( !(pObj && pObj->ISA(SbUnoObject)) ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); - TypeClass eType = aAny.getValueType().getTypeClass(); - if( eType != TypeClass_INTERFACE ) - { - StarBASIC::Error( SbERR_BAD_ARGUMENT ); - return; - } + Any aAnyISP = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + TypeClass eType = aAnyISP.getValueType().getTypeClass(); - // Get XNameAccess from any - Reference< XNameAccess > xNameAccess; - aAny >>= xNameAccess; - if( !xNameAccess.is() ) + if( eType != TypeClass_INTERFACE ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - // Get dialog name - String aDialogName = rPar.Get( 2 )->GetString(); - // Create new uno dialog Reference< XNameContainer > xDialogModel( xMSF->createInstance ( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ) ), UNO_QUERY ); - // Get dialog data - if( !xNameAccess->hasByName( aDialogName ) ) - return; - Any aElement = xNameAccess->getByName( aDialogName ); Reference< XInputStreamProvider > xISP; - aElement >>= xISP; + aAnyISP >>= xISP; if( !xISP.is() ) return; |