Tag: cws_dev300_rptchart02
User: oj      
Date: 2008-05-23 08:36:42+0000
Modified:
   dba/dbaccess/source/core/api/RowSetCache.cxx
   dba/dbaccess/source/ui/browser/dbloader.cxx
   dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx

Log:
 #i84290# change sql rule table_ref

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: RowSetCache.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCache.cxx?r1=1.97.6.1&r2=1.97.6.2
Delta lines:  +3 -5
-------------------
--- RowSetCache.cxx     2008-05-20 08:18:06+0000        1.97.6.1
+++ RowSetCache.cxx     2008-05-23 08:36:37+0000        1.97.6.2
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: RowSetCache.cxx,v $
- * $Revision: 1.97.6.1 $
+ * $Revision: 1.97.6.2 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1484,16 +1484,14 @@
 
                                if(bCheck)
                                { // here we know that we have to check on 
which side our table resides
-                                       OSQLParseNode* pTableRef = 
pJoin->getByRule(::connectivity::OSQLParseNode::qualified_join);
+                                       const OSQLParseNode* pTableRef = 
pJoin->getByRule(::connectivity::OSQLParseNode::qualified_join);
                                        if(bLeftSide)
                                                pTableRef = pJoin->getChild(0);
                                        else
                                                pTableRef = pJoin->getChild(3);
                                        
OSL_ENSURE(SQL_ISRULE(pTableRef,table_ref),"Must be a tableref here!");
 
-                                       ::rtl::OUString sTableRange;
-                                       if(pTableRef->count() == 4 && 
pTableRef->getChild(2)->isToken() )
-                                               sTableRange = 
pTableRef->getChild(2)->getTokenValue(); // Tabellenrange an Pos 2
+                    ::rtl::OUString sTableRange = 
OSQLParseNode::getTableRange(pTableRef);
                                        if(!sTableRange.getLength())
                                                
pTableRef->getChild(0)->parseNodeToStr( sTableRange, _xConnection, NULL, 
sal_False, sal_False );
                                        bOk =  sTableRange == _sUpdateTableName;

Directory: /dba/dbaccess/source/ui/browser/
===========================================

File [changed]: dbloader.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbloader.cxx?r1=1.36&r2=1.36.6.1
Delta lines:  +4 -3
-------------------
--- dbloader.cxx        2008-04-10 14:05:28+0000        1.36
+++ dbloader.cxx        2008-05-23 08:36:38+0000        1.36.6.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: dbloader.cxx,v $
- * $Revision: 1.36 $
+ * $Revision: 1.36.6.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -211,7 +211,8 @@
         ServiceNameToImplName( URL_COMPONENT_DATASOURCEBROWSER,     
"org.openoffice.comp.dbu.ODatasourceBrowser"   ),
         ServiceNameToImplName( URL_COMPONENT_QUERYDESIGN,           
"org.openoffice.comp.dbu.OQueryDesign"         ),
         ServiceNameToImplName( URL_COMPONENT_TABLEDESIGN,           
"org.openoffice.comp.dbu.OTableDesign"         ),
-        ServiceNameToImplName( URL_COMPONENT_RELATIONDESIGN,        
"org.openoffice.comp.dbu.ORelationDesign"      )
+        ServiceNameToImplName( URL_COMPONENT_RELATIONDESIGN,        
"org.openoffice.comp.dbu.ORelationDesign"      ),
+        ServiceNameToImplName( URL_COMPONENT_VIEWDESIGN,            
"org.openoffice.comp.dbu.OViewDesign"          )
     };
 
     INetURLObject aParser( rURL );

Directory: /dba/dbaccess/source/ui/querydesign/
===============================================

File [changed]: QueryDesignView.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx?r1=1.91.2.2&r2=1.91.2.3
Delta lines:  +11 -45
---------------------
--- QueryDesignView.cxx 2008-05-21 11:57:44+0000        1.91.2.2
+++ QueryDesignView.cxx 2008-05-23 08:36:38+0000        1.91.2.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: QueryDesignView.cxx,v $
- * $Revision: 1.91.2.2 $
+ * $Revision: 1.91.2.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -210,35 +210,9 @@
         ::rtl::OUString sTableRange;
         if ( _pTableRef )
         {
-            if ( SQL_ISRULE( _pTableRef, joined_table ) )
-            {
-                OSL_ENSURE(0,"joined_table NYI");
-            }
-            else 
-            {
-                switch( _pTableRef->count() )
-                {
-                    case 1:
+            sTableRange = 
::connectivity::OSQLParseNode::getTableRange(_pTableRef);
+            if ( !sTableRange.getLength() )
                         
_pTableRef->parseNodeToStr(sTableRange,xConnection,NULL,sal_False,sal_False);
-                        break;
-                    case 3:
-                        if ( _pTableRef->getChild(2)->isToken() )
-                            sTableRange = 
_pTableRef->getChild(2)->getTokenValue();
-                        break;
-                    case 4:
-                        if ( !SQL_ISRULE( _pTableRef->getChild(2), 
joined_table ) && _pTableRef->getChild(2)->isToken())
-                            sTableRange = 
_pTableRef->getChild(2)->getTokenValue();
-                        else
-                            OSL_ENSURE(0,"Outer join is not implemented 
here!");
-                        break;
-                    case 6:
-                        if ( _pTableRef->getChild(4)->isToken() )
-                            sTableRange = 
_pTableRef->getChild(4)->getTokenValue();
-                        break;
-                    default:
-                        OSL_ENSURE(0,"Unhandled child count");
-                }
-            }
         }
         return sTableRange;
     }
@@ -338,11 +312,10 @@
                        const ::connectivity::OSQLParseNode* pParseNode = 
pTableRefList->getChild(i);
                        const ::connectivity::OSQLParseNode* pJoinNode = NULL;
 
-                       if ( SQL_ISRULEOR2(pParseNode , 
qualified_join,joined_table) || SQL_ISRULE(pParseNode ,cross_union) )
+                       if ( SQL_ISRULEOR2(pParseNode , 
qualified_join,cross_union) )
                                pJoinNode = pParseNode;
-                       else if(        pParseNode->count() == 4 
-                                       &&      
SQL_ISPUNCTUATION(pParseNode->getChild(0),"{") 
-                                       &&      
SQL_ISRULE(pParseNode,table_ref))
+                       else if(        SQL_ISRULE(pParseNode,table_ref)
+                                       &&      pParseNode->count() == 4 ) // 
'{' SQL_TOKEN_OJ joined_table '}'
                                pJoinNode = pParseNode->getChild(2);
 
                        if ( pJoinNode )
@@ -1924,11 +1897,7 @@
                sal_Bool bRet = sal_True;
                if (SQL_ISRULE(_pNode,qualified_join))
                        pJoinNode = _pNode;
-               else if (SQL_ISRULE(_pNode, joined_table))
-                       pJoinNode = _pNode->getChild(1);
-               else if (! ( SQL_ISRULE(_pNode, table_ref) &&
-                                        (SQL_ISRULEOR2(_pNode->getChild(0), 
catalog_name, schema_name)  ||
-                                         SQL_ISRULE(_pNode->getChild(0), 
table_name))))
+               else if (! ( SQL_ISRULE(_pNode, table_ref) && _pNode->count() 
== 2) ) // table_node table_primary_as_range_column
                        bRet = sal_False;
 
                if (pJoinNode && !InsertJoin(_pView,pJoinNode))
@@ -1939,14 +1908,11 @@
        sal_Bool InsertJoin(const OQueryDesignView* _pView,
                                                const 
::connectivity::OSQLParseNode *pNode)
        {
-               DBG_ASSERT(SQL_ISRULE(pNode, qualified_join) || 
SQL_ISRULE(pNode, joined_table) || SQL_ISRULE(pNode, cross_union),
+               DBG_ASSERT(SQL_ISRULE(pNode, qualified_join) || 
SQL_ISRULE(pNode, cross_union),
                        "OQueryDesignView::InsertJoin: Fehler im Parse Tree");
 
-               if (SQL_ISRULE(pNode,joined_table))
-                       return InsertJoin(_pView,pNode->getChild(1));
-
                // first check the left and right side
-        ::connectivity::OSQLParseNode* pRightTableRef = pNode->getChild(3); // 
table_ref
+        const ::connectivity::OSQLParseNode* pRightTableRef = 
pNode->getChild(3); // table_ref
         if ( SQL_ISRULE(pNode, qualified_join) && 
SQL_ISTOKEN(pNode->getChild(1),NATURAL) )
             pRightTableRef = pNode->getChild(4); // table_ref
 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to