Tag: cws_src680_dba24b User: oj Date: 2007-08-24 10:16:56+0000 Modified: dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx
Log: #i75557# allow functions before like File Changes: 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.86.46.4&r2=1.86.46.5 Delta lines: +41 -19 --------------------- --- QueryDesignView.cxx 2007-08-24 08:21:37+0000 1.86.46.4 +++ QueryDesignView.cxx 2007-08-24 10:16:54+0000 1.86.46.5 @@ -4,9 +4,9 @@ * * $RCSfile: QueryDesignView.cxx,v $ * - * $Revision: 1.86.46.4 $ + * $Revision: 1.86.46.5 $ * - * last change: $Author: oj $ $Date: 2007/08/24 08:21:37 $ + * last change: $Author: oj $ $Date: 2007/08/24 10:16:54 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1473,7 +1473,8 @@ } else if( SQL_ISRULE(pCondition,like_predicate) ) { - if (SQL_ISRULE(pCondition->getChild(0), column_ref ) ) + const ::connectivity::OSQLParseNode* pValueExp = pCondition->getChild(0); + if (SQL_ISRULE(pValueExp, column_ref ) ) { ::rtl::OUString aColumnName; ::rtl::OUString aCondition; @@ -1489,7 +1490,7 @@ static_cast<sal_Char>(sDecimal.toChar()), &pController->getParser().getContext()); - pCondition->getChild(0)->parseNodeToPredicateStr( aColumnName, + pValueExp->parseNodeToPredicateStr( aColumnName, xConnection, pController->getNumberFormatter(), aLocale, @@ -1502,9 +1503,20 @@ } OTableFieldDescRef aDragLeft = new OTableFieldDesc(); - if ( eOk == ( eErrorCode = FillDragInfo(_pView,pCondition->getChild(0),aDragLeft) )) + if ( eOk == ( eErrorCode = FillDragInfo(_pView,pValueExp,aDragLeft) )) _pSelectionBrw->AddCondition(aDragLeft, aCondition, nLevel); } + else if(SQL_ISRULEOR2(pValueExp,general_set_fct ,set_fct_spec) || + SQL_ISRULEOR2(pValueExp,position_exp,extract_exp) || + SQL_ISRULEOR2(pValueExp,fold,char_substring_fct) || + SQL_ISRULEOR2(pValueExp,length_exp,char_value_fct)) + { + AddFunctionCondition( _pView, + _pSelectionBrw, + pCondition, + nLevel, + bHaving); + } else { eErrorCode = eNoColumnInLike; @@ -1558,12 +1570,16 @@ { SqlParseError eErrorCode = eOk; OQueryController* pController = static_cast<OQueryController*>(_pView->getController()); - OSL_ENSURE(SQL_ISRULEOR2(pCondition->getChild(0), set_fct_spec , general_set_fct ),"Illegal call!"); - ::rtl::OUString aCondition; - OTableFieldDescRef aDragLeft = new OTableFieldDesc(); OSQLParseNode* pFunction = pCondition->getChild(0); + OSL_ENSURE(SQL_ISRULEOR2(pFunction,general_set_fct ,set_fct_spec) || + SQL_ISRULEOR2(pFunction,position_exp,extract_exp) || + SQL_ISRULEOR2(pFunction,fold,char_substring_fct) || + SQL_ISRULEOR2(pFunction,length_exp,char_value_fct),"Illegal call!"); + ::rtl::OUString aCondition; + OTableFieldDescRef aDragLeft = new OTableFieldDesc(); + ::rtl::OUString aColumnName; Reference< XConnection> xConnection = pController->getConnection(); if(xConnection.is()) @@ -1576,12 +1592,18 @@ static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), &pController->getParser().getContext()); - pFunction->parseNodeToPredicateStr(aColumnName, + pFunction->parseNodeToStr( aColumnName, xConnection, - pController->getNumberFormatter(), - _pView->getLocale(), - static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), - &pController->getParser().getContext()); + &pController->getParser().getContext(), + sal_True, + sal_True); // quote is to true because we need quoted elements inside the function + // i75557 + //pFunction->parseNodeToPredicateStr(aColumnName, + // xConnection, + // pController->getNumberFormatter(), + // _pView->getLocale(), + // static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), + // &pController->getParser().getContext()); // don't display the column name aCondition = aCondition.copy(aColumnName.getLength()); aCondition = aCondition.trim(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
