Tag: cws_src680_qiq
User: fs      
Date: 06/05/10 04:08:53

Modified:
 /dba/dbaccess/source/ui/querydesign/
  querycontroller.cxx

Log:
 #i51143# allow for queries in queries

File Changes:

Directory: /dba/dbaccess/source/ui/querydesign/
===============================================

File [changed]: querycontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/querycontroller.cxx?r1=1.103&r2=1.103.4.1
Delta lines:  +82 -73
---------------------
--- querycontroller.cxx 4 May 2006 08:46:35 -0000       1.103
+++ querycontroller.cxx 10 May 2006 11:08:50 -0000      1.103.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: querycontroller.cxx,v $
  *
- *  $Revision: 1.103 $
+ *  $Revision: 1.103.4.1 $
  *
- *  last change: $Author: rt $ $Date: 2006/05/04 08:46:35 $
+ *  last change: $Author: fs $ $Date: 2006/05/10 11:08:50 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -95,6 +95,9 @@
 #ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
 #include <com/sun/star/sdb/CommandType.hpp>
 #endif
+#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#endif
 #ifndef DBAUI_DLGSAVE_HXX
 #include "dlgsave.hxx"
 #endif
@@ -331,6 +334,8 @@
 
        void switchDesignModeImpl(OQueryController* 
_pController,OQueryContainerWindow* _pWindow,sal_Bool& _rbDesign)
        {
+        bool isModified = _pController->isModified();
+
                if ( !_pWindow->switchView() )
                {
                        _rbDesign = !_rbDesign;
@@ -340,6 +345,8 @@
                {
             ensureToolbars( _pController, _pWindow, _rbDesign );
                }
+
+        _pController->setModified( isModified );
        }
 }
 
@@ -559,8 +566,8 @@
                        getContainer()->paste();
                        break;
                case ID_BROWSER_SQL:
-                       if(getContainer()->checkStatement())
-                       {
+                       if ( !getContainer()->checkStatement() )
+                break;
                                try
                                {
                                        ::rtl::OUString aErrorMsg;
@@ -582,9 +589,10 @@
                                                        delete 
m_pSqlIterator->getParseTree();
                                                        
m_pSqlIterator->setParseTree(pNode);
                                                        
m_pSqlIterator->traverseAll();
-                                                       SQLWarning aWarning = 
m_pSqlIterator->getWarning();
-                                                       
if(aWarning.Message.getLength())
-                                                               
showError(SQLExceptionInfo(aWarning));
+                        if ( m_pSqlIterator->hasErrors() )
+                        {
+                            showError( SQLExceptionInfo( 
m_pSqlIterator->getErrors() ) );
+                        }
                                                        else
                                                        {
                                                                const 
OSQLTables& xTabs = m_pSqlIterator->getTables();
@@ -629,7 +637,6 @@
                                        InvalidateFeature(ID_BROWSER_ADDTABLE);
                                        
InvalidateFeature(SID_RELATION_ADD_RELATION);
                                }
-                       }
                        break;
                case SID_BROWSER_CLEAR_QUERY:
                        {
@@ -937,7 +944,7 @@
                        OSL_ENSURE(m_xComposer.is(),"No querycomposer 
available!");
                        Reference<XTablesSupplier> xTablesSup(getConnection(), 
UNO_QUERY);
                        deleteIterator();
-                       m_pSqlIterator = new 
::connectivity::OSQLParseTreeIterator(xTablesSup->getTables(),getMetaData(),NULL,m_pSqlParser);
+                       m_pSqlIterator = new 
::connectivity::OSQLParseTreeIterator( getConnection(), 
xTablesSup->getTables(), NULL, m_pSqlParser );
                }
        }
 }
@@ -1494,8 +1501,6 @@
                                                                                
getMetaData());
                                delete pNode;
                        }
-                       m_xComposer->setQuery(sTranslatedStmt);
-                       sTranslatedStmt = m_xComposer->getComposedQuery();
                }
                catch(SQLException& e)
                {
@@ -1631,10 +1636,14 @@
                                            delete 
m_pSqlIterator->getParseTree();
                                            m_pSqlIterator->setParseTree(pNode);
                                            m_pSqlIterator->traverseAll();
-                                           SQLWarning aWarning = 
m_pSqlIterator->getWarning();
-                                           if(aWarning.Message.getLength())
+                        if ( m_pSqlIterator->hasErrors() )
                                            {
-                                                   
showError(SQLExceptionInfo(aWarning));
+                            SQLContext aErrorContext;
+                            aErrorContext.Message = String( ModuleRes( 
STR_ERROR_PARSING_STATEMENT ) );
+                            aErrorContext.Context = *this;
+                            aErrorContext.Details = String( ModuleRes( 
STR_INFO_OPENING_IN_SQL_VIEW ) );
+                            aErrorContext.NextException <<= 
m_pSqlIterator->getErrors();
+                            showError( aErrorContext );
                                                    m_bDesign = sal_False;
                                            }
                                    }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to