summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2002-12-12 12:44:48 +0000
committerOcke Janssen <oj@openoffice.org>2002-12-12 12:44:48 +0000
commit167b3dbf8d7756705441faa8be21dd9f6afe5c5b (patch)
tree1bf8c5fbd9e3a8003edb255ea1f747aea7f8d7d7 /dbaccess/source
parent0168a5ba4a51a11aa6ddff2a95abdca9b040d1bb (diff)
#i4082# impl debug feature for parse nodes
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/querydesign/query.src11
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx28
2 files changed, 35 insertions, 4 deletions
diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src
index 2a12e9aa9a69..2f6d161a4576 100644
--- a/dbaccess/source/ui/querydesign/query.src
+++ b/dbaccess/source/ui/querydesign/query.src
@@ -2,9 +2,9 @@
*
* $RCSfile: query.src,v $
*
- * $Revision: 1.76 $
+ * $Revision: 1.77 $
*
- * last change: $Author: kz $ $Date: 2002-12-09 11:38:55 $
+ * last change: $Author: oj $ $Date: 2002-12-12 13:44:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1548,6 +1548,13 @@ ToolBox RID_BRW_QUERYDESIGN_TOOLBOX
Text[ catalan ] = "Show Parse Tree";
Text[ thai ] = "Show Parse Tree";
};
+ ToolBoxItem
+ {
+ Identifier = ID_EDIT_QUERY_DESIGN;
+ Text = "Make disjunctive normal form" ;
+ Text[ language_user1 ] = "; EM Oct 2002: Do Not Translate. This is only for the in-house developer \"Debugging\" version of SO.";
+ };
+
#endif
/* ToolBoxItem
{
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 1276160a526b..e3a3893c832f 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: querycontroller.cxx,v $
*
- * $Revision: 1.87 $
+ * $Revision: 1.88 $
*
- * last change: $Author: oj $ $Date: 2002-11-27 09:35:24 $
+ * last change: $Author: oj $ $Date: 2002-12-12 13:44:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -476,6 +476,8 @@ FeatureState OQueryController::GetState(sal_uInt16 _nId) const
#ifdef DEBUG
case ID_EDIT_QUERY_SQL:
break;
+ case ID_EDIT_QUERY_DESIGN:
+ break;
#endif
case ID_BROWSER_ADDTABLE:
if ( !m_bDesign )
@@ -638,6 +640,7 @@ void OQueryController::Execute(sal_uInt16 _nId)
}
break;
#ifdef DEBUG
+ case ID_EDIT_QUERY_DESIGN:
case ID_EDIT_QUERY_SQL:
{
::rtl::OUString aErrorMsg;
@@ -651,6 +654,26 @@ void OQueryController::Execute(sal_uInt16 _nId)
SvTreeListBox* pTreeBox = new SvTreeListBox(pWindow);
pTreeBox->SetPosSizePixel(Point(0,0),pView->GetSizePixel());
+ if ( _nId == ID_EDIT_QUERY_DESIGN )
+ {
+ ::connectivity::OSQLParseNode* pTemp = pNode ? pNode->getChild(3)->getChild(1) : NULL;
+ // no where clause found
+ if ( pTemp && !pTemp->isLeaf() )
+ {
+ ::connectivity::OSQLParseNode * pCondition = pTemp->getChild(1);
+ if ( pCondition ) // no where clause
+ {
+ ::connectivity::OSQLParseNode::negateSearchCondition(pCondition);
+ ::connectivity::OSQLParseNode *pNodeTmp = pTemp->getChild(1);
+
+ ::connectivity::OSQLParseNode::disjunctiveNormalForm(pNodeTmp);
+ pNodeTmp = pTemp->getChild(1);
+ ::connectivity::OSQLParseNode::absorptions(pNodeTmp);
+ pNodeTmp = pTemp->getChild(1);
+ }
+ }
+ }
+
insertParseTree(pTreeBox,pNode);
pTreeBox->Show();
@@ -868,6 +891,7 @@ void OQueryController::AddSupportedFeatures()
m_aSupportedFeatures[ ::rtl::OUString::createFromAscii(".uno:DB/AddRelation")] = ID_RELATION_ADD_RELATION;
#ifdef DEBUG
m_aSupportedFeatures[ ::rtl::OUString::createFromAscii(".uno:DB/ShowParseTree")] = ID_EDIT_QUERY_SQL;
+ m_aSupportedFeatures[ ::rtl::OUString::createFromAscii(".uno:DB/MakeDisjunct")] = ID_EDIT_QUERY_DESIGN;
#endif
}
// -----------------------------------------------------------------------------