Lines Matching refs:pSearchCondition
1810 void OSQLParseNode::disjunctiveNormalForm(OSQLParseNode*& pSearchCondition) in disjunctiveNormalForm() argument
1813 if(!pSearchCondition) // no where condition at entry point in disjunctiveNormalForm()
1816 OSQLParseNode::absorptions(pSearchCondition); in disjunctiveNormalForm()
1818 if (SQL_ISRULE(pSearchCondition,boolean_primary)) in disjunctiveNormalForm()
1820 OSQLParseNode* pLeft = pSearchCondition->getChild(1); in disjunctiveNormalForm()
1824 else if (SQL_ISRULE(pSearchCondition,search_condition)) in disjunctiveNormalForm()
1826 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in disjunctiveNormalForm()
1829 OSQLParseNode* pRight = pSearchCondition->getChild(2); in disjunctiveNormalForm()
1833 else if (SQL_ISRULE(pSearchCondition,boolean_term)) in disjunctiveNormalForm()
1835 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in disjunctiveNormalForm()
1838 OSQLParseNode* pRight = pSearchCondition->getChild(2); in disjunctiveNormalForm()
1851 pSearchCondition->removeAt(2); in disjunctiveNormalForm()
1857 replaceAndReset(pSearchCondition,pNewNode); in disjunctiveNormalForm()
1859 disjunctiveNormalForm(pSearchCondition); in disjunctiveNormalForm()
1870 pSearchCondition->removeAt((sal_uInt32)0); in disjunctiveNormalForm()
1877 replaceAndReset(pSearchCondition,pNewNode); in disjunctiveNormalForm()
1878 disjunctiveNormalForm(pSearchCondition); in disjunctiveNormalForm()
1881 pSearchCondition->replace(pLeft, pLeft->removeAt(1)); in disjunctiveNormalForm()
1883 pSearchCondition->replace(pRight, pRight->removeAt(1)); in disjunctiveNormalForm()
1887 void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_Bool bNegate) in negateSearchCondition() argument
1890 if(!pSearchCondition) // no where condition at entry point in negateSearchCondition()
1893 if (pSearchCondition->count() == 3 && SQL_ISRULE(pSearchCondition,boolean_primary)) in negateSearchCondition()
1895 OSQLParseNode* pRight = pSearchCondition->getChild(1); in negateSearchCondition()
1899 else if (SQL_ISRULE(pSearchCondition,search_condition)) in negateSearchCondition()
1901 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in negateSearchCondition()
1902 OSQLParseNode* pRight = pSearchCondition->getChild(2); in negateSearchCondition()
1906 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0)); in negateSearchCondition()
1908 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1)); in negateSearchCondition()
1909 replaceAndReset(pSearchCondition,pNewNode); in negateSearchCondition()
1919 else if (SQL_ISRULE(pSearchCondition,boolean_term)) in negateSearchCondition()
1921 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in negateSearchCondition()
1922 OSQLParseNode* pRight = pSearchCondition->getChild(2); in negateSearchCondition()
1926 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0)); in negateSearchCondition()
1928 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1)); in negateSearchCondition()
1929 replaceAndReset(pSearchCondition,pNewNode); in negateSearchCondition()
1939 else if (SQL_ISRULE(pSearchCondition,boolean_factor)) in negateSearchCondition()
1941 OSQLParseNode *pNot = pSearchCondition->removeAt((sal_uInt32)0); in negateSearchCondition()
1943 OSQLParseNode *pBooleanTest = pSearchCondition->removeAt((sal_uInt32)0); in negateSearchCondition()
1945 replaceAndReset(pSearchCondition,pBooleanTest); in negateSearchCondition()
1948 negateSearchCondition(pSearchCondition,sal_True); // negate all deeper values in negateSearchCondition()
1952 …else if(bNegate && (SQL_ISRULE(pSearchCondition,comparison_predicate) || SQL_ISRULE(pSearchConditi… in negateSearchCondition()
1954 OSQLParseNode* pComparison = pSearchCondition->getChild(1); in negateSearchCondition()
1980 pSearchCondition->replace(pComparison, pNewComparison); in negateSearchCondition()
1984 …else if(bNegate && (SQL_ISRULE(pSearchCondition,test_for_null) || SQL_ISRULE(pSearchCondition,in_p… in negateSearchCondition()
1985 … SQL_ISRULE(pSearchCondition,between_predicate) || SQL_ISRULE(pSearchCondition,boolean_test) )) in negateSearchCondition()
1987 OSQLParseNode* pPart2 = pSearchCondition; in negateSearchCondition()
1988 if ( !SQL_ISRULE(pSearchCondition,boolean_test) ) in negateSearchCondition()
1989 pPart2 = pSearchCondition->getChild(1); in negateSearchCondition()
1991 if ( SQL_ISRULE( pSearchCondition, test_for_null ) ) in negateSearchCondition()
1993 else if ( SQL_ISRULE( pSearchCondition, boolean_test ) ) in negateSearchCondition()
2005 else if(bNegate && (SQL_ISRULE(pSearchCondition,like_predicate))) in negateSearchCondition()
2007 OSQLParseNode* pNot = pSearchCondition->getChild( 1 )->getChild( 0 ); in negateSearchCondition()
2013 pSearchCondition->getChild( 1 )->replace(pNot, pNotNot); in negateSearchCondition()
2018 void OSQLParseNode::eraseBraces(OSQLParseNode*& pSearchCondition) in eraseBraces() argument
2021 …if (pSearchCondition && (SQL_ISRULE(pSearchCondition,boolean_primary) || (pSearchCondition->count(… in eraseBraces()
2022 SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")")))) in eraseBraces()
2024 OSQLParseNode* pRight = pSearchCondition->getChild(1); in eraseBraces()
2027 …if(!(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || SQL_ISRULE(pSearchCondition->getChi… in eraseBraces()
2028 … SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || // and can always stand without () in eraseBraces()
2029 …(SQL_ISRULE(pSearchCondition->getChild(1),search_condition) && SQL_ISRULE(pSearchCondition->getPar… in eraseBraces()
2031 OSQLParseNode* pNode = pSearchCondition->removeAt(1); in eraseBraces()
2032 replaceAndReset(pSearchCondition,pNode); in eraseBraces()
2037 void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition) in absorptions() argument
2040 if(!pSearchCondition) // no where condition at entry point in absorptions()
2043 eraseBraces(pSearchCondition); in absorptions()
2045 if(SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition)) in absorptions()
2047 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in absorptions()
2049 OSQLParseNode* pRight = pSearchCondition->getChild(2); in absorptions()
2056 if(( SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition)) in absorptions()
2057 && *pSearchCondition->getChild(0) == *pSearchCondition->getChild(2)) in absorptions()
2059 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2060 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2064 else if ( SQL_ISRULE(pSearchCondition,boolean_term) in absorptions()
2066 ( SQL_ISRULE(pSearchCondition->getChild(nPos = 0),boolean_primary) in absorptions()
2067 || SQL_ISRULE(pSearchCondition->getChild(nPos),search_condition) in absorptions()
2069 || ( SQL_ISRULE(pSearchCondition->getChild(nPos = 2),boolean_primary) in absorptions()
2070 || SQL_ISRULE(pSearchCondition->getChild(nPos),search_condition) in absorptions()
2075 OSQLParseNode* p2ndSearch = pSearchCondition->getChild(nPos); in absorptions()
2079 …if ( *p2ndSearch->getChild(0) == *pSearchCondition->getChild(2-nPos) ) // a and ( a or b) -> a or b in absorptions()
2081 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2082 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2085 …else if ( *p2ndSearch->getChild(2) == *pSearchCondition->getChild(2-nPos) ) // a and ( b or a) -> … in absorptions()
2087 pNewNode = pSearchCondition->removeAt((sal_uInt32)2); in absorptions()
2088 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2096 OSQLParseNode* pA = pSearchCondition->removeAt((sal_uInt32)2-nPos); in absorptions()
2107 replaceAndReset(pSearchCondition,pNode); in absorptions()
2111 …else if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(2),… in absorptions()
2113 if(*pSearchCondition->getChild(2)->getChild(0) == *pSearchCondition->getChild(0)) in absorptions()
2115 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2116 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2118 else if(*pSearchCondition->getChild(2)->getChild(2) == *pSearchCondition->getChild(0)) in absorptions()
2120 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2121 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2125 …else if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(0),… in absorptions()
2127 if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)) in absorptions()
2129 pNewNode = pSearchCondition->removeAt((sal_uInt32)2); in absorptions()
2130 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2132 else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)) in absorptions()
2134 pNewNode = pSearchCondition->removeAt((sal_uInt32)2); in absorptions()
2135 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2138 eraseBraces(pSearchCondition); in absorptions()
2141 void OSQLParseNode::compress(OSQLParseNode *&pSearchCondition) in compress() argument
2144 if(!pSearchCondition) // no where condition at entry point in compress()
2147 OSQLParseNode::eraseBraces(pSearchCondition); in compress()
2149 if(SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition)) in compress()
2151 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in compress()
2154 OSQLParseNode* pRight = pSearchCondition->getChild(2); in compress()
2157 …else if( SQL_ISRULE(pSearchCondition,boolean_primary) || (pSearchCondition->count() == 3 && SQL_IS… in compress()
2158 SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")"))) in compress()
2160 OSQLParseNode* pRight = pSearchCondition->getChild(1); in compress()
2163 …if(!(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || SQL_ISRULE(pSearchCondition->getChi… in compress()
2164 …(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) && SQL_ISRULE(pSearchCondition->getParent(… in compress()
2165 …(SQL_ISRULE(pSearchCondition->getChild(1),search_condition) && SQL_ISRULE(pSearchCondition->getPar… in compress()
2167 OSQLParseNode* pNode = pSearchCondition->removeAt(1); in compress()
2168 replaceAndReset(pSearchCondition,pNode); in compress()
2173 …if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(0),boole… in compress()
2175 … if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)->getChild(0)) in compress()
2177 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt(2); in compress()
2178 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt(2); in compress()
2189 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt((sal_uInt32)0),pNewRule); in compress()
2190 replaceAndReset(pSearchCondition,pNode); in compress()
2192 …else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)->getChild(0)) in compress()
2194 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt((sal_uInt32)0); in compress()
2195 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt(2); in compress()
2206 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt(1),pNewRule); in compress()
2207 replaceAndReset(pSearchCondition,pNode); in compress()
2209 …else if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)->getChild(2)) in compress()
2211 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt(2); in compress()
2212 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt((sal_uInt32)0); in compress()
2223 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt((sal_uInt32)0),pNewRule); in compress()
2224 replaceAndReset(pSearchCondition,pNode); in compress()
2226 …else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)->getChild(2)) in compress()
2228 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt((sal_uInt32)0); in compress()
2229 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt((sal_uInt32)0); in compress()
2240 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt(1),pNewRule); in compress()
2241 replaceAndReset(pSearchCondition,pNode); in compress()