User: kz Date: 2008-06-25 12:55:46+0000 Modified: dba/dbaccess/source/ui/querydesign/querycontroller.cxx
Log: INTEGRATION: CWS dba30d (1.118.10); FILE MERGED 2008/05/29 11:30:22 fs 1.118.10.2: during #i80943#: refactoring: IController now passed around as reference, not as pointer 2008/05/28 19:38:11 fs 1.118.10.1: #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.119 Delta lines: +24 -20 --------------------- --- querycontroller.cxx 2008-05-05 16:06:34+0000 1.118 +++ querycontroller.cxx 2008-06-25 12:55:43+0000 1.119 @@ -957,7 +957,7 @@ { // TODO: we have to check if we should create the text- or the design- view - m_pView = new OQueryContainerWindow(pParent,this,getORB()); + m_pView = new OQueryContainerWindow( pParent, *this, getORB() ); return OJoinController::Construct(pParent); } @@ -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]
