Tag: cws_dev300_dba30d
User: fs      
Date: 2008-05-28 19:38:14+0000
Modified:
   dba/dbaccess/source/ui/querydesign/querycontroller.cxx

Log:
 #i87222# when we edit a view, and cannot parse the statement, don't show an 
error - silently switch to SQL view and Direct SQL

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.118&r2=1.118.10.1
Delta lines:  +25 -21
---------------------
--- querycontroller.cxx 2008-05-05 16:06:34+0000        1.118
+++ querycontroller.cxx 2008-05-28 19:38:11+0000        1.118.10.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: querycontroller.cxx,v $
- * $Revision: 1.118 $
+ * $Revision: 1.118.10.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1596,40 +1596,44 @@
             setQueryComposer();
 
             bool bError( false );
-                   if ( m_bEscapeProcessing )
+
+            if ( !m_pSqlIterator )
                    {
-                           ::rtl::OUString aErrorMsg;
-                           ::connectivity::OSQLParseNode* pNode = 
m_aSqlParser.parseTree(aErrorMsg,m_sStatement,m_bGraphicalDesign);
-                           //  m_pParseNode = pNode;
-                           if(pNode)
+                bError = true;
+            }
+                   else if ( m_bEscapeProcessing )
                            {
-                                   if(m_pSqlIterator)
+                           ::rtl::OUString aErrorMsg;
+                ::std::auto_ptr< ::connectivity::OSQLParseNode > pNode(
+                    m_aSqlParser.parseTree( aErrorMsg, m_sStatement, 
m_bGraphicalDesign ) );
+
+                if ( pNode.get() )
                                    {
                                            delete 
m_pSqlIterator->getParseTree();
-                                           m_pSqlIterator->setParseTree(pNode);
+                                   m_pSqlIterator->setParseTree( 
pNode.release() );
                                            m_pSqlIterator->traverseAll();
                         if ( m_pSqlIterator->hasErrors() )
                         {
+                        if ( !editingView() )
+                        {
                             SQLContext aErrorContext;
                             aErrorContext.Message = 
lcl_getObjectResourceString( STR_ERROR_PARSING_STATEMENT, m_nCommandType );
                             aErrorContext.Context = *this;
                             aErrorContext.Details = 
lcl_getObjectResourceString( STR_INFO_OPENING_IN_SQL_VIEW, m_nCommandType );
                             aErrorContext.NextException <<= 
m_pSqlIterator->getErrors();
                             showError( aErrorContext );
-                                                   bError = true;
                                            }
-                                   }
-                                   else
-                                   {
-                                           delete pNode;
                                            bError = true;
                                    }
                            }
                            else
                            {
+                    if ( !editingView() )
+                    {
                                    String 
aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR));
                                    OSQLMessageBox 
aDlg(getView(),aTitle,aErrorMsg);
                                    aDlg.Execute();
+                    }
                                    bError = true;
                            }
             }




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

Reply via email to