diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-29 15:35:53 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-29 15:35:53 +0000 |
commit | cef8ad253f7fabe950b7690ab69d899882314da7 (patch) | |
tree | 92505066f80b14037d8df8a5f646b3f775661dd1 /basic/source/comp | |
parent | 230a4146019cfcc4b41832b8daf3c16e902d9db3 (diff) |
#i10000#: Integration of CWS ab17fixes was broken. Reverse changes.
Diffstat (limited to 'basic/source/comp')
-rw-r--r-- | basic/source/comp/exprnode.cxx | 147 | ||||
-rw-r--r-- | basic/source/comp/exprtree.cxx | 101 | ||||
-rw-r--r-- | basic/source/comp/io.cxx | 71 | ||||
-rw-r--r-- | basic/source/comp/loops.cxx | 80 | ||||
-rw-r--r-- | basic/source/comp/scanner.cxx | 4 | ||||
-rw-r--r-- | basic/source/comp/token.cxx | 4 |
6 files changed, 145 insertions, 262 deletions
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index b205a2bee9c1..91ac54569753 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -1,61 +1,35 @@ /************************************************************************* * - * $RCSfile: exprnode.cxx,v $ - * - * $Revision: 1.10 $ - * - * last change: $Author: hr $ $Date: 2005-09-29 12:46:06 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 - * - * Sun Microsystems Inc., October, 2000 + * OpenOffice.org - a multi-platform office productivity suite * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * $RCSfile: exprnode.cxx,v $ * + * $Revision: 1.11 $ * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. + * last change: $Author: hr $ $Date: 2005-09-29 16:35:53 $ * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * - * Copyright: 2000 by Sun Microsystems, Inc. + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA * - * All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. * - * Contributor(s): _______________________________________ + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA * ************************************************************************/ @@ -299,14 +273,18 @@ void SbiExprNode::FoldConstants() { String rl( pLeft->GetString() ); String rr( pRight->GetString() ); + delete pLeft; pLeft = NULL; + delete pRight; pRight = NULL; + eType = SbxDOUBLE; + eNodeType = SbxNUMVAL; + bComposite = FALSE; + StringCompare eRes = rr.CompareTo( rl ); + //StringCompare eRes = rl.Compare( rr ); String s; - bool bOk = true; - if( eTok == PLUS || eTok == CAT ) + switch( eTok ) { - // #i45570: Block long strings - UINT32 nTotalLen = rl.Len() + rr.Len(); - if( nTotalLen < 0x50 ) - { + case PLUS: + case CAT: eTok = CAT; // Verkettung: s = rl; @@ -314,47 +292,28 @@ void SbiExprNode::FoldConstants() nStringId = pGen->GetParser()->aGblStrings.Add( s, TRUE ); eType = SbxSTRING; eNodeType = SbxSTRVAL; - } - else - { - bOk = false; - } - } - else - { - eType = SbxDOUBLE; - eNodeType = SbxNUMVAL; - StringCompare eRes = rr.CompareTo( rl ); - switch( eTok ) - { - case EQ: - nVal = ( eRes == COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE; - break; - case NE: - nVal = ( eRes != COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE; - break; - case LT: - nVal = ( eRes == COMPARE_LESS ) ? SbxTRUE : SbxFALSE; - break; - case GT: - nVal = ( eRes == COMPARE_GREATER ) ? SbxTRUE : SbxFALSE; - break; - case LE: - nVal = ( eRes != COMPARE_GREATER ) ? SbxTRUE : SbxFALSE; - break; - case GE: - nVal = ( eRes != COMPARE_LESS ) ? SbxTRUE : SbxFALSE; - break; - default: - pGen->GetParser()->Error( SbERR_CONVERSION ); - bError = TRUE; - } - } - if( bOk ) - { - delete pLeft; pLeft = NULL; - delete pRight; pRight = NULL; - bComposite = FALSE; + break; + case EQ: + nVal = ( eRes == COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE; + break; + case NE: + nVal = ( eRes != COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE; + break; + case LT: + nVal = ( eRes == COMPARE_LESS ) ? SbxTRUE : SbxFALSE; + break; + case GT: + nVal = ( eRes == COMPARE_GREATER ) ? SbxTRUE : SbxFALSE; + break; + case LE: + nVal = ( eRes != COMPARE_GREATER ) ? SbxTRUE : SbxFALSE; + break; + case GE: + nVal = ( eRes != COMPARE_LESS ) ? SbxTRUE : SbxFALSE; + break; + default: + pGen->GetParser()->Error( SbERR_CONVERSION ); + bError = TRUE; } } else diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 8cf48fd87b2d..1fa6140a0e3b 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -1,61 +1,35 @@ /************************************************************************* * - * $RCSfile: exprtree.cxx,v $ - * - * $Revision: 1.9 $ - * - * last change: $Author: hr $ $Date: 2005-09-29 12:46:41 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 - * - * Sun Microsystems Inc., October, 2000 - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA + * OpenOffice.org - a multi-platform office productivity suite * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * $RCSfile: exprtree.cxx,v $ * + * $Revision: 1.10 $ * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. + * last change: $Author: hr $ $Date: 2005-09-29 16:35:53 $ * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * - * Copyright: 2000 by Sun Microsystems, Inc. + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA * - * All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. * - * Contributor(s): _______________________________________ + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA * ************************************************************************/ @@ -849,18 +823,31 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bConst, BOOL bPar) : // Benannte Argumente: entweder .name= oder name:= else { - pExpr = bConst ? new SbiConstExpression( pParser ) - : new SbiExpression( pParser ); - if( pParser->Peek() == ASSIGN ) + if( eTok == DOT ) { - // VBA mode: name:= - // SbiExpression::Term() hat einen String daraus gemacht - aName = pExpr->GetString(); - delete pExpr; + // VB mode: .name= pParser->Next(); - pExpr = new SbiExpression( pParser ); - if( bConst ) - pParser->Error( SbERR_SYNTAX ), bError = TRUE; + pParser->TestSymbol( TRUE ); // Keywords sind OK + aName = pParser->GetSym(); + pParser->TestToken( EQ ); + pExpr = bConst ? new SbiConstExpression( pParser ) + : new SbiExpression( pParser ); + } + else + { + pExpr = bConst ? new SbiConstExpression( pParser ) + : new SbiExpression( pParser ); + if( pParser->Peek() == ASSIGN ) + { + // VBA mode: name:= + // SbiExpression::Term() hat einen String daraus gemacht + aName = pExpr->GetString(); + delete pExpr; + pParser->Next(); + pExpr = new SbiExpression( pParser ); + if( bConst ) + pParser->Error( SbERR_SYNTAX ), bError = TRUE; + } } pExpr->GetName() = aName; } diff --git a/basic/source/comp/io.cxx b/basic/source/comp/io.cxx index 736e71e98615..5b5ec2b9e1bf 100644 --- a/basic/source/comp/io.cxx +++ b/basic/source/comp/io.cxx @@ -1,61 +1,35 @@ /************************************************************************* * - * $RCSfile: io.cxx,v $ - * - * $Revision: 1.4 $ - * - * last change: $Author: hr $ $Date: 2005-09-29 12:47:06 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 - * - * Sun Microsystems Inc., October, 2000 + * OpenOffice.org - a multi-platform office productivity suite * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * $RCSfile: io.cxx,v $ * + * $Revision: 1.5 $ * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. + * last change: $Author: hr $ $Date: 2005-09-29 16:35:53 $ * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * - * Copyright: 2000 by Sun Microsystems, Inc. + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA * - * All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. * - * Contributor(s): _______________________________________ + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA * ************************************************************************/ @@ -76,8 +50,7 @@ BOOL SbiParser::Channel( BOOL bAlways ) if( IsHash() ) { SbiExpression aExpr( this ); - while( Peek() == COMMA || Peek() == SEMICOLON ) - Next(); + if( Peek() == COMMA ) Next(); aExpr.Gen(); aGen.Gen( _CHANNEL ); bRes = TRUE; diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx index ff49918b2b5e..0bb774c13c32 100644 --- a/basic/source/comp/loops.cxx +++ b/basic/source/comp/loops.cxx @@ -1,61 +1,35 @@ /************************************************************************* * - * $RCSfile: loops.cxx,v $ - * - * $Revision: 1.5 $ - * - * last change: $Author: hr $ $Date: 2005-09-29 12:47:35 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 - * - * Sun Microsystems Inc., October, 2000 - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. + * OpenOffice.org - a multi-platform office productivity suite * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * $RCSfile: loops.cxx,v $ * + * $Revision: 1.6 $ * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. + * last change: $Author: hr $ $Date: 2005-09-29 16:35:53 $ * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * - * Copyright: 2000 by Sun Microsystems, Inc. + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA * - * All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. * - * Contributor(s): _______________________________________ + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA * ************************************************************************/ @@ -512,7 +486,6 @@ void SbiParser::On() { // ON ERROR GOTO label|0 Next(); - bool bError = false; if( MayBeLabel() ) { if( eCurTok == NUMBER && !nVal ) @@ -523,16 +496,7 @@ void SbiParser::On() aGen.Gen( _ERRHDL, nOff ); } } - else if( eCurTok == MINUS ) - { - Next(); - if( eCurTok == NUMBER && nVal == 1 ) - aGen.Gen( _STDERROR ); - else - bError = true; - } - if( bError ) - Error( SbERR_LABEL_EXPECTED ); + else Error( SbERR_LABEL_EXPECTED ); } else if( eCurTok == RESUME ) { diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 87a53e6e5b96..bbd3d156019c 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -4,9 +4,9 @@ * * $RCSfile: scanner.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: hr $ $Date: 2005-09-29 16:17:05 $ + * last change: $Author: hr $ $Date: 2005-09-29 16:35:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx index 517fbd3c97c7..229d93f59221 100644 --- a/basic/source/comp/token.cxx +++ b/basic/source/comp/token.cxx @@ -4,9 +4,9 @@ * * $RCSfile: token.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: hr $ $Date: 2005-09-29 16:17:05 $ + * last change: $Author: hr $ $Date: 2005-09-29 16:35:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. |