Commits

hr  committed d1f0977

CWS-TOOLING: integrate CWS ab64_DEV300

  • Participants
  • Parent commits 859ecc7

Comments (0)

Files changed (9)

File basic/source/classes/eventatt.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: eventatt.cxx,v $
- * $Revision: 1.35 $
+ * $Revision: 1.35.40.1 $
  *
  * This file is part of OpenOffice.org.
  *
 
     OSL_TRACE("About to try get a hold of ThisComponent");
     Reference< frame::XModel > xModel = getModelFromBasic( pStartedBasic ) ;
-	Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pBasic, xModel );
+	Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pStartedBasic, xModel );
 
 	Sequence< Any > aArgs( 4 );
 	aArgs[ 0 ] <<= xModel;

File basic/source/comp/exprnode.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: exprnode.cxx,v $
- * $Revision: 1.19 $
+ * $Revision: 1.19.40.1 $
  *
  * This file is part of OpenOffice.org.
  *
 
 //////////////////////////////////////////////////////////////////////////
 
+SbiExprNode::SbiExprNode( void )
+{
+	pLeft = NULL;
+	pRight = NULL;
+	eNodeType = SbxDUMMY;
+}
+
 SbiExprNode::SbiExprNode( SbiParser* p, SbiExprNode* l, SbiToken t, SbiExprNode* r )
 {
 	BaseInit( p );

File basic/source/comp/exprtree.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: exprtree.cxx,v $
- * $Revision: 1.24 $
+ * $Revision: 1.24.40.1 $
  *
  * This file is part of OpenOffice.org.
  *
 			pParser->Next();
 			pRes = new SbiExprNode( pParser, pParser->GetSym() ); break;
 		case LPAREN:
+			pParser->Next();
+			if( nParenLevel == 0 && m_eMode == EXPRMODE_LPAREN_PENDING && pParser->Peek() == RPAREN )
+			{
+				m_eMode = EXPRMODE_EMPTY_PAREN;
+				pRes = new SbiExprNode();	// Dummy node
+				pParser->Next();
+				break;
+			}
 			nParenLevel++;
-			pParser->Next();
 			pRes = Boolean();
 			if( pParser->Peek() != RPAREN )
 			{
 SbiExprNode* SbiExpression::Exp()
 {
 	SbiExprNode* pNd = Unary();
-	while( pParser->Peek() == EXPON ) {
-		SbiToken eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, Unary() );
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
+	{
+		while( pParser->Peek() == EXPON ) {
+			SbiToken eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, Unary() );
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::MulDiv()
 {
 	SbiExprNode* pNd = Exp();
-	for( ;; )
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
 	{
-		SbiToken eTok = pParser->Peek();
-		if( eTok != MUL && eTok != DIV )
-			break;
-		eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, Exp() );
+		for( ;; )
+		{
+			SbiToken eTok = pParser->Peek();
+			if( eTok != MUL && eTok != DIV )
+				break;
+			eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, Exp() );
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::IntDiv()
 {
 	SbiExprNode* pNd = MulDiv();
-	while( pParser->Peek() == IDIV ) {
-		SbiToken eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, MulDiv() );
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
+	{
+		while( pParser->Peek() == IDIV ) {
+			SbiToken eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, MulDiv() );
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::Mod()
 {
 	SbiExprNode* pNd = IntDiv();
-	while( pParser->Peek() == MOD ) {
-		SbiToken eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, IntDiv() );
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
+	{
+		while( pParser->Peek() == MOD ) {
+			SbiToken eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, IntDiv() );
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::AddSub()
 {
 	SbiExprNode* pNd = Mod();
-	for( ;; )
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
 	{
-		SbiToken eTok = pParser->Peek();
-		if( eTok != PLUS && eTok != MINUS )
-			break;
-		eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, Mod() );
+		for( ;; )
+		{
+			SbiToken eTok = pParser->Peek();
+			if( eTok != PLUS && eTok != MINUS )
+				break;
+			eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, Mod() );
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::Cat()
 {
 	SbiExprNode* pNd = AddSub();
-	for( ;; )
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
 	{
-		SbiToken eTok = pParser->Peek();
-		if( eTok != CAT )
-			break;
-		eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, AddSub() );
+		for( ;; )
+		{
+			SbiToken eTok = pParser->Peek();
+			if( eTok != CAT )
+				break;
+			eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, AddSub() );
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::Comp()
 {
 	SbiExprNode* pNd = Cat();
-	short nCount = 0;
-	for( ;; )
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
 	{
-		SbiToken eTok = pParser->Peek();
-		if( m_eMode == EXPRMODE_ARRAY_OR_OBJECT )
-			break;
-		if( eTok != EQ && eTok != NE && eTok != LT
-		 && eTok != GT && eTok != LE && eTok != GE )
-			break;
-		eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, Cat() );
-		nCount++;
-	}
-	// Mehrere Operatoren hintereinander gehen nicht
-	if( nCount > 1 )
-	{
-		pParser->Error( SbERR_SYNTAX );
-		bError = TRUE;
+		short nCount = 0;
+		for( ;; )
+		{
+			SbiToken eTok = pParser->Peek();
+			if( m_eMode == EXPRMODE_ARRAY_OR_OBJECT )
+				break;
+			if( eTok != EQ && eTok != NE && eTok != LT
+			 && eTok != GT && eTok != LE && eTok != GE )
+				break;
+			eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, Cat() );
+			nCount++;
+		}
+		// Mehrere Operatoren hintereinander gehen nicht
+		if( nCount > 1 )
+		{
+			pParser->Error( SbERR_SYNTAX );
+			bError = TRUE;
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::Like()
 {
 	SbiExprNode* pNd = Comp();
-	short nCount = 0;
-	while( pParser->Peek() == LIKE ) {
-		SbiToken eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, Comp() ), nCount++;
-	}
-	// Mehrere Operatoren hintereinander gehen nicht
-	if( nCount > 1 )
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
 	{
-		pParser->Error( SbERR_SYNTAX );
-		bError = TRUE;
+		short nCount = 0;
+		while( pParser->Peek() == LIKE ) {
+			SbiToken eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, Comp() ), nCount++;
+		}
+		// Mehrere Operatoren hintereinander gehen nicht
+		if( nCount > 1 )
+		{
+			pParser->Error( SbERR_SYNTAX );
+			bError = TRUE;
+		}
 	}
 	return pNd;
 }
 SbiExprNode* SbiExpression::Boolean()
 {
 	SbiExprNode* pNd = Like();
-	for( ;; )
+	if( m_eMode != EXPRMODE_EMPTY_PAREN )
 	{
-		SbiToken eTok = pParser->Peek();
-		if( eTok != AND && eTok != OR && eTok != XOR
-		 && eTok != EQV && eTok != IMP && eTok != IS )
-			break;
-		eTok = pParser->Next();
-		pNd = new SbiExprNode( pParser, pNd, eTok, Like() );
+		for( ;; )
+		{
+			SbiToken eTok = pParser->Peek();
+			if( eTok != AND && eTok != OR && eTok != XOR
+			 && eTok != EQV && eTok != IMP && eTok != IS )
+				break;
+			eTok = pParser->Next();
+			pNd = new SbiExprNode( pParser, pNd, eTok, Like() );
+		}
 	}
 	return pNd;
 }
 					bAssumeArrayMode = true;
 					eTok = NIL;
 				}
+				else if( eModeAfter == EXPRMODE_EMPTY_PAREN )
+				{
+					bBracket = TRUE;
+					delete pExpr;
+					return;
+				}
 			}
 			else
 				pExpr = new SbiExpression( pParser );

File basic/source/inc/expr.hxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: expr.hxx,v $
- * $Revision: 1.15 $
+ * $Revision: 1.15.40.1 $
  *
  * This file is part of OpenOffice.org.
  *
 	EXPRMODE_STANDALONE,            // a param1, param2 OR a( param1, param2 ) = 42
 	EXPRMODE_LPAREN_PENDING,        // start of parameter list with bracket, special handling
 	EXPRMODE_LPAREN_NOT_NEEDED,     // pending LPAREN has not been used
-	EXPRMODE_ARRAY_OR_OBJECT        // '=' or '(' or '.' found after ')' on ParenLevel 0, stopping
+	EXPRMODE_ARRAY_OR_OBJECT,       // '=' or '(' or '.' found after ')' on ParenLevel 0, stopping
 									// expression, assuming array syntax a(...)[(...)] = ?
 									// or a(...).b(...)
+	EXPRMODE_EMPTY_PAREN            // It turned out that the paren don't contain anything: a()
 };
 
 enum SbiNodeType {
 	SbxSTRVAL,                      // aStrVal = Wert, before #i59791/#i45570: nStringId = Wert
 	SbxVARVAL,                      // aVar = Wert
 	SbxTYPEOF,                      // TypeOf ObjExpr Is Type
-	SbxNODE							// Node
+	SbxNODE,						// Node
+	SbxDUMMY
 };
 
 enum RecursiveMode
 	void  GenElement( SbiOpcode );  // Element
 	void  BaseInit( SbiParser* p );	// Hilfsfunktion fuer Ctor, AB 17.12.95
 public:
+	SbiExprNode( void );
 	SbiExprNode( SbiParser*, double, SbxDataType );
 	SbiExprNode( SbiParser*, const String& );
 	SbiExprNode( SbiParser*, const SbiSymDef&, SbxDataType, SbiExprList* = NULL );

File scp2/source/ooo/file_library_ooo.scp

 
 STD_UNO_LIB_FILE( gid_File_Lib_Oox , oox)
 
-STD_UNO_LIB_FILE( gid_File_Lib_Sb , sb)
+STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sb , sb)
 
 STD_UNO_LIB_FILE( gid_File_Lib_Scn, scn)
 
   #endif
     RegistryID = gid_Starregistry_Services_Rdb;
     Dir = gid_Dir_Program;
-    Styles = (PACKED, UNO_COMPONENT);
+    Styles = (PACKED,PATCH,UNO_COMPONENT);
 End
 
 STD_UNO_LIB_FILE( gid_File_Lib_Sd , sd)

File scripting/source/provider/ActiveMSPList.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ActiveMSPList.cxx,v $
- * $Revision: 1.16 $
+ * $Revision: 1.16.16.1 $
  *
  * This file is part of OpenOffice.org.
  *
     Reference< document::XScriptInvocationContext > xScriptContext( aContext, UNO_QUERY );
     if ( xScriptContext.is() )
     {
-        // the component supports executing scripts embedded in a - possibly foreign document.
-        // Check whether this other document its the component itself.
-        if ( !xModel.is() || ( xModel != xScriptContext->getScriptContainer() ) )
-        {
-            msp = getMSPFromInvocationContext( xScriptContext );
-            return msp;
-        }
+		try
+		{
+			// the component supports executing scripts embedded in a - possibly foreign document.
+			// Check whether this other document its the component itself.
+			if ( !xModel.is() || ( xModel != xScriptContext->getScriptContainer() ) )
+			{
+				msp = getMSPFromInvocationContext( xScriptContext );
+				return msp;
+			}
+		}
+		catch( const lang::IllegalArgumentException& )
+		{
+			xModel.set( Reference< frame::XModel >() );
+		}
     }
 
     if ( xModel.is() )

File sfx2/source/appl/sfxhelp.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: sfxhelp.cxx,v $
- * $Revision: 1.82 $
+ * $Revision: 1.82.78.1 $
  *
  * This file is part of OpenOffice.org.
  *
     INetProtocol nProtocol = aParser.GetProtocol();
     if ( nProtocol != INET_PROT_VND_SUN_STAR_HELP )
 	{
-		// #90162 Accept anything that is not invalid as help id, as both
+		// #i90162 Accept anything that is not invalid as help id, as both
 		// uno: URLs used as commands/help ids in the Office and the scheme
 		// used in extension help ids (e.g. com.foocorp.foo-ext:FooDialogButton)
 		// are accepted as INET_PROT_UNO respectively INET_PROT_GENERIC
-        if ( nProtocol != INET_PROT_NOT_VALID )
+        bool bAcceptAsURL = ( nProtocol != INET_PROT_NOT_VALID );
+
+		// #i94891 As in some extensions help ids like foo.bar.dummy without
+		// any : have been used that worked before the fix of #i90162 (see
+		// above) strings containing . will be also accepted to avoid brea-
+		// king the help of existing extensions.
+		if( !bAcceptAsURL )
+		    bAcceptAsURL = ( rURL.Search( '.' ) != STRING_NOTFOUND );
+
+        if ( bAcceptAsURL )
 		{
             aHelpURL = CreateHelpURL_Impl( rURL, GetHelpModuleName_Impl( ) );
 		}

File testautomation/framework/optional/includes/basic_issues.inc

     hTestActive( "i86265-2", 1 )
     
     printlog( "" )
+    printlog( " ---------- i92329 ------------ " )
+    hInsertMacroFromFile( "i92329" )
+    hIDERunMacro()
+    hTestActive( "Return an Array" , 1 )
+    
+    printlog( "" )
     printlog( " ---------- MessageBoxes ------------ " )
     hInsertMacroFromFile( "MessageBoxes" )
     hIDERunMacro()

File testautomation/global/input/macros.txt

 End Sub
 
 # ---------------------------------------------------------------------------- #
+
+[i92329]
+Option VBASupport 1
+Sub Main()
+
+    Dim mTmp() As String  
+    mTmp() = Test(False) '<-- generates an 'unexpected ')' compiler error
+    MsgBox mTmp(0) & " " & mTmp(1)
+    
+End Sub
+
+Function Test(ByVal bFlag As Boolean) As Variant
+
+    Dim mRanges(100) As String
+
+    If (bFlag = True) Then
+        Test = "return a String"
+    Else
+        mRanges(0) = "Return an"
+        mRanges(1) = "Array"
+        Test = mRanges()
+    End If
+
+End Function
+
+# ---------------------------------------------------------------------------- #