[Libreoffice-commits] core.git: dbaccess/source

Caolán McNamara caolanm at redhat.com
Thu Apr 12 15:34:28 UTC 2018


 dbaccess/source/ui/querydesign/querycontroller.cxx |  119 ---------------------
 1 file changed, 119 deletions(-)

New commits:
commit 46cefbcae75947bf78cd3c3f1ed7e6e975ad9f93
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 12 09:33:52 2018 +0100

    ditch debugging code
    
    Change-Id: I45d8a3416aab1da0f084bbbfacf2cbc84bab4922
    Reviewed-on: https://gerrit.libreoffice.org/52764
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 0e02efe02a2a..f60e1a76f7b7 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -139,75 +139,6 @@ extern "C" void createRegistryInfo_OViewControl()
 namespace dbaui
 {
     using namespace ::connectivity;
-#if OSL_DEBUG_LEVEL > 0
-    namespace
-    {
-        void insertParseTree(SvTreeListBox* _pBox, ::connectivity::OSQLParseNode const * _pNode,SvTreeListEntry* _pParent = nullptr)
-        {
-            OUString rString;
-            if (!_pNode->isToken())
-            {
-                // rule name as rule: ...
-                rString = "RULE_ID: " + OUString::number( static_cast<sal_Int32>(_pNode->getRuleID()) ) +
-                          "(" + OSQLParser::RuleIDToStr(_pNode->getRuleID()) + ")";
-
-                _pParent = _pBox->InsertEntry(rString,_pParent);
-
-                // determine how much subtrees this node has
-                sal_uInt32 nStop = _pNode->count();
-                // fetch first subtree
-                for(sal_uInt32 i=0;i<nStop;++i)
-                    insertParseTree(_pBox,_pNode->getChild(i),_pParent);
-            }
-            else
-            {
-                // token found
-                // tabs to insert according to nLevel
-
-                switch (_pNode->getNodeType())
-                {
-
-                case SQLNodeType::Keyword:
-                    {
-                        rString += "SQL_KEYWORD:";
-                        OString sT = OSQLParser::TokenIDToStr(_pNode->getTokenID());
-                        rString += OStringToOUString(sT, RTL_TEXTENCODING_UTF8);
-                     break;}
-
-                case SQLNodeType::Name:
-                    {
-                        rString += "SQL_NAME:\"" + _pNode->getTokenValue() + "\"";
-                        break;}
-
-                case SQLNodeType::String:
-                    {
-                        rString += "SQL_STRING:'" + _pNode->getTokenValue();
-                        break;}
-
-                case SQLNodeType::IntNum:
-                    {
-                        rString += "SQL_INTNUM:" + _pNode->getTokenValue();
-                        break;}
-
-                case SQLNodeType::ApproxNum:
-                    {
-                        rString += "SQL_APPROXNUM:" + _pNode->getTokenValue();
-                        break;}
-
-                case SQLNodeType::Punctuation:
-                    {
-                        rString += "SQL_PUNCTUATION:" + _pNode->getTokenValue(); // append Nodevalue
-                        break;}
-
-                default:
-                    OSL_FAIL("OSQLParser::ShowParseTree: unzulaessiger NodeType");
-                    rString += _pNode->getTokenValue();
-                }
-                _pBox->InsertEntry(rString,_pParent);
-            }
-        }
-    }
-#endif // OSL_DEBUG_LEVEL
 
     namespace
     {
@@ -711,56 +642,6 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
             {
             }
             break;
-#if OSL_DEBUG_LEVEL > 0
-        case ID_EDIT_QUERY_DESIGN:
-        case ID_EDIT_QUERY_SQL:
-            {
-                OUString aErrorMsg;
-                setStatement_fireEvent( getContainer()->getStatement() );
-                ::connectivity::OSQLParseNode* pNode = m_aSqlParser.parseTree( aErrorMsg, m_sStatement, m_bGraphicalDesign );
-                if ( pNode )
-                {
-                    vcl::Window* pView = getView();
-                    ScopedVclPtrInstance<ModalDialog> pWindow( pView, WB_STDMODAL | WB_SIZEMOVE | WB_CENTER );
-                    pWindow->SetSizePixel( ::Size( pView->GetSizePixel().Width() / 2, pView->GetSizePixel().Height() / 2 ) );
-                    ScopedVclPtrInstance<SvTreeListBox> pTreeBox( pWindow, WB_BORDER | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_VSCROLL );
-                    pTreeBox->SetPosSizePixel( ::Point( 6, 6 ), ::Size( pWindow->GetSizePixel().Width() - 12, pWindow->GetSizePixel().Height() - 12 ));
-                    pTreeBox->SetNodeDefaultImages();
-
-                    if ( _nId == ID_EDIT_QUERY_DESIGN )
-                    {
-                        ::connectivity::OSQLParseNode* pTemp = pNode ? pNode->getChild(3)->getChild(1) : nullptr;
-                        // 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);
-                                OSQLParseNode::compress(pNodeTmp);
-                            }
-                            OUString sTemp;
-                            pNode->parseNodeToStr(sTemp,getConnection());
-                            getContainer()->setStatement(sTemp);
-                        }
-                    }
-
-                    insertParseTree(pTreeBox,pNode);
-
-                    pTreeBox->Show();
-                    pWindow->Execute();
-
-                    delete pNode;
-                }
-                break;
-            }
-#endif
         default:
             OJoinController::Execute(_nId,aArgs);
             return; // else we would invalidate twice


More information about the Libreoffice-commits mailing list