Author: damjan Date: Mon Nov 9 18:14:21 2015 New Revision: 1713502 URL: http://svn.apache.org/viewvc?rev=1713502&view=rev Log: #i121096# When editing a table query in Design View, the ORDER BY clause of the the query being edited is ignored.
When Base's Query Design View parses the SQL query, it looked at the wrong node position in the SQL parse tree for the ORDER BY clause (child 4 = join instead of child 5 = order by), causing the sort order to be forgotten. Fix this. Patch by: me Modified: openoffice/trunk/main/dbaccess/source/ui/querydesign/QueryDesignView.cxx Modified: openoffice/trunk/main/dbaccess/source/ui/querydesign/QueryDesignView.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/dbaccess/source/ui/querydesign/QueryDesignView.cxx?rev=1713502&r1=1713501&r2=1713502&view=diff ============================================================================== --- openoffice/trunk/main/dbaccess/source/ui/querydesign/QueryDesignView.cxx (original) +++ openoffice/trunk/main/dbaccess/source/ui/querydesign/QueryDesignView.cxx Mon Nov 9 18:14:21 2015 @@ -2400,9 +2400,9 @@ namespace const ::connectivity::OSQLParseNode* pParseRoot ) { SqlParseError eErrorCode = eOk; - if (!pParseRoot->getChild(3)->getChild(4)->isLeaf()) + if (!pParseRoot->getChild(3)->getChild(ORDER_BY_CHILD_POS)->isLeaf()) { - ::connectivity::OSQLParseNode* pNode = pParseRoot->getChild(3)->getChild(4)->getChild(2); + ::connectivity::OSQLParseNode* pNode = pParseRoot->getChild(3)->getChild(ORDER_BY_CHILD_POS)->getChild(2); ::connectivity::OSQLParseNode* pParamRef = NULL; OQueryController& rController = static_cast<OQueryController&>(_pView->getController());