diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-06-16 11:33:33 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-06-16 11:33:33 +0000 |
commit | 88b52f7fc235827c95c579f32badada6baeafce5 (patch) | |
tree | 7d735d10272e9a7dc94b61d88c687d1cb6787439 /dbaccess/source/ui/querydesign/QueryDesignView.cxx | |
parent | a3fe4afd2b9e3c15b2151f35fb3db1144267a669 (diff) |
INTEGRATION: CWS rptchart02 (1.91.2); FILE MERGED
2008/06/11 12:40:24 oj 1.91.2.4: RESYNC: (1.92-1.93); FILE MERGED
2008/05/23 08:36:38 oj 1.91.2.3: #i84290# change sql rule table_ref
2008/05/21 11:57:44 oj 1.91.2.2: RESYNC: (1.91-1.92); FILE MERGED
2008/05/20 08:18:26 oj 1.91.2.1: #i84290# range_variable changed
Diffstat (limited to 'dbaccess/source/ui/querydesign/QueryDesignView.cxx')
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index e2360d4bc..aacd8f0cb 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: QueryDesignView.cxx,v $ - * $Revision: 1.93 $ + * $Revision: 1.94 $ * * This file is part of OpenOffice.org. * @@ -210,33 +210,9 @@ namespace ::rtl::OUString sTableRange; if ( _pTableRef ) { - if ( SQL_ISRULE( _pTableRef, joined_table ) ) - { - OSL_ENSURE(0,"joined_table NYI"); - } - else - { - switch( _pTableRef->count() ) - { - case 1: - _pTableRef->parseNodeToStr(sTableRange,xConnection,NULL,sal_False,sal_False); - break; - case 3: - sTableRange = _pTableRef->getChild(2)->getTokenValue(); - break; - case 4: - if ( !SQL_ISRULE( _pTableRef->getChild(2), joined_table )) - sTableRange = _pTableRef->getChild(2)->getTokenValue(); - else - OSL_ENSURE(0,"Outer join is not implemented here!"); - break; - case 6: - sTableRange = _pTableRef->getChild(4)->getTokenValue(); - break; - default: - OSL_ENSURE(0,"Unhandled child count"); - } - } + sTableRange = ::connectivity::OSQLParseNode::getTableRange(_pTableRef); + if ( !sTableRange.getLength() ) + _pTableRef->parseNodeToStr(sTableRange,xConnection,NULL,sal_False,sal_False); } return sTableRange; } @@ -336,11 +312,10 @@ namespace 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 ) @@ -1930,11 +1905,7 @@ namespace 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)) @@ -1945,14 +1916,11 @@ namespace 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 |