Tag: cws_dev300_dba30d User: oj Date: 2008-05-29 15:13:44+0000 Modified: dba/dbaccess/source/ui/inc/JoinTableView.hxx dba/dbaccess/source/ui/inc/QueryTableView.hxx dba/dbaccess/source/ui/inc/RelationTableView.hxx dba/dbaccess/source/ui/querydesign/JoinTableView.cxx dba/dbaccess/source/ui/querydesign/QueryTableView.cxx dba/dbaccess/source/ui/relationdesign/RelationTableView.cxx
Log: #i86168# delete connections File Changes: Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: JoinTableView.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/JoinTableView.hxx?r1=1.26&r2=1.26.30.1 Delta lines: +3 -3 ------------------- --- JoinTableView.hxx 2008-04-10 15:11:09+0000 1.26 +++ JoinTableView.hxx 2008-05-29 15:13:41+0000 1.26.30.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: JoinTableView.hxx,v $ - * $Revision: 1.26 $ + * $Revision: 1.26.30.1 $ * * This file is part of OpenOffice.org. * @@ -170,7 +170,7 @@ @return an iterator to next valid connection, so it can be used in any loop */ - virtual ::std::vector<OTableConnection*>::const_iterator RemoveConnection(OTableConnection* _pConnection,sal_Bool _bDelete); + virtual bool RemoveConnection(OTableConnection* _pConnection,sal_Bool _bDelete); /** allows to add new connections to join table view, it implies an invalidation of the features ID_BROWSER_ADDTABLE and SID_RELATION_ADD_RELATION also the modified flag will be set to true File [changed]: QueryTableView.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/QueryTableView.hxx?r1=1.18&r2=1.18.30.1 Delta lines: +3 -3 ------------------- --- QueryTableView.hxx 2008-04-10 15:12:04+0000 1.18 +++ QueryTableView.hxx 2008-05-29 15:13:41+0000 1.18.30.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: QueryTableView.hxx,v $ - * $Revision: 1.18 $ + * $Revision: 1.18.30.1 $ * * This file is part of OpenOffice.org. * @@ -92,7 +92,7 @@ // Basisklasse ueberschrieben : Connections kreieren und loeschen virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest); - virtual ::std::vector<OTableConnection*>::const_iterator RemoveConnection( OTableConnection* _pConn ,sal_Bool _bDelete); + virtual bool RemoveConnection( OTableConnection* _pConn ,sal_Bool _bDelete); // Transfer von Connections von/zu einer UndoAction void GetConnection(OQueryTableConnection* pConn); File [changed]: RelationTableView.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/RelationTableView.hxx?r1=1.10&r2=1.10.30.1 Delta lines: +3 -3 ------------------- --- RelationTableView.hxx 2008-04-10 15:14:51+0000 1.10 +++ RelationTableView.hxx 2008-05-29 15:13:41+0000 1.10.30.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RelationTableView.hxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.30.1 $ * * This file is part of OpenOffice.org. * @@ -57,7 +57,7 @@ virtual void RemoveTabWin( OTableWindow* pTabWin ); virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest); - virtual ::std::vector<OTableConnection*>::const_iterator RemoveConnection(OTableConnection* pConn,sal_Bool _bDelete); + virtual bool RemoveConnection(OTableConnection* pConn,sal_Bool _bDelete); virtual void ReSync(); Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: JoinTableView.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/JoinTableView.cxx?r1=1.59.30.1&r2=1.59.30.2 Delta lines: +37 -33 --------------------- --- JoinTableView.cxx 2008-05-29 11:30:21+0000 1.59.30.1 +++ JoinTableView.cxx 2008-05-29 15:13:41+0000 1.59.30.2 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: JoinTableView.cxx,v $ - * $Revision: 1.59.30.1 $ + * $Revision: 1.59.30.2 $ * * This file is part of OpenOffice.org. * @@ -306,7 +306,7 @@ } //------------------------------------------------------------------------------ -::std::vector<OTableConnection*>::const_iterator OJoinTableView::RemoveConnection( OTableConnection* _pConn,sal_Bool _bDelete ) +bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,sal_Bool _bDelete ) { DBG_CHKTHIS(OJoinTableView,NULL); DeselectConn(_pConn); @@ -316,7 +316,7 @@ m_pView->getController().removeConnectionData( _pConn->GetData() ); - ::std::vector<OTableConnection*>::const_iterator aNextPos = m_vTableConnection.erase( + m_vTableConnection.erase( ::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),_pConn) ); modified(); @@ -329,7 +329,7 @@ delete _pConn; } - return aNextPos; + return true; } //------------------------------------------------------------------------ @@ -418,19 +418,23 @@ DBG_CHKTHIS(OJoinTableView,NULL); ////////////////////////////////////////////////////////////////////// // first delete all connections of this window to others - BOOL bRemove = TRUE; - + bool bRemove = true; TTableWindowData::value_type pData = pTabWin->GetData(); sal_Int32 nCount = m_vTableConnection.size(); ::std::vector<OTableConnection*>::reverse_iterator aIter = m_vTableConnection.rbegin(); - for(;aIter != m_vTableConnection.rend() && bRemove;++aIter) + while(aIter != m_vTableConnection.rend() && bRemove) { OTableConnection* pTabConn = (*aIter); if( ( pData == pTabConn->GetData()->getReferencingTable()) || ( pData == pTabConn->GetData()->getReferencedTable()) ) - bRemove = RemoveConnection( pTabConn ,sal_True) != m_vTableConnection.end(); // every remove must work + { + bRemove = RemoveConnection( pTabConn ,sal_True); + aIter = m_vTableConnection.rbegin(); + } + else + ++aIter; } ////////////////////////////////////////////////////////////////////// @@ -443,11 +447,11 @@ ); pTabWin->Hide(); - TTableWindowData::iterator aFind = ::std::find(m_pView->getController().getTableWindowData()->begin(),m_pView->getController().getTableWindowData()->end(),pData); - if(aFind != m_pView->getController().getTableWindowData()->end()) + TTableWindowData::iterator aFind = ::std::find(m_pView->getController()->getTableWindowData()->begin(),m_pView->getController()->getTableWindowData()->end(),pData); + if(aFind != m_pView->getController()->getTableWindowData()->end()) { - m_pView->getController().getTableWindowData()->erase(aFind); - m_pView->getController().setModified(sal_True); + m_pView->getController()->getTableWindowData()->erase(aFind); + m_pView->getController()->setModified(sal_True); } String aWinName = pTabWin->GetWinName(); @@ -461,9 +465,9 @@ pTabWin->clearListBox(); delete pTabWin; - } - if ( bRemove && (sal_Int32)m_aTableMap.size() < (nCount-1) ) // if some connections could be removed + } + if ( (sal_Int32)m_vTableConnection.size() < (nCount-1) ) // if some connections could be removed modified(); } namespace File [changed]: QueryTableView.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/QueryTableView.cxx?r1=1.43.30.1&r2=1.43.30.2 Delta lines: +6 -5 ------------------- --- QueryTableView.cxx 2008-05-29 11:30:21+0000 1.43.30.1 +++ QueryTableView.cxx 2008-05-29 15:13:41+0000 1.43.30.2 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: QueryTableView.cxx,v $ - * $Revision: 1.43.30.1 $ + * $Revision: 1.43.30.2 $ * * This file is part of OpenOffice.org. * @@ -796,19 +796,19 @@ } } //------------------------------------------------------------------------------ -::std::vector<OTableConnection*>::const_iterator OQueryTableView::RemoveConnection( OTableConnection* _pConnection,sal_Bool /*_bDelete*/ ) +bool OQueryTableView::RemoveConnection( OTableConnection* _pConnection,sal_Bool /*_bDelete*/ ) { DBG_CHKTHIS(OQueryTableView,NULL); // we don't want that our connection will be deleted, we put it in the undo manager - ::std::vector<OTableConnection*>::const_iterator aNextPos = OJoinTableView::RemoveConnection( _pConnection,sal_False); + bool bRet = OJoinTableView::RemoveConnection( _pConnection,sal_False); // add undo action addUndoAction( this, new OQueryDelTabConnUndoAction(this), static_cast< OQueryTableConnection*>(_pConnection), sal_True); - return aNextPos; + return bRet; } //------------------------------------------------------------------------------ @@ -964,7 +964,8 @@ // call base class because we append an undo action // but this time we are in a undo action list - aIter2 = OJoinTableView::RemoveConnection(pTmpEntry,sal_False); + OJoinTableView::RemoveConnection(pTmpEntry,sal_False); + aIter2 = pTabConList->begin(); ++nCnt; } else Directory: /dba/dbaccess/source/ui/relationdesign/ ================================================== File [changed]: RelationTableView.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/relationdesign/RelationTableView.cxx?r1=1.28.30.1&r2=1.28.30.2 Delta lines: +4 -5 ------------------- --- RelationTableView.cxx 2008-05-29 11:27:02+0000 1.28.30.1 +++ RelationTableView.cxx 2008-05-29 15:13:41+0000 1.28.30.2 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RelationTableView.cxx,v $ - * $Revision: 1.28.30.1 $ + * $Revision: 1.28.30.2 $ * * This file is part of OpenOffice.org. * @@ -337,15 +337,14 @@ } //------------------------------------------------------------------------------ -::std::vector<OTableConnection*>::const_iterator ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_bDelete*/) +bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_bDelete*/) { DBG_CHKTHIS(ORelationTableView,NULL); - ::std::vector<OTableConnection*>::const_iterator aNextPos = getTableConnections()->end(); ORelationTableConnectionData* pTabConnData = (ORelationTableConnectionData*)pConn->GetData().get(); try { if (pTabConnData->DropRelation()) - aNextPos = OJoinTableView::RemoveConnection( pConn ,sal_True); + return OJoinTableView::RemoveConnection( pConn ,sal_True); } catch(SQLException& e) { @@ -355,7 +354,7 @@ { OSL_ENSURE(0,"ORelationTableView::RemoveConnection: Something other than SQLException occured!"); } - return aNextPos; + return false; } //------------------------------------------------------------------------------ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
