[ooo-build-commit] .: patches/dev300 patches/vba
Noel Power
noelp at kemper.freedesktop.org
Mon Sep 20 11:20:52 PDT 2010
patches/dev300/apply | 2
patches/vba/vba-fix-logical-precedence-order.diff | 160 ++++++++++++++++++++++
2 files changed, 162 insertions(+)
New commits:
commit c0b117ff56ab5958cf5556b41ab088c00143e1f9
Author: Noel Power <noel.power at novell.com>
Date: Mon Sep 20 19:14:04 2010 +0100
fix vba logical operator precedence
diff --git a/patches/dev300/apply b/patches/dev300/apply
index dbee7e7..415b79f 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1160,6 +1160,8 @@ vba-override-base-vbaevents.diff
vbasupport-patch-roll-up.diff, i#113356, i#112998 i#113955 i#113358 i#113515 i#112531 i#112596 i#112530
# fix column address for Range.Cell
vba-rangecell-colparam.diff, bnc#639297
+# fix logical Operator precendence for VBA
+vba-fix-logical-precedence-order.diff
[ VBAUntested ]
SectionOwner => noelpwer
# KEEP - unfinished autotext stuff
diff --git a/patches/vba/vba-fix-logical-precedence-order.diff b/patches/vba/vba-fix-logical-precedence-order.diff
new file mode 100644
index 0000000..a718103
--- /dev/null
+++ b/patches/vba/vba-fix-logical-precedence-order.diff
@@ -0,0 +1,160 @@
+diff --git basic/source/comp/.exprtree.cxx.swp basic/source/comp/.exprtree.cxx.swp
+index 7c58029..eaee086 100644
+Binary files basic/source/comp/.exprtree.cxx.swp and basic/source/comp/.exprtree.cxx.swp differ
+diff --git basic/source/comp/exprtree.cxx basic/source/comp/exprtree.cxx
+index e7025f7..38098f1 100644
+--- basic/source/comp/exprtree.cxx
++++ basic/source/comp/exprtree.cxx
+@@ -583,12 +583,15 @@ SbiExprNode* SbiExpression::Unary()
+ case MINUS:
+ eTok = NEG;
+ case NOT:
+- pParser->Next();
+- // process something like "Do While Not "foo"="" "
+ if( pParser->IsVBASupportOn() )
+- pNd = new SbiExprNode( pParser, Like(), eTok, NULL );
+- else
++ {
++ pNd = Operand();
++ }
++ else
++ {
++ pParser->Next();
+ pNd = new SbiExprNode( pParser, Unary(), eTok, NULL );
++ }
+ break;
+ case PLUS:
+ pParser->Next();
+@@ -733,9 +736,114 @@ SbiExprNode* SbiExpression::Comp()
+ return pNd;
+ }
+
++
++SbiExprNode* SbiExpression::VBA_Not()
++{
++ SbiExprNode* pNd = NULL;
++
++ SbiToken eTok = pParser->Peek();
++ if( eTok == NOT )
++ {
++ pParser->Next();
++ pNd = new SbiExprNode( pParser, VBA_Not(), eTok, NULL );
++ }
++ else
++ {
++ pNd = Comp();
++ }
++ return pNd;
++}
++
++SbiExprNode* SbiExpression::VBA_And()
++{
++ SbiExprNode* pNd = VBA_Not();
++ if( m_eMode != EXPRMODE_EMPTY_PAREN )
++ {
++ for( ;; )
++ {
++ SbiToken eTok = pParser->Peek();
++ if( eTok != AND )
++ break;
++ eTok = pParser->Next();
++ pNd = new SbiExprNode( pParser, pNd, eTok, VBA_Not() );
++ }
++ }
++ return pNd;
++}
++
++SbiExprNode* SbiExpression::VBA_Or()
++{
++ SbiExprNode* pNd = VBA_And();
++ if( m_eMode != EXPRMODE_EMPTY_PAREN )
++ {
++ for( ;; )
++ {
++ SbiToken eTok = pParser->Peek();
++ if( eTok != OR )
++ break;
++ eTok = pParser->Next();
++ pNd = new SbiExprNode( pParser, pNd, eTok, VBA_And() );
++ }
++ }
++ return pNd;
++}
++
++SbiExprNode* SbiExpression::VBA_Xor()
++{
++ SbiExprNode* pNd = VBA_Or();
++ if( m_eMode != EXPRMODE_EMPTY_PAREN )
++ {
++ for( ;; )
++ {
++ SbiToken eTok = pParser->Peek();
++ if( eTok != XOR )
++ break;
++ eTok = pParser->Next();
++ pNd = new SbiExprNode( pParser, pNd, eTok, VBA_Or() );
++ }
++ }
++ return pNd;
++
++}
++
++SbiExprNode* SbiExpression::VBA_Eqv()
++{
++ SbiExprNode* pNd = VBA_Xor();
++ if( m_eMode != EXPRMODE_EMPTY_PAREN )
++ {
++ for( ;; )
++ {
++ SbiToken eTok = pParser->Peek();
++ if( eTok != EQV )
++ break;
++ eTok = pParser->Next();
++ pNd = new SbiExprNode( pParser, pNd, eTok, VBA_Xor() );
++ }
++ }
++ return pNd;
++}
++
++SbiExprNode* SbiExpression::VBA_Imp()
++{
++ SbiExprNode* pNd = VBA_Eqv();
++ if( m_eMode != EXPRMODE_EMPTY_PAREN )
++ {
++ for( ;; )
++ {
++ SbiToken eTok = pParser->Peek();
++ if( eTok != IMP )
++ break;
++ eTok = pParser->Next();
++ pNd = new SbiExprNode( pParser, pNd, eTok, VBA_Eqv() );
++ }
++ }
++ return pNd;
++
++}
++
+ SbiExprNode* SbiExpression::Like()
+ {
+- SbiExprNode* pNd = Comp();
++ SbiExprNode* pNd = pParser->IsVBASupportOn() ? VBA_Imp() : Comp();
+ if( m_eMode != EXPRMODE_EMPTY_PAREN )
+ {
+ short nCount = 0;
+diff --git basic/source/inc/expr.hxx basic/source/inc/expr.hxx
+index 96604cb..d76dc14 100644
+--- basic/source/inc/expr.hxx
++++ basic/source/inc/expr.hxx
+@@ -188,6 +188,12 @@ protected:
+ SbiExprNode* AddSub();
+ SbiExprNode* Cat();
+ SbiExprNode* Like();
++ SbiExprNode* VBA_Not();
++ SbiExprNode* VBA_And();
++ SbiExprNode* VBA_Or();
++ SbiExprNode* VBA_Xor();
++ SbiExprNode* VBA_Eqv();
++ SbiExprNode* VBA_Imp();
+ SbiExprNode* Comp();
+ SbiExprNode* Boolean();
+ public:
More information about the ooo-build-commit
mailing list