Lines Matching refs:pSearchCondition
1807 void OSQLParseNode::disjunctiveNormalForm(OSQLParseNode*& pSearchCondition) in disjunctiveNormalForm() argument
1810 if(!pSearchCondition) // no where condition at entry point in disjunctiveNormalForm()
1813 OSQLParseNode::absorptions(pSearchCondition); in disjunctiveNormalForm()
1815 if (SQL_ISRULE(pSearchCondition,boolean_primary)) in disjunctiveNormalForm()
1817 OSQLParseNode* pLeft = pSearchCondition->getChild(1); in disjunctiveNormalForm()
1821 else if (SQL_ISRULE(pSearchCondition,search_condition)) in disjunctiveNormalForm()
1823 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in disjunctiveNormalForm()
1826 OSQLParseNode* pRight = pSearchCondition->getChild(2); in disjunctiveNormalForm()
1830 else if (SQL_ISRULE(pSearchCondition,boolean_term)) in disjunctiveNormalForm()
1832 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in disjunctiveNormalForm()
1835 OSQLParseNode* pRight = pSearchCondition->getChild(2); in disjunctiveNormalForm()
1848 pSearchCondition->removeAt(2); in disjunctiveNormalForm()
1854 replaceAndReset(pSearchCondition,pNewNode); in disjunctiveNormalForm()
1856 disjunctiveNormalForm(pSearchCondition); in disjunctiveNormalForm()
1867 pSearchCondition->removeAt((sal_uInt32)0); in disjunctiveNormalForm()
1874 replaceAndReset(pSearchCondition,pNewNode); in disjunctiveNormalForm()
1875 disjunctiveNormalForm(pSearchCondition); in disjunctiveNormalForm()
1878 pSearchCondition->replace(pLeft, pLeft->removeAt(1)); in disjunctiveNormalForm()
1880 pSearchCondition->replace(pRight, pRight->removeAt(1)); in disjunctiveNormalForm()
1884 void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_Bool bNegate) in negateSearchCondition() argument
1887 if(!pSearchCondition) // no where condition at entry point in negateSearchCondition()
1890 if (pSearchCondition->count() == 3 && SQL_ISRULE(pSearchCondition,boolean_primary)) in negateSearchCondition()
1892 OSQLParseNode* pRight = pSearchCondition->getChild(1); in negateSearchCondition()
1896 else if (SQL_ISRULE(pSearchCondition,search_condition)) in negateSearchCondition()
1898 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in negateSearchCondition()
1899 OSQLParseNode* pRight = pSearchCondition->getChild(2); in negateSearchCondition()
1903 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0)); in negateSearchCondition()
1905 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1)); in negateSearchCondition()
1906 replaceAndReset(pSearchCondition,pNewNode); in negateSearchCondition()
1916 else if (SQL_ISRULE(pSearchCondition,boolean_term)) in negateSearchCondition()
1918 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in negateSearchCondition()
1919 OSQLParseNode* pRight = pSearchCondition->getChild(2); in negateSearchCondition()
1923 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0)); in negateSearchCondition()
1925 pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1)); in negateSearchCondition()
1926 replaceAndReset(pSearchCondition,pNewNode); in negateSearchCondition()
1936 else if (SQL_ISRULE(pSearchCondition,boolean_factor)) in negateSearchCondition()
1938 OSQLParseNode *pNot = pSearchCondition->removeAt((sal_uInt32)0); in negateSearchCondition()
1940 OSQLParseNode *pBooleanTest = pSearchCondition->removeAt((sal_uInt32)0); in negateSearchCondition()
1942 replaceAndReset(pSearchCondition,pBooleanTest); in negateSearchCondition()
1945 negateSearchCondition(pSearchCondition,sal_True); // negate all deeper values in negateSearchCondition()
1949 …else if(bNegate && (SQL_ISRULE(pSearchCondition,comparison_predicate) || SQL_ISRULE(pSearchConditi… in negateSearchCondition()
1951 OSQLParseNode* pComparison = pSearchCondition->getChild(1); in negateSearchCondition()
1977 pSearchCondition->replace(pComparison, pNewComparison); in negateSearchCondition()
1981 …else if(bNegate && (SQL_ISRULE(pSearchCondition,test_for_null) || SQL_ISRULE(pSearchCondition,in_p… in negateSearchCondition()
1982 … SQL_ISRULE(pSearchCondition,between_predicate) || SQL_ISRULE(pSearchCondition,boolean_test) )) in negateSearchCondition()
1984 OSQLParseNode* pPart2 = pSearchCondition; in negateSearchCondition()
1985 if ( !SQL_ISRULE(pSearchCondition,boolean_test) ) in negateSearchCondition()
1986 pPart2 = pSearchCondition->getChild(1); in negateSearchCondition()
1988 if ( SQL_ISRULE( pSearchCondition, test_for_null ) ) in negateSearchCondition()
1990 else if ( SQL_ISRULE( pSearchCondition, boolean_test ) ) in negateSearchCondition()
2002 else if(bNegate && (SQL_ISRULE(pSearchCondition,like_predicate))) in negateSearchCondition()
2004 OSQLParseNode* pNot = pSearchCondition->getChild( 1 )->getChild( 0 ); in negateSearchCondition()
2010 pSearchCondition->getChild( 1 )->replace(pNot, pNotNot); in negateSearchCondition()
2015 void OSQLParseNode::eraseBraces(OSQLParseNode*& pSearchCondition) in eraseBraces() argument
2018 …if (pSearchCondition && (SQL_ISRULE(pSearchCondition,boolean_primary) || (pSearchCondition->count(… in eraseBraces()
2019 SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")")))) in eraseBraces()
2021 OSQLParseNode* pRight = pSearchCondition->getChild(1); in eraseBraces()
2024 …if(!(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || SQL_ISRULE(pSearchCondition->getChi… in eraseBraces()
2025 … SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || // and can always stand without () in eraseBraces()
2026 …(SQL_ISRULE(pSearchCondition->getChild(1),search_condition) && SQL_ISRULE(pSearchCondition->getPar… in eraseBraces()
2028 OSQLParseNode* pNode = pSearchCondition->removeAt(1); in eraseBraces()
2029 replaceAndReset(pSearchCondition,pNode); in eraseBraces()
2034 void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition) in absorptions() argument
2037 if(!pSearchCondition) // no where condition at entry point in absorptions()
2040 eraseBraces(pSearchCondition); in absorptions()
2042 if(SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition)) in absorptions()
2044 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in absorptions()
2046 OSQLParseNode* pRight = pSearchCondition->getChild(2); in absorptions()
2053 if(( SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition)) in absorptions()
2054 && *pSearchCondition->getChild(0) == *pSearchCondition->getChild(2)) in absorptions()
2056 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2057 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2061 else if ( SQL_ISRULE(pSearchCondition,boolean_term) in absorptions()
2063 ( SQL_ISRULE(pSearchCondition->getChild(nPos = 0),boolean_primary) in absorptions()
2064 || SQL_ISRULE(pSearchCondition->getChild(nPos),search_condition) in absorptions()
2066 || ( SQL_ISRULE(pSearchCondition->getChild(nPos = 2),boolean_primary) in absorptions()
2067 || SQL_ISRULE(pSearchCondition->getChild(nPos),search_condition) in absorptions()
2072 OSQLParseNode* p2ndSearch = pSearchCondition->getChild(nPos); in absorptions()
2076 …if ( *p2ndSearch->getChild(0) == *pSearchCondition->getChild(2-nPos) ) // a and ( a or b) -> a or b in absorptions()
2078 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2079 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2082 …else if ( *p2ndSearch->getChild(2) == *pSearchCondition->getChild(2-nPos) ) // a and ( b or a) -> … in absorptions()
2084 pNewNode = pSearchCondition->removeAt((sal_uInt32)2); in absorptions()
2085 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2093 OSQLParseNode* pA = pSearchCondition->removeAt((sal_uInt32)2-nPos); in absorptions()
2104 replaceAndReset(pSearchCondition,pNode); in absorptions()
2108 …else if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(2),… in absorptions()
2110 if(*pSearchCondition->getChild(2)->getChild(0) == *pSearchCondition->getChild(0)) in absorptions()
2112 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2113 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2115 else if(*pSearchCondition->getChild(2)->getChild(2) == *pSearchCondition->getChild(0)) in absorptions()
2117 pNewNode = pSearchCondition->removeAt((sal_uInt32)0); in absorptions()
2118 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2122 …else if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(0),… in absorptions()
2124 if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)) in absorptions()
2126 pNewNode = pSearchCondition->removeAt((sal_uInt32)2); in absorptions()
2127 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2129 else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)) in absorptions()
2131 pNewNode = pSearchCondition->removeAt((sal_uInt32)2); in absorptions()
2132 replaceAndReset(pSearchCondition,pNewNode); in absorptions()
2135 eraseBraces(pSearchCondition); in absorptions()
2138 void OSQLParseNode::compress(OSQLParseNode *&pSearchCondition) in compress() argument
2141 if(!pSearchCondition) // no where condition at entry point in compress()
2144 OSQLParseNode::eraseBraces(pSearchCondition); in compress()
2146 if(SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition)) in compress()
2148 OSQLParseNode* pLeft = pSearchCondition->getChild(0); in compress()
2151 OSQLParseNode* pRight = pSearchCondition->getChild(2); in compress()
2154 …else if( SQL_ISRULE(pSearchCondition,boolean_primary) || (pSearchCondition->count() == 3 && SQL_IS… in compress()
2155 SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")"))) in compress()
2157 OSQLParseNode* pRight = pSearchCondition->getChild(1); in compress()
2160 …if(!(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || SQL_ISRULE(pSearchCondition->getChi… in compress()
2161 …(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) && SQL_ISRULE(pSearchCondition->getParent(… in compress()
2162 …(SQL_ISRULE(pSearchCondition->getChild(1),search_condition) && SQL_ISRULE(pSearchCondition->getPar… in compress()
2164 OSQLParseNode* pNode = pSearchCondition->removeAt(1); in compress()
2165 replaceAndReset(pSearchCondition,pNode); in compress()
2170 …if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(0),boole… in compress()
2172 … if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)->getChild(0)) in compress()
2174 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt(2); in compress()
2175 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt(2); in compress()
2186 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt((sal_uInt32)0),pNewRule); in compress()
2187 replaceAndReset(pSearchCondition,pNode); in compress()
2189 …else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)->getChild(0)) in compress()
2191 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt((sal_uInt32)0); in compress()
2192 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt(2); in compress()
2203 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt(1),pNewRule); in compress()
2204 replaceAndReset(pSearchCondition,pNode); in compress()
2206 …else if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)->getChild(2)) in compress()
2208 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt(2); in compress()
2209 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt((sal_uInt32)0); in compress()
2220 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt((sal_uInt32)0),pNewRule); in compress()
2221 replaceAndReset(pSearchCondition,pNode); in compress()
2223 …else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)->getChild(2)) in compress()
2225 OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt((sal_uInt32)0); in compress()
2226 OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt((sal_uInt32)0); in compress()
2237 pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt(1),pNewRule); in compress()
2238 replaceAndReset(pSearchCondition,pNode); in compress()