From 04341697fbc79fa4c2a07883194ba0929767b9b7 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Wed, 28 Jan 2015 21:09:42 +0100 Subject: not all OrCriteria have three children and some contain a column in the second child Change-Id: Ifd69758336233ed0233120b3315d4f33655fa994 Reviewed-on: https://gerrit.libreoffice.org/14719 Tested-by: David Tardon Reviewed-by: David Tardon (cherry picked from commit 1ce2461ab77f2ad28671ac1542509bbb16a155ef) --- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 880cafcb74e9..7f6a1b117d84 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -1304,9 +1304,11 @@ namespace { bool bRet = true; ::connectivity::OSQLParseNode* pFirstColumnRef = _pFirstColumnRef; - for (int i = 0; i < 3 && bRet; i+=2) + for (size_t i = 0; i < _pCondition->count() && bRet; ++i) { const ::connectivity::OSQLParseNode* pChild = _pCondition->getChild(i); + if ( pChild->isToken() ) + continue; if ( SQL_ISRULE(pChild,search_condition) ) bRet = CheckOrCriteria(pChild,pFirstColumnRef); else -- cgit