summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-06-18 12:14:29 +0200
committerNoel Grandin <noel@peralex.com>2014-06-24 11:34:21 +0200
commite2080e70fe8b085f18e868e46340454720fa94ca (patch)
tree4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /dbaccess/source/ui/querydesign
parentf910280b8704ed9c289150a4ca3c8d60e15d0d97 (diff)
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can be returning a reference. e.g. class A { struct X x; public X* getX() { return &x; } } which can be: public X& getX() { return x; } Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
Diffstat (limited to 'dbaccess/source/ui/querydesign')
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/JAccess.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/JoinDesignView.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx152
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx54
-rw-r--r--dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx224
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx85
-rw-r--r--dbaccess/source/ui/querydesign/TableConnection.cxx18
-rw-r--r--dbaccess/source/ui/querydesign/TableConnectionData.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowAccess.cxx27
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowTitle.cxx6
13 files changed, 282 insertions, 312 deletions
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
index 5506c7fc0fd4..02d1759dceda 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
@@ -81,10 +81,10 @@ namespace dbaui
if( m_pLine )
{
// search the position of our table window in the table window map
- nIndex = m_pLine->GetParent()->GetTabWinMap()->size();
- const ::std::vector<OTableConnection*>* pVec = m_pLine->GetParent()->getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = pVec->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pVec->end();
+ nIndex = m_pLine->GetParent()->GetTabWinMap().size();
+ const ::std::vector<OTableConnection*>& rVec = m_pLine->GetParent()->getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter = rVec.begin();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rVec.end();
for (; aIter != aEnd && (*aIter) != m_pLine; ++nIndex,++aIter)
;
nIndex = ( aIter != aEnd ) ? nIndex : -1;
diff --git a/dbaccess/source/ui/querydesign/JAccess.cxx b/dbaccess/source/ui/querydesign/JAccess.cxx
index 7d0b8adbc10d..717128eb4aeb 100644
--- a/dbaccess/source/ui/querydesign/JAccess.cxx
+++ b/dbaccess/source/ui/querydesign/JAccess.cxx
@@ -58,7 +58,7 @@ namespace dbaui
::osl::MutexGuard aGuard( m_aMutex );
sal_Int32 nChildCount = 0;
if ( m_pTableView )
- nChildCount = m_pTableView->GetTabWinCount() + m_pTableView->getTableConnections()->size();
+ nChildCount = m_pTableView->GetTabWinCount() + m_pTableView->getTableConnections().size();
return nChildCount;
}
Reference< XAccessible > SAL_CALL OJoinDesignViewAccess::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException,RuntimeException, std::exception)
@@ -71,13 +71,13 @@ namespace dbaui
sal_Int32 nTableWindowCount = m_pTableView->GetTabWinCount();
if( i < nTableWindowCount )
{
- OJoinTableView::OTableWindowMap::iterator aIter = m_pTableView->GetTabWinMap()->begin();
+ OJoinTableView::OTableWindowMap::iterator aIter = m_pTableView->GetTabWinMap().begin();
for (sal_Int32 j=i; j; ++aIter,--j)
;
aRet = aIter->second->GetAccessible();
}
- else if( size_t(i - nTableWindowCount) < m_pTableView->getTableConnections()->size() )
- aRet = (*m_pTableView->getTableConnections())[i - nTableWindowCount]->GetAccessible();
+ else if( size_t(i - nTableWindowCount) < m_pTableView->getTableConnections().size() )
+ aRet = m_pTableView->getTableConnections()[i - nTableWindowCount]->GetAccessible();
}
else
throw IndexOutOfBoundsException();
diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
index cfe2d696d8e4..6372e154038c 100644
--- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
@@ -97,7 +97,7 @@ void OJoinDesignView::setReadOnly(sal_Bool /*_bReadOnly*/)
void OJoinDesignView::SaveTabWinUIConfig(OTableWindow* pWin)
{
- getController().SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos());
+ getController().SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar().GetThumbPos(), m_pScrollWindow->GetVScrollBar().GetThumbPos());
}
void OJoinDesignView::KeyInput( const KeyEvent& rEvt )
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index c29d55a393d8..e9d7dc8b392d 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -73,14 +73,14 @@ OScrollWindowHelper::OScrollWindowHelper( Window* pParent) : Window( pParent)
// ScrollBars
- GetHScrollBar()->SetRange( Range(0, 1000) );
- GetVScrollBar()->SetRange( Range(0, 1000) );
+ GetHScrollBar().SetRange( Range(0, 1000) );
+ GetVScrollBar().SetRange( Range(0, 1000) );
- GetHScrollBar()->SetLineSize( LINE_SIZE );
- GetVScrollBar()->SetLineSize( LINE_SIZE );
+ GetHScrollBar().SetLineSize( LINE_SIZE );
+ GetVScrollBar().SetLineSize( LINE_SIZE );
- GetHScrollBar()->Show();
- GetVScrollBar()->Show();
+ GetHScrollBar().Show();
+ GetVScrollBar().Show();
m_pCornerWindow->Show();
// normally we should be SCROLL_PANE
@@ -98,15 +98,15 @@ void OScrollWindowHelper::setTableView(OJoinTableView* _pTableView)
{
m_pTableView = _pTableView;
// ScrollBars
- GetHScrollBar()->SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
- GetVScrollBar()->SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
+ GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
+ GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
}
void OScrollWindowHelper::resetRange(const Point& _aSize)
{
Point aPos = PixelToLogic(_aSize);
- GetHScrollBar()->SetRange( Range(0, aPos.X() + TABWIN_SPACING_X) );
- GetVScrollBar()->SetRange( Range(0, aPos.Y() + TABWIN_SPACING_Y) );
+ GetHScrollBar().SetRange( Range(0, aPos.X() + TABWIN_SPACING_X) );
+ GetVScrollBar().SetRange( Range(0, aPos.Y() + TABWIN_SPACING_Y) );
}
void OScrollWindowHelper::Resize()
@@ -114,15 +114,15 @@ void OScrollWindowHelper::Resize()
Window::Resize();
Size aTotalOutputSize = GetOutputSizePixel();
- long nHScrollHeight = GetHScrollBar()->GetSizePixel().Height();
- long nVScrollWidth = GetVScrollBar()->GetSizePixel().Width();
+ long nHScrollHeight = GetHScrollBar().GetSizePixel().Height();
+ long nVScrollWidth = GetVScrollBar().GetSizePixel().Width();
- GetHScrollBar()->SetPosSizePixel(
+ GetHScrollBar().SetPosSizePixel(
Point( 0, aTotalOutputSize.Height()-nHScrollHeight ),
Size( aTotalOutputSize.Width()-nVScrollWidth, nHScrollHeight )
);
- GetVScrollBar()->SetPosSizePixel(
+ GetVScrollBar().SetPosSizePixel(
Point( aTotalOutputSize.Width()-nVScrollWidth, 0 ),
Size( nVScrollWidth, aTotalOutputSize.Height()-nHScrollHeight )
);
@@ -132,20 +132,20 @@ void OScrollWindowHelper::Resize()
Size( nVScrollWidth, nHScrollHeight )
);
- GetHScrollBar()->SetPageSize( aTotalOutputSize.Width() );
- GetHScrollBar()->SetVisibleSize( aTotalOutputSize.Width() );
+ GetHScrollBar().SetPageSize( aTotalOutputSize.Width() );
+ GetHScrollBar().SetVisibleSize( aTotalOutputSize.Width() );
- GetVScrollBar()->SetPageSize( aTotalOutputSize.Height() );
- GetVScrollBar()->SetVisibleSize( aTotalOutputSize.Height() );
+ GetVScrollBar().SetPageSize( aTotalOutputSize.Height() );
+ GetVScrollBar().SetVisibleSize( aTotalOutputSize.Height() );
// adjust the ranges of the scrollbars if necessary
- long lRange = GetHScrollBar()->GetRange().Max() - GetHScrollBar()->GetRange().Min();
+ long lRange = GetHScrollBar().GetRange().Max() - GetHScrollBar().GetRange().Min();
if (m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() > lRange)
- GetHScrollBar()->SetRangeMax(m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() + GetHScrollBar()->GetRange().Min());
+ GetHScrollBar().SetRangeMax(m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() + GetHScrollBar().GetRange().Min());
- lRange = GetVScrollBar()->GetRange().Max() - GetVScrollBar()->GetRange().Min();
+ lRange = GetVScrollBar().GetRange().Max() - GetVScrollBar().GetRange().Min();
if (m_pTableView->GetScrollOffset().Y() + aTotalOutputSize.Height() > lRange)
- GetVScrollBar()->SetRangeMax(m_pTableView->GetScrollOffset().Y() + aTotalOutputSize.Height() + GetVScrollBar()->GetRange().Min());
+ GetVScrollBar().SetRangeMax(m_pTableView->GetScrollOffset().Y() + aTotalOutputSize.Height() + GetVScrollBar().GetRange().Min());
m_pTableView->SetPosSizePixel(Point( 0, 0 ),Size( aTotalOutputSize.Width()-nVScrollWidth, aTotalOutputSize.Height()-nHScrollHeight ));
}
@@ -186,7 +186,7 @@ OJoinTableView::~OJoinTableView()
IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar )
{
// move all windows
- ScrollPane( pScrollBar->GetDelta(), (pScrollBar == GetHScrollBar()), false );
+ ScrollPane( pScrollBar->GetDelta(), (pScrollBar == &GetHScrollBar()), false );
return 0;
}
@@ -202,8 +202,8 @@ void OJoinTableView::Resize()
return;
// we have at least one table so resize it
- m_aScrollOffset.X() = GetHScrollBar()->GetThumbPos();
- m_aScrollOffset.Y() = GetVScrollBar()->GetThumbPos();
+ m_aScrollOffset.X() = GetHScrollBar().GetThumbPos();
+ m_aScrollOffset.Y() = GetVScrollBar().GetThumbPos();
OTableWindow* pCheck = m_aTableMap.begin()->second;
Point aRealPos = pCheck->GetPosPixel();
@@ -311,7 +311,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r
OTableWindow* pNewTabWin = createWindow( pNewTabWinData );
if ( pNewTabWin->Init() )
{
- m_pView->getController().getTableWindowData()->push_back( pNewTabWinData);
+ m_pView->getController().getTableWindowData().push_back( pNewTabWinData);
// when we already have a table with this name insert the full qualified one instead
if(m_aTableMap.find(rWinName) != m_aTableMap.end())
m_aTableMap[_rComposedName] = pNewTabWin;
@@ -366,10 +366,10 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
pTabWin->Hide();
OJoinController& rController = m_pView->getController();
- TTableWindowData::iterator aFind = ::std::find(rController.getTableWindowData()->begin(),rController.getTableWindowData()->end(),pData);
- if(aFind != rController.getTableWindowData()->end())
+ TTableWindowData::iterator aFind = ::std::find(rController.getTableWindowData().begin(), rController.getTableWindowData().end(), pData);
+ if(aFind != rController.getTableWindowData().end())
{
- rController.getTableWindowData()->erase(aFind);
+ rController.getTableWindowData().erase(aFind);
rController.setModified(sal_True);
}
@@ -395,16 +395,14 @@ namespace
bool isScrollAllowed( OJoinTableView* _pView,long nDelta, bool bHoriz)
{
// adjust ScrollBar-Positions
- ScrollBar* pBar = _pView->GetVScrollBar();
- if( bHoriz )
- pBar = _pView->GetHScrollBar();
+ ScrollBar& rBar = bHoriz ? _pView->GetHScrollBar() : _pView->GetVScrollBar() ;
- long nOldThumbPos = pBar->GetThumbPos();
+ long nOldThumbPos = rBar.GetThumbPos();
long nNewThumbPos = nOldThumbPos + nDelta;
if( nNewThumbPos < 0 )
nNewThumbPos = 0;
- else if( nNewThumbPos > pBar->GetRangeMax() )
- nNewThumbPos = pBar->GetRangeMax();
+ else if( nNewThumbPos > rBar.GetRangeMax() )
+ nNewThumbPos = rBar.GetRangeMax();
if ( bHoriz )
{
@@ -462,12 +460,12 @@ namespace
if ( bVisbile )
{
- sal_Int32 nHRangeMax = _pView->GetHScrollBar()->GetRangeMax();
- sal_Int32 nVRangeMax = _pView->GetVScrollBar()->GetRangeMax();
+ sal_Int32 nHRangeMax = _pView->GetHScrollBar().GetRangeMax();
+ sal_Int32 nVRangeMax = _pView->GetVScrollBar().GetRangeMax();
- if ( aSize.Width() + _pView->GetHScrollBar()->GetThumbPos() + _nScrollX > nHRangeMax )
+ if ( aSize.Width() + _pView->GetHScrollBar().GetThumbPos() + _nScrollX > nHRangeMax )
bVisbile = false;
- if ( bVisbile && aSize.Height() + _pView->GetVScrollBar()->GetThumbPos() + _nScrollY > nVRangeMax )
+ if ( bVisbile && aSize.Height() + _pView->GetVScrollBar().GetThumbPos() + _nScrollY > nVRangeMax )
bVisbile = false;
}
}
@@ -576,10 +574,10 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin )
aBottom.X() += aNewSize.Width();
aBottom.Y() += aNewSize.Height();
- if(!GetHScrollBar()->GetRange().IsInside(aBottom.X()))
- GetHScrollBar()->SetRange( Range(0, aBottom.X()) );
- if(!GetVScrollBar()->GetRange().IsInside(aBottom.Y()))
- GetVScrollBar()->SetRange( Range(0, aBottom.Y()) );
+ if(!GetHScrollBar().GetRange().IsInside(aBottom.X()))
+ GetHScrollBar().SetRange( Range(0, aBottom.X()) );
+ if(!GetVScrollBar().GetRange().IsInside(aBottom.Y()))
+ GetVScrollBar().SetRange( Range(0, aBottom.Y()) );
pTabWin->SetPosSizePixel( aNewPos, aNewSize );
}
@@ -643,50 +641,50 @@ bool OJoinTableView::ScrollPane( long nDelta, bool bHoriz, bool bPaintScrollBars
{
if( bHoriz )
{
- long nOldThumbPos = GetHScrollBar()->GetThumbPos();
+ long nOldThumbPos = GetHScrollBar().GetThumbPos();
long nNewThumbPos = nOldThumbPos + nDelta;
if( nNewThumbPos < 0 )
{
nNewThumbPos = 0;
bRet = false;
}
- if( nNewThumbPos > GetHScrollBar()->GetRange().Max() )
+ if( nNewThumbPos > GetHScrollBar().GetRange().Max() )
{
- nNewThumbPos = GetHScrollBar()->GetRange().Max();
+ nNewThumbPos = GetHScrollBar().GetRange().Max();
bRet = false;
}
- GetHScrollBar()->SetThumbPos( nNewThumbPos );
- nDelta = GetHScrollBar()->GetThumbPos() - nOldThumbPos;
+ GetHScrollBar().SetThumbPos( nNewThumbPos );
+ nDelta = GetHScrollBar().GetThumbPos() - nOldThumbPos;
}
else
{
- long nOldThumbPos = GetVScrollBar()->GetThumbPos();
+ long nOldThumbPos = GetVScrollBar().GetThumbPos();
long nNewThumbPos = nOldThumbPos+nDelta;
if( nNewThumbPos < 0 )
{
nNewThumbPos = 0;
bRet = false;
}
- if( nNewThumbPos > GetVScrollBar()->GetRange().Max() )
+ if( nNewThumbPos > GetVScrollBar().GetRange().Max() )
{
- nNewThumbPos = GetVScrollBar()->GetRange().Max();
+ nNewThumbPos = GetVScrollBar().GetRange().Max();
bRet = false;
}
- GetVScrollBar()->SetThumbPos( nNewThumbPos );
- nDelta = GetVScrollBar()->GetThumbPos() - nOldThumbPos;
+ GetVScrollBar().SetThumbPos( nNewThumbPos );
+ nDelta = GetVScrollBar().GetThumbPos() - nOldThumbPos;
}
}
// If ScrollOffset hitting borders, no redrawing.
- if( (GetHScrollBar()->GetThumbPos()==m_aScrollOffset.X()) &&
- (GetVScrollBar()->GetThumbPos()==m_aScrollOffset.Y()) )
+ if( (GetHScrollBar().GetThumbPos()==m_aScrollOffset.X()) &&
+ (GetVScrollBar().GetThumbPos()==m_aScrollOffset.Y()) )
return false;
// set ScrollOffset anew
if (bHoriz)
- m_aScrollOffset.X() = GetHScrollBar()->GetThumbPos();
+ m_aScrollOffset.X() = GetHScrollBar().GetThumbPos();
else
- m_aScrollOffset.Y() = GetVScrollBar()->GetThumbPos();
+ m_aScrollOffset.Y() = GetVScrollBar().GetThumbPos();
// move all windows
OTableWindow* pTabWin;
@@ -749,7 +747,7 @@ void OJoinTableView::Tracking( const TrackingEvent& rTEvt )
if ( ! (pData && pData->HasPosition() && (pData->GetPosition() == aDragWinPos)))
{
// old logic coordinates
- Point ptOldPos = m_pDragWin->GetPosPixel() + Point(GetHScrollBar()->GetThumbPos(), GetVScrollBar()->GetThumbPos());
+ Point ptOldPos = m_pDragWin->GetPosPixel() + Point(GetHScrollBar().GetThumbPos(), GetVScrollBar().GetThumbPos());
// new positioning
m_pDragWin->SetPosPixel(aDragWinPos);
TabWinMoved(m_pDragWin, ptOldPos);
@@ -894,9 +892,9 @@ void OJoinTableView::SelectConn(OTableConnection* pConn)
SvTreeListEntry* pFirstSourceVisible = pSourceBox->GetFirstEntryInView();
SvTreeListEntry* pFirstDestVisible = pDestBox->GetFirstEntryInView();
- const ::std::vector<OConnectionLine*>* pLines = pConn->GetConnLineList();
- ::std::vector<OConnectionLine*>::const_reverse_iterator aIter = pLines->rbegin();
- for(;aIter != pLines->rend();++aIter)
+ const ::std::vector<OConnectionLine*>& rLines = pConn->GetConnLineList();
+ ::std::vector<OConnectionLine*>::const_reverse_iterator aIter = rLines.rbegin();
+ for(;aIter != rLines.rend();++aIter)
{
if ((*aIter)->IsValid())
{
@@ -1077,7 +1075,7 @@ void OJoinTableView::invalidateAndModify(SfxUndoAction *_pAction)
void OJoinTableView::TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPosition)
{
- Point ptThumbPos(GetHScrollBar()->GetThumbPos(), GetVScrollBar()->GetThumbPos());
+ Point ptThumbPos(GetHScrollBar().GetThumbPos(), GetVScrollBar().GetThumbPos());
ptWhich->GetData()->SetPosition(ptWhich->GetPosPixel() + ptThumbPos);
invalidateAndModify(new OJoinMoveTabWinUndoAct(this, ptOldPosition, ptWhich));
@@ -1150,9 +1148,9 @@ void OJoinTableView::Command(const CommandEvent& rEvt)
{
if( pSelConnection )
{
- const ::std::vector<OConnectionLine*>* pLines = pSelConnection->GetConnLineList();
- ::std::vector<OConnectionLine*>::const_iterator aIter = ::std::find_if(pLines->begin(),pLines->end(),::std::mem_fun(&OConnectionLine::IsValid));
- if( aIter != pLines->end() )
+ const ::std::vector<OConnectionLine*>& rLines = pSelConnection->GetConnLineList();
+ ::std::vector<OConnectionLine*>::const_iterator aIter = ::std::find_if(rLines.begin(), rLines.end(),::std::mem_fun(&OConnectionLine::IsValid));
+ if( aIter != rLines.end() )
executePopup((*aIter)->getMidPoint(),pSelConnection);
}
}
@@ -1475,16 +1473,14 @@ void OJoinTableView::HideTabWins()
{
SetUpdateMode(false);
- OTableWindowMap* pTabWins = GetTabWinMap();
- if ( pTabWins )
- {
- // working on a copy because the real list will be cleared in inner calls
- OTableWindowMap aCopy(*pTabWins);
- OTableWindowMap::iterator aIter = aCopy.begin();
- OTableWindowMap::iterator aEnd = aCopy.end();
- for(;aIter != aEnd;++aIter)
- RemoveTabWin(aIter->second);
- }
+ OTableWindowMap& rTabWins = GetTabWinMap();
+
+ // working on a copy because the real list will be cleared in inner calls
+ OTableWindowMap aCopy(rTabWins);
+ OTableWindowMap::iterator aIter = aCopy.begin();
+ OTableWindowMap::iterator aEnd = aCopy.end();
+ for(;aIter != aEnd;++aIter)
+ RemoveTabWin(aIter->second);
m_pView->getController().setModified(sal_True);
@@ -1571,10 +1567,10 @@ void OJoinTableView::addConnection(OTableConnection* _pConnection,bool _bAddData
if ( _bAddData )
{
#if OSL_DEBUG_LEVEL > 0
- TTableConnectionData* pTabConnDataList = m_pView->getController().getTableConnectionData();
- OSL_ENSURE( ::std::find(pTabConnDataList->begin(),pTabConnDataList->end(),_pConnection->GetData()) == pTabConnDataList->end(),"Data already in vector!");
+ TTableConnectionData& rTabConnDataList = m_pView->getController().getTableConnectionData();
+ OSL_ENSURE( ::std::find(rTabConnDataList.begin(), rTabConnDataList.end(),_pConnection->GetData()) == rTabConnDataList.end(),"Data already in vector!");
#endif
- m_pView->getController().getTableConnectionData()->push_back(_pConnection->GetData());
+ m_pView->getController().getTableConnectionData().push_back(_pConnection->GetData());
}
m_vTableConnection.push_back(_pConnection);
_pConnection->RecalcLines();
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index c515159faaa3..213fc3e4710d 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -339,7 +339,7 @@ namespace
bBrace = true;
_rJoin = _rJoin.replaceAt(_rJoin.getLength()-1,1,OUString(' '));
}
- (_rJoin += C_AND) += BuildJoinCriteria(_xConnection,pData->GetConnLineDataList(),pData);
+ (_rJoin += C_AND) += BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
if(bBrace)
_rJoin += ")";
_pEntryConn->SetVisited(true);
@@ -413,7 +413,7 @@ namespace
if ( CROSS_JOIN != pData->GetJoinType() && !pData->isNatural() )
{
aErg += " ON ";
- aErg += BuildJoinCriteria(_xConnection,pData->GetConnLineDataList(),pData);
+ aErg += BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
}
return aErg;
@@ -508,9 +508,9 @@ namespace
pEntryConn->SetVisited(true);
// first search for the "to" window
- const ::std::vector<OTableConnection*>* pConnections = pEntryConn->GetParent()->getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = pConnections->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pConnections->end();
+ const ::std::vector<OTableConnection*>& rConnections = pEntryConn->GetParent()->getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter = rConnections.begin();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end();
for(;aIter != aEnd;++aIter)
{
OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter);
@@ -528,7 +528,7 @@ namespace
if(aIter == aEnd)
{
OQueryTableWindow* pEntryTabFrom = static_cast<OQueryTableWindow*>(pEntryConn->GetSourceWin());
- aIter = pConnections->begin();
+ aIter = rConnections.begin();
for(;aIter != aEnd;++aIter)
{
OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter);
@@ -636,7 +636,7 @@ namespace
const Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData();
const OUString aQuote = xMetaData->getIdentifierQuoteString();
- OJoinTableView::OTableWindowMap* pTabList = _pView->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap& rTabList = _pView->getTableView()->GetTabWinMap();
const static OUString sFieldSeparator(", ");
const static OUString s_sAs(" AS ");
@@ -660,8 +660,8 @@ namespace
{
// we have to look if we have alias.* here but before we have to check if the column doesn't already exist
OTableFieldDescRef aInfo = new OTableFieldDesc();
- OJoinTableView::OTableWindowMap::iterator tableIter = pTabList->begin();
- OJoinTableView::OTableWindowMap::iterator tableEnd = pTabList->end();
+ OJoinTableView::OTableWindowMap::iterator tableIter = rTabList.begin();
+ OJoinTableView::OTableWindowMap::iterator tableEnd = rTabList.end();
bool bFound = false;
for(;!bFound && tableIter != tableEnd ;++tableIter)
{
@@ -995,7 +995,7 @@ namespace
{
if(!_rJoinCrit.isEmpty())
_rJoinCrit += C_AND;
- _rJoinCrit += BuildJoinCriteria(_xConnection,pEntryConnData->GetConnLineDataList(),pEntryConnData);
+ _rJoinCrit += BuildJoinCriteria(_xConnection,&pEntryConnData->GetConnLineDataList(),pEntryConnData);
}
}
}
@@ -1532,9 +1532,9 @@ namespace
OSQLParseNode* pParamNode = pFunction->getChild(pFunction->count()-2);
if ( pParamNode && pParamNode->getTokenValue().toChar() == '*' )
{
- OJoinTableView::OTableWindowMap* pTabList = _pView->getTableView()->GetTabWinMap();
- OJoinTableView::OTableWindowMap::iterator aIter = pTabList->begin();
- OJoinTableView::OTableWindowMap::iterator aTabEnd = pTabList->end();
+ OJoinTableView::OTableWindowMap& rTabList = _pView->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabList.begin();
+ OJoinTableView::OTableWindowMap::iterator aTabEnd = rTabList.end();
for(;aIter != aTabEnd;++aIter)
{
OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second);
@@ -1606,9 +1606,9 @@ namespace
true));
if ( pConn )
{
- OConnectionLineDataVec* pLineDataList = pConn->GetData()->GetConnLineDataList();
- OConnectionLineDataVec::iterator aIter = pLineDataList->begin();
- OConnectionLineDataVec::iterator aEnd = pLineDataList->end();
+ OConnectionLineDataVec& rLineDataList = pConn->GetData()->GetConnLineDataList();
+ OConnectionLineDataVec::iterator aIter = rLineDataList.begin();
+ OConnectionLineDataVec::iterator aEnd = rLineDataList.end();
for(;aIter != aEnd;++aIter)
{
if((*aIter)->GetSourceFieldName() == aDragLeft->GetField() ||
@@ -2022,7 +2022,7 @@ namespace
}
// now delete the data for which we haven't any tablewindow
- OJoinTableView::OTableWindowMap aTableMap(*pTableView->GetTabWinMap());
+ OJoinTableView::OTableWindowMap aTableMap(pTableView->GetTabWinMap());
OJoinTableView::OTableWindowMap::iterator aIterTableMap = aTableMap.begin();
OJoinTableView::OTableWindowMap::iterator aIterTableEnd = aTableMap.end();
for(;aIterTableMap != aIterTableEnd;++aIterTableMap)
@@ -2056,7 +2056,7 @@ namespace
rController.setLimit(-1);
}
- if ( (eErrorCode = InstallFields(_pView,pParseTree, pTableView->GetTabWinMap())) == eOk )
+ if ( (eErrorCode = InstallFields(_pView, pParseTree, &pTableView->GetTabWinMap())) == eOk )
{
// GetSelectionCriteria must be called before GetHavingCriteria
sal_uInt16 nLevel=0;
@@ -2735,11 +2735,11 @@ void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFi
bool bAllTables = sAliasName.isEmpty();
- OJoinTableView::OTableWindowMap* pTabWins = m_pTableView->GetTabWinMap();
+ OJoinTableView::OTableWindowMap& rTabWins = m_pTableView->GetTabWinMap();
OUString strCurrentPrefix;
::std::vector< OUString> aFields;
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWins->begin();
- OJoinTableView::OTableWindowMap::iterator aEnd = pTabWins->end();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWins.begin();
+ OJoinTableView::OTableWindowMap::iterator aEnd = rTabWins.end();
for(;aIter != aEnd;++aIter)
{
OQueryTableWindow* pCurrentWin = static_cast<OQueryTableWindow*>(aIter->second);
@@ -2831,8 +2831,8 @@ OUString OQueryDesignView::getStatement()
return OUString();
}
- OQueryTableView::OTableWindowMap* pTabList = m_pTableView->GetTabWinMap();
- sal_uInt32 nTabcount = pTabList->size();
+ OQueryTableView::OTableWindowMap& rTabList = m_pTableView->GetTabWinMap();
+ sal_uInt32 nTabcount = rTabList.size();
OUString aFieldListStr(GenerateSelectList(this,rFieldList,nTabcount>1));
if( aFieldListStr.isEmpty() )
@@ -2844,9 +2844,9 @@ OUString OQueryDesignView::getStatement()
// and trigger a error message
// ----------------- Build table list ----------------------
- const ::std::vector<OTableConnection*>* pConnList = m_pTableView->getTableConnections();
+ const ::std::vector<OTableConnection*>& rConnList = m_pTableView->getTableConnections();
Reference< XConnection> xConnection = rController.getConnection();
- OUString aTableListStr(GenerateFromClause(xConnection,pTabList,pConnList));
+ OUString aTableListStr(GenerateFromClause(xConnection,&rTabList,&rConnList));
OSL_ENSURE(!aTableListStr.isEmpty(), "OQueryDesignView::getStatement() : unexpected : have Fields, but no Tables !");
// if fields exist now, these only can be created by inserting from an already existing table; if on the other hand
// a table is deleted, also the belonging fields will be deleted -> therefore it CANNOT occur that fields
@@ -2858,7 +2858,7 @@ OUString OQueryDesignView::getStatement()
return OUString();
OUString aJoinCrit;
- GenerateInnerJoinCriterias(xConnection,aJoinCrit,pConnList);
+ GenerateInnerJoinCriterias(xConnection,aJoinCrit,&rConnList);
if(!aJoinCrit.isEmpty())
{
OUString aTmp = "( " + aJoinCrit + " )";
@@ -2990,7 +2990,7 @@ bool OQueryDesignView::isSlotEnabled(sal_Int32 _nSlotId)
void OQueryDesignView::SaveUIConfig()
{
OQueryController& rCtrl = static_cast<OQueryController&>(getController());
- rCtrl.SaveTabWinsPosSize( m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos() );
+ rCtrl.SaveTabWinsPosSize( &m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar().GetThumbPos(), m_pScrollWindow->GetVScrollBar().GetThumbPos() );
rCtrl.setVisibleRows( m_pSelectionBox->GetNoneVisibleRows() );
if ( m_aSplitter.GetSplitPosPixel() != 0 )
rCtrl.setSplitPos( m_aSplitter.GetSplitPosPixel() );
diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
index 7b0eaed7aff9..e7a0a59a4efe 100644
--- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
@@ -23,7 +23,7 @@
using namespace dbaui;
void OJoinMoveTabWinUndoAct::TogglePosition()
{
- Point ptFrameScrollPos(m_pOwner->GetHScrollBar()->GetThumbPos(), m_pOwner->GetVScrollBar()->GetThumbPos());
+ Point ptFrameScrollPos(m_pOwner->GetHScrollBar().GetThumbPos(), m_pOwner->GetVScrollBar().GetThumbPos());
Point ptNext = m_pTabWin->GetPosPixel() + ptFrameScrollPos;
m_pTabWin->SetPosPixel(m_ptNextPosition - ptFrameScrollPos);
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
index 33df8ffb49c2..22c9921330a6 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
@@ -54,7 +54,7 @@ namespace dbaui
// access to the managed connections
sal_uInt16 ConnCount() { return (sal_uInt16)m_vTableConnection.size(); }
- ::std::vector<OTableConnection*>* GetTabConnList() { return &m_vTableConnection; }
+ ::std::vector<OTableConnection*>& GetTabConnList() { return m_vTableConnection; }
void InsertConnection( OTableConnection* pConnection ) { m_vTableConnection.push_back(pConnection); }
void RemoveConnection( OTableConnection* pConnection )
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 68b05500691d..4626706c5cc5 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -118,7 +118,7 @@ namespace
{
OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get());
- DlgQryJoin aDlg(_pView,_pConnectionData,_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
+ DlgQryJoin aDlg(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
bool bOk = aDlg.Execute() == RET_OK;
if( bOk )
{
@@ -236,11 +236,11 @@ sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMa
{
sal_Int32 nRet = 0;
- OTableWindowMap::iterator aIter = GetTabWinMap()->find(rName);
- while(aIter != GetTabWinMap()->end())
+ OTableWindowMap::iterator aIter = GetTabWinMap().find(rName);
+ while(aIter != GetTabWinMap().end())
{
- OUString aNewName = OUString(rName) + "_" + OUString::number(++nRet);
- aIter = GetTabWinMap()->find(aNewName);
+ OUString aNewName = rName + "_" + OUString::number(++nRet);
+ aIter = GetTabWinMap().find(aNewName);
}
rMax = nRet;
@@ -250,17 +250,17 @@ sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMa
void OQueryTableView::ReSync()
{
- TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData();
- OSL_ENSURE((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0),
+ TTableWindowData& rTabWinDataList = m_pView->getController().getTableWindowData();
+ OSL_ENSURE((getTableConnections().size()==0) && (GetTabWinMap().size()==0),
"before calling OQueryTableView::ReSync() please call ClearAll !");
// I need a collection of all window names that cannot be created so that I do not initialize connections for them.
::std::vector<OUString> arrInvalidTables;
- TTableWindowData::reverse_iterator aIter = pTabWinDataList->rbegin();
+ TTableWindowData::reverse_iterator aIter = rTabWinDataList.rbegin();
// Create the window and add it
- for(;aIter != pTabWinDataList->rend();++aIter)
+ for(;aIter != rTabWinDataList.rend();++aIter)
{
OQueryTableWindowData* pData = static_cast<OQueryTableWindowData*>(aIter->get());
OTableWindow* pTabWin = createWindow(*aIter);
@@ -276,11 +276,11 @@ void OQueryTableView::ReSync()
delete pTabWin;
arrInvalidTables.push_back(pData->GetAliasName());
- pTabWinDataList->erase( ::std::remove(pTabWinDataList->begin(),pTabWinDataList->end(),*aIter) ,pTabWinDataList->end());
+ rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end());
continue;
}
- (*GetTabWinMap())[pData->GetAliasName()] = pTabWin; // add at the beginning as I am going backwards through the DataList
+ GetTabWinMap()[pData->GetAliasName()] = pTabWin; // add at the beginning as I am going backwards through the DataList
// Use the default if there is no position or size
if (!pData->HasPosition() && !pData->HasSize())
SetDefaultTabWinPosSize(pTabWin);
@@ -289,10 +289,10 @@ void OQueryTableView::ReSync()
}
// Add the connections
- TTableConnectionData* pTabConnDataList = m_pView->getController().getTableConnectionData();
- TTableConnectionData::reverse_iterator aConIter = pTabConnDataList->rbegin();
+ TTableConnectionData& rTabConnDataList = m_pView->getController().getTableConnectionData();
+ TTableConnectionData::reverse_iterator aConIter = rTabConnDataList.rbegin();
- for(;aConIter != pTabConnDataList->rend();++aConIter)
+ for(;aConIter != rTabConnDataList.rend();++aConIter)
{
OQueryTableConnectionData* pTabConnData = static_cast<OQueryTableConnectionData*>(aConIter->get());
@@ -305,7 +305,7 @@ void OQueryTableView::ReSync()
if (bInvalid)
{
// no -> bad luck, no connection
- pTabConnDataList->erase( ::std::remove(pTabConnDataList->begin(),pTabConnDataList->end(),*aConIter) ,pTabConnDataList->end());
+ rTabConnDataList.erase( ::std::remove(rTabConnDataList.begin(), rTabConnDataList.end(), *aConIter), rTabConnDataList.end());
continue;
}
@@ -331,15 +331,15 @@ void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn,
{
// let's first check if I have the connection already
OQueryTableConnection* pTabConn = NULL;
- const ::std::vector<OTableConnection*>* pConnections = getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pConnections->end();
- ::std::vector<OTableConnection*>::const_iterator aIter = ::std::find( pConnections->begin(),
+ const ::std::vector<OTableConnection*>& rConnections = getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end();
+ ::std::vector<OTableConnection*>::const_iterator aIter = ::std::find( rConnections.begin(),
aEnd,
static_cast<const OTableConnection*>(&rNewConn)
);
if(aIter == aEnd )
{
- aIter = pConnections->begin();
+ aIter = rConnections.begin();
for(;aIter != aEnd;++aIter)
{
if(*static_cast<OQueryTableConnection*>(*aIter) == rNewConn)
@@ -445,9 +445,9 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
// first check if this already has its data
bool bAppend = bNewTable;
TTableWindowData::value_type pNewTabWinData;
- TTableWindowData* pWindowData = getDesignView()->getController().getTableWindowData();
- TTableWindowData::iterator aWinIter = pWindowData->begin();
- TTableWindowData::iterator aWinEnd = pWindowData->end();
+ TTableWindowData& rWindowData = getDesignView()->getController().getTableWindowData();
+ TTableWindowData::iterator aWinIter = rWindowData.begin();
+ TTableWindowData::iterator aWinEnd = rWindowData.end();
for(;aWinIter != aWinEnd;++aWinIter)
{
pNewTabWinData = *aWinIter;
@@ -479,8 +479,8 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
}
// Show the relations between the individual tables
- OTableWindowMap* pTabWins = GetTabWinMap();
- if(bNewTable && !pTabWins->empty() && !_rTableName.isEmpty())
+ OTableWindowMap& rTabWins = GetTabWinMap();
+ if(bNewTable && !rTabWins.empty() && !_rTableName.isEmpty())
{
modified();
if ( m_pAccessible )
@@ -523,11 +523,11 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
xProp->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= aReferencedTable;
OSL_ENSURE(!aReferencedTable.isEmpty(),"Foreign key without referencedTableName");
- OTableWindowMap::const_iterator aIter = pTabWins->find(aReferencedTable);
- OTableWindowMap::const_iterator aEnd = pTabWins->end();
+ OTableWindowMap::const_iterator aIter = rTabWins.find(aReferencedTable);
+ OTableWindowMap::const_iterator aEnd = rTabWins.end();
if(aIter == aEnd)
{
- for(aIter = pTabWins->begin();aIter != aEnd;++aIter)
+ for(aIter = rTabWins.begin();aIter != aEnd;++aIter)
{
OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second);
OSL_ENSURE( pTabWinTmp,"TableWindow is null!" );
@@ -543,8 +543,8 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
case KeyType::PRIMARY:
{
// we have a primary key so look in our list if there exists a key which this is referred to
- OTableWindowMap::const_iterator aIter = pTabWins->begin();
- OTableWindowMap::const_iterator aEnd = pTabWins->end();
+ OTableWindowMap::const_iterator aIter = rTabWins.begin();
+ OTableWindowMap::const_iterator aEnd = rTabWins.end();
for(;aIter != aEnd;++aIter)
{
OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second);
@@ -659,9 +659,9 @@ void OQueryTableView::createNewConnection()
TTableConnectionData::value_type pData(new OQueryTableConnectionData());
if( openJoinDialog(this,pData,true) )
{
- OTableWindowMap* pMap = GetTabWinMap();
- OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>((*pMap)[pData->getReferencingTable()->GetWinName()]);
- OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>((*pMap)[pData->getReferencedTable()->GetWinName()]);
+ OTableWindowMap& rMap = GetTabWinMap();
+ OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencingTable()->GetWinName()]);
+ OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencedTable()->GetWinName()]);
// first we have to look if the this connection already exists
OTableConnection* pConn = GetTabConn(pSourceWin,pDestWin,true);
bool bNew = true;
@@ -706,8 +706,8 @@ OQueryTableWindow* OQueryTableView::FindTable(const OUString& rAliasName)
{
OSL_ENSURE(!rAliasName.isEmpty(), "OQueryTableView::FindTable : the AliasName should not be empty !");
// (it is harmless but does not make sense and indicates that there is probably an error in the caller)
- OTableWindowMap::const_iterator aIter = GetTabWinMap()->find(rAliasName);
- if(aIter != GetTabWinMap()->end())
+ OTableWindowMap::const_iterator aIter = GetTabWinMap().find(rAliasName);
+ if(aIter != GetTabWinMap().end())
return static_cast<OQueryTableWindow*>(aIter->second);
return NULL;
}
@@ -715,8 +715,8 @@ OQueryTableWindow* OQueryTableView::FindTable(const OUString& rAliasName)
bool OQueryTableView::FindTableFromField(const OUString& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt)
{
rCnt = 0;
- OTableWindowMap::const_iterator aIter = GetTabWinMap()->begin();
- OTableWindowMap::const_iterator aEnd = GetTabWinMap()->end();
+ OTableWindowMap::const_iterator aIter = GetTabWinMap().begin();
+ OTableWindowMap::const_iterator aEnd = GetTabWinMap().end();
for(;aIter != aEnd;++aIter)
{
if(static_cast<OQueryTableWindow*>(aIter->second)->ExistsField(rFieldName, rInfo))
@@ -728,11 +728,10 @@ bool OQueryTableView::FindTableFromField(const OUString& rFieldName, OTableField
bool OQueryTableView::ContainsTabWin(const OTableWindow& rTabWin)
{
- OTableWindowMap* pTabWins = GetTabWinMap();
- OSL_ENSURE(pTabWins != NULL, "OQueryTableView::RemoveTabWin : Window should not be NULL !");
+ OTableWindowMap& rTabWins = GetTabWinMap();
- OTableWindowMap::iterator aIter = pTabWins->begin();
- OTableWindowMap::iterator aEnd = pTabWins->end();
+ OTableWindowMap::iterator aIter = rTabWins.begin();
+ OTableWindowMap::iterator aEnd = rTabWins.end();
for ( ;aIter != aEnd ; ++aIter )
{
@@ -808,74 +807,70 @@ void OQueryTableView::DropConnection(OQueryTableConnection* pConn)
void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction )
{
- OTableWindowMap* pTabWins = GetTabWinMap();
- OSL_ENSURE(pTabWins != NULL, "OQueryTableView::HideTabWin : have no TabWins !");
-
- if (pTabWin)
- {
- // Window
- // save the position in its data
- getDesignView()->SaveTabWinUIConfig(pTabWin);
- // (I need to go via the parent, as only the parent knows the position of the scrollbars)
- // and then out of the TabWins list and hide
- OTableWindowMap::iterator aIter = pTabWins->begin();
- OTableWindowMap::iterator aEnd = pTabWins->end();
- for ( ;aIter != aEnd ; ++aIter )
- if ( aIter->second == pTabWin )
- {
- pTabWins->erase( aIter );
- break;
- }
+ OTableWindowMap& rTabWins = GetTabWinMap();
+
+ // Window
+ // save the position in its data
+ getDesignView()->SaveTabWinUIConfig(pTabWin);
+ // (I need to go via the parent, as only the parent knows the position of the scrollbars)
+ // and then out of the TabWins list and hide
+ OTableWindowMap::iterator aIter = rTabWins.begin();
+ OTableWindowMap::iterator aEnd = rTabWins.end();
+ for ( ;aIter != aEnd ; ++aIter )
+ if ( aIter->second == pTabWin )
+ {
+ rTabWins.erase( aIter );
+ break;
+ }
- pTabWin->Hide(); // do not destroy it, as it is still in the undo list!!
+ pTabWin->Hide(); // do not destroy it, as it is still in the undo list!!
- // the TabWin data must also be passed out of my responsibility
- TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData();
- pTabWinDataList->erase( ::std::remove(pTabWinDataList->begin(),pTabWinDataList->end(),pTabWin->GetData()),pTabWinDataList->end());
- // The data should not be destroyed as TabWin itself - which is still alive - needs them
- // Either it goes back into my responsibility, (via ShowTabWin), then I add the data back,
- // or the Undo-Action, which currently has full responsibility for the window
- // and its data, gets destroyed and destroys both the window and its data
+ // the TabWin data must also be passed out of my responsibility
+ TTableWindowData& rTabWinDataList = m_pView->getController().getTableWindowData();
+ rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), pTabWin->GetData()), rTabWinDataList.end());
+ // The data should not be destroyed as TabWin itself - which is still alive - needs them
+ // Either it goes back into my responsibility, (via ShowTabWin), then I add the data back,
+ // or the Undo-Action, which currently has full responsibility for the window
+ // and its data, gets destroyed and destroys both the window and its data
- if (m_pLastFocusTabWin == pTabWin)
- m_pLastFocusTabWin = NULL;
+ if (m_pLastFocusTabWin == pTabWin)
+ m_pLastFocusTabWin = NULL;
- // collect connections belonging to the window and pass to UndoAction
- sal_Int16 nCnt = 0;
- const ::std::vector<OTableConnection*>* pTabConList = getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter2 = pTabConList->begin();
- for(;aIter2 != pTabConList->end();)// the end may change
+ // collect connections belonging to the window and pass to UndoAction
+ sal_Int16 nCnt = 0;
+ const ::std::vector<OTableConnection*>& rTabConList = getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter2 = rTabConList.begin();
+ for(;aIter2 != rTabConList.end();)// the end may change
+ {
+ OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>(*aIter2);
+ OSL_ENSURE(pTmpEntry,"OQueryTableConnection is null!");
+ if( pTmpEntry->GetAliasName(JTCS_FROM) == pTabWin->GetAliasName() ||
+ pTmpEntry->GetAliasName(JTCS_TO) == pTabWin->GetAliasName() )
{
- OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>(*aIter2);
- OSL_ENSURE(pTmpEntry,"OQueryTableConnection is null!");
- if( pTmpEntry->GetAliasName(JTCS_FROM) == pTabWin->GetAliasName() ||
- pTmpEntry->GetAliasName(JTCS_TO) == pTabWin->GetAliasName() )
- {
- // add to undo list
- pUndoAction->InsertConnection(pTmpEntry);
-
- // call base class because we append an undo action
- // but this time we are in a undo action list
- OJoinTableView::RemoveConnection(pTmpEntry,sal_False);
- aIter2 = pTabConList->begin();
- ++nCnt;
- }
- else
- ++aIter2;
+ // add to undo list
+ pUndoAction->InsertConnection(pTmpEntry);
+
+ // call base class because we append an undo action
+ // but this time we are in a undo action list
+ OJoinTableView::RemoveConnection(pTmpEntry,sal_False);
+ aIter2 = rTabConList.begin();
+ ++nCnt;
}
+ else
+ ++aIter2;
+ }
- if (nCnt)
- InvalidateConnections();
+ if (nCnt)
+ InvalidateConnections();
- m_pView->getController().InvalidateFeature(ID_BROWSER_ADDTABLE);
+ m_pView->getController().InvalidateFeature(ID_BROWSER_ADDTABLE);
- // inform the UndoAction that the window and connections belong to it
- pUndoAction->SetOwnership(true);
+ // inform the UndoAction that the window and connections belong to it
+ pUndoAction->SetOwnership(true);
- // by doing so, we have modified the document
- m_pView->getController().setModified( sal_True );
- m_pView->getController().InvalidateFeature(SID_BROWSER_CLEAR_QUERY);
- }
+ // by doing so, we have modified the document
+ m_pView->getController().setModified( sal_True );
+ m_pView->getController().InvalidateFeature(SID_BROWSER_CLEAR_QUERY);
}
bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction, bool _bAppend )
@@ -901,8 +896,8 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// Show the window and add to the list
OUString sName = static_cast< OQueryTableWindowData*>(pData.get())->GetAliasName();
- OSL_ENSURE(GetTabWinMap()->find(sName) == GetTabWinMap()->end(),"Alias name already in list!");
- GetTabWinMap()->insert(OTableWindowMap::value_type(sName,pTabWin));
+ OSL_ENSURE(GetTabWinMap().find(sName) == GetTabWinMap().end(),"Alias name already in list!");
+ GetTabWinMap().insert(OTableWindowMap::value_type(sName,pTabWin));
pTabWin->Show();
@@ -913,18 +908,18 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// GetEntryPos, and then in turn by the Connection, when its starting point to the window must be determined.
// the Connections
- ::std::vector<OTableConnection*>* pTableCon = pUndoAction->GetTabConnList();
- ::std::vector<OTableConnection*>::iterator aIter = pTableCon->begin();
- ::std::vector<OTableConnection*>::iterator aEnd = pTableCon->end();
+ ::std::vector<OTableConnection*>& rTableCon = pUndoAction->GetTabConnList();
+ ::std::vector<OTableConnection*>::iterator aIter = rTableCon.begin();
+ ::std::vector<OTableConnection*>::iterator aEnd = rTableCon.end();
for(;aIter != aEnd;++aIter)
addConnection(*aIter); // add all connections from the undo action
- pTableCon->clear();
+ rTableCon.clear();
// and add the window's data to the list (of the document)
if(_bAppend)
- m_pView->getController().getTableWindowData()->push_back(pTabWin->GetData());
+ m_pView->getController().getTableWindowData().push_back(pTabWin->GetData());
m_pView->getController().InvalidateFeature(ID_BROWSER_ADDTABLE);
@@ -959,18 +954,15 @@ void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo)
bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) const
{
- const ::std::vector<OTableConnection*>* pList = getTableConnections();
- if (pList)
+ const ::std::vector<OTableConnection*>& rList = getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter = rList.begin();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rList.end();
+ for(;aIter != aEnd;++aIter)
{
- ::std::vector<OTableConnection*>::const_iterator aIter = pList->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pList->end();
- for(;aIter != aEnd;++aIter)
- {
- OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(*aIter);
- if (pTemp->IsVisited() &&
- (pFrom == static_cast< OQueryTableWindow*>(pTemp->GetSourceWin()) || pFrom == static_cast< OQueryTableWindow*>(pTemp->GetDestWin())))
- return true;
- }
+ OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(*aIter);
+ if (pTemp->IsVisited() &&
+ (pFrom == static_cast< OQueryTableWindow*>(pTemp->GetSourceWin()) || pFrom == static_cast< OQueryTableWindow*>(pTemp->GetDestWin())))
+ return true;
}
return false;
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 5d76c2110925..195af536eabd 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -488,21 +488,18 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
enableControl(pEntry,m_pTableCell);
if ( !pEntry->isCondition() )
{
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if (pTabWinList)
- {
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->begin();
- OJoinTableView::OTableWindowMap::iterator aEnd = pTabWinList->end();
+ OJoinTableView::OTableWindowMap& rTabWinList = getDesignView()->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.begin();
+ OJoinTableView::OTableWindowMap::iterator aEnd = rTabWinList.end();
- for(;aIter != aEnd;++aIter)
- m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second)->GetAliasName());
+ for(;aIter != aEnd;++aIter)
+ m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second)->GetAliasName());
- m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0);
- if (!pEntry->GetAlias().isEmpty())
- m_pTableCell->SelectEntry(pEntry->GetAlias());
- else
- m_pTableCell->SelectEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)));
- }
+ m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0);
+ if (!pEntry->GetAlias().isEmpty())
+ m_pTableCell->SelectEntry(pEntry->GetAlias());
+ else
+ m_pTableCell->SelectEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)));
}
} break;
case BROW_VIS_ROW:
@@ -607,22 +604,18 @@ bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName, const OUSt
OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(_pEntry->GetTabWindow());
if ( !pEntryTab ) // no table found with this name so we have to travel through all tables
{
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if ( pTabWinList )
+ sal_uInt16 nTabCount = 0;
+ if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occurred: column not in table window
{
- sal_uInt16 nTabCount = 0;
- if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occurred: column not in table window
- {
- OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST));
- sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName);
- OSQLErrorBox( this, sErrorMsg ).Execute();
- bError = true;
- }
- else
- {
- pEntryTab = static_cast<OQueryTableWindow*>(_pEntry->GetTabWindow());
- notifyTableFieldChanged(OUString(),_pEntry->GetAlias(),_bListAction,GetCurColumnId());
- }
+ OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST));
+ sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName);
+ OSQLErrorBox( this, sErrorMsg ).Execute();
+ bError = true;
+ }
+ else
+ {
+ pEntryTab = static_cast<OQueryTableWindow*>(_pEntry->GetTabWindow());
+ notifyTableFieldChanged(OUString(),_pEntry->GetAlias(),_bListAction,GetCurColumnId());
}
}
if ( pEntryTab ) // here we got a valid table
@@ -991,18 +984,15 @@ bool OSelectionBrowseBox::SaveModified()
{
pEntry->SetAlias(aAliasName);
// we have to set the table name as well as the table window
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if (pTabWinList)
+ OJoinTableView::OTableWindowMap& rTabWinList = getDesignView()->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(aAliasName);
+ if(aIter != rTabWinList.end())
{
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->find(aAliasName);
- if(aIter != pTabWinList->end())
+ OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
+ if (pEntryTab)
{
- OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
- if (pEntryTab)
- {
- pEntry->SetTable(pEntryTab->GetTableName());
- pEntry->SetTabWindow(pEntryTab);
- }
+ pEntry->SetTable(pEntryTab->GetTableName());
+ pEntry->SetTabWindow(pEntryTab);
}
}
}
@@ -2618,19 +2608,16 @@ OUString OSelectionBrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBo
bool OSelectionBrowseBox::fillEntryTable(OTableFieldDescRef& _pEntry,const OUString& _sTableName)
{
bool bRet = false;
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if (pTabWinList)
+ OJoinTableView::OTableWindowMap& rTabWinList = getDesignView()->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(_sTableName);
+ if(aIter != rTabWinList.end())
{
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->find(_sTableName);
- if(aIter != pTabWinList->end())
+ OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
+ if (pEntryTab)
{
- OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
- if (pEntryTab)
- {
- _pEntry->SetTable(pEntryTab->GetTableName());
- _pEntry->SetTabWindow(pEntryTab);
- bRet = true;
- }
+ _pEntry->SetTable(pEntryTab->GetTableName());
+ _pEntry->SetTabWindow(pEntryTab);
+ bRet = true;
}
}
return bRet;
diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx
index 9ced392a9e0e..6d7864e06db7 100644
--- a/dbaccess/source/ui/querydesign/TableConnection.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnection.cxx
@@ -53,10 +53,10 @@ namespace dbaui
void OTableConnection::Init()
{
// initialise linelist with defaults
- OConnectionLineDataVec* pLineData = GetData()->GetConnLineDataList();
- OConnectionLineDataVec::const_iterator aIter = pLineData->begin();
- OConnectionLineDataVec::const_iterator aEnd = pLineData->end();
- m_vConnLine.reserve(pLineData->size());
+ OConnectionLineDataVec& rLineData = GetData()->GetConnLineDataList();
+ OConnectionLineDataVec::const_iterator aIter = rLineData.begin();
+ OConnectionLineDataVec::const_iterator aEnd = rLineData.end();
+ m_vConnLine.reserve(rLineData.size());
for(;aIter != aEnd;++aIter)
m_vConnLine.push_back( new OConnectionLine(this, *aIter) );
}
@@ -89,12 +89,12 @@ namespace dbaui
clearLineData();
// copy linelist
- if(! rConn.GetConnLineList()->empty() )
+ if(! rConn.GetConnLineList().empty() )
{
- const ::std::vector<OConnectionLine*>* pLine = rConn.GetConnLineList();
- ::std::vector<OConnectionLine*>::const_iterator aIter = pLine->begin();
- ::std::vector<OConnectionLine*>::const_iterator aEnd = pLine->end();
- m_vConnLine.reserve(pLine->size());
+ const ::std::vector<OConnectionLine*>& rLine = rConn.GetConnLineList();
+ ::std::vector<OConnectionLine*>::const_iterator aIter = rLine.begin();
+ ::std::vector<OConnectionLine*>::const_iterator aEnd = rLine.end();
+ m_vConnLine.reserve(rLine.size());
for(;aIter != aEnd;++aIter)
m_vConnLine.push_back( CreateConnLine( **aIter ));
}
diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
index fe9a3a8e040f..43fc4eed8880 100644
--- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
@@ -77,10 +77,10 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat
ResetConnLines();
// and copy
- OConnectionLineDataVec* pLineData = const_cast<OTableConnectionData*>(&rConnData)->GetConnLineDataList();
+ const OConnectionLineDataVec& rLineData = rConnData.GetConnLineDataList();
- OConnectionLineDataVec::const_iterator aIter = pLineData->begin();
- OConnectionLineDataVec::const_iterator aEnd = pLineData->end();
+ OConnectionLineDataVec::const_iterator aIter = rLineData.begin();
+ OConnectionLineDataVec::const_iterator aEnd = rLineData.end();
for(;aIter != aEnd;++aIter)
m_vConnLineData.push_back(new OConnectionLineData(**aIter));
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index 0585bdb52a04..f4ed8116345f 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -95,8 +95,7 @@ namespace dbaui
sal_Int32 nCount = 0;
if(m_pTable)
{
- if(m_pTable->GetTitleCtrl())
- ++nCount;
+ ++nCount;
if(m_pTable->GetListBox())
++nCount;
}
@@ -111,14 +110,10 @@ namespace dbaui
switch(i)
{
case 0:
- if(m_pTable->GetTitleCtrl())
- {
- aRet = m_pTable->GetTitleCtrl()->GetAccessible();
- break;
- } // fall through if title control does not exist
+ aRet = m_pTable->GetTitleCtrl().GetAccessible();
+ break;
case 1:
- if(m_pTable->GetListBox())
- aRet = m_pTable->GetListBox()->GetAccessible();
+ aRet = m_pTable->GetListBox()->GetAccessible();
break;
default:
throw IndexOutOfBoundsException();
@@ -133,9 +128,9 @@ namespace dbaui
if( m_pTable )
{
// search the position of our table window in the table window map
- OJoinTableView::OTableWindowMap* pMap = m_pTable->getTableView()->GetTabWinMap();
- OJoinTableView::OTableWindowMap::iterator aIter = pMap->begin();
- OJoinTableView::OTableWindowMap::iterator aEnd = pMap->end();
+ OJoinTableView::OTableWindowMap& rMap = m_pTable->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rMap.begin();
+ OJoinTableView::OTableWindowMap::iterator aEnd = rMap.end();
for (nIndex = 0; aIter != aEnd && aIter->second != m_pTable; ++nIndex,++aIter)
;
nIndex = aIter != aEnd ? nIndex : -1;
@@ -199,7 +194,7 @@ namespace dbaui
OJoinTableView* pView = m_pTable->getTableView();
::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable) + nIndex;
aRet.TargetSet.realloc(1);
- aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections()->begin());
+ aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections().begin());
aRet.RelationType = AccessibleRelationType::CONTROLLER_FOR;
}
return aRet;
@@ -216,16 +211,16 @@ namespace dbaui
if( AccessibleRelationType::CONTROLLER_FOR == aRelationType && m_pTable)
{
OJoinTableView* pView = m_pTable->getTableView();
- const ::std::vector<OTableConnection*>* pConnectionList = pView->getTableConnections();
+ const ::std::vector<OTableConnection*>& rConnectionList = pView->getTableConnections();
::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable);
- ::std::vector<OTableConnection*>::const_iterator aEnd = pConnectionList->end();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rConnectionList.end();
::std::vector< Reference<XInterface> > aRelations;
aRelations.reserve(5); // just guessing
for (; aIter != aEnd ; ++aIter )
{
uno::Reference<uno::XInterface> xInterface(
- getParentChild(aIter - pConnectionList->begin()));
+ getParentChild(aIter - rConnectionList.begin()));
aRelations.push_back(xInterface);
}
diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
index 207f2fe484e8..46e25c03c209 100644
--- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
@@ -130,9 +130,9 @@ void OTableWindowTitle::MouseButtonDown( const MouseEvent& rEvt )
OJoinTableView* pView = static_cast<OJoinTableView*>(m_pTabWin->getTableView());
OSL_ENSURE(pView,"No OJoinTableView!");
- const ::std::vector<OTableConnection*>* pConns = pView->getTableConnections();
- ::std::for_each(pConns->begin(),
- pConns->end(),
+ const ::std::vector<OTableConnection*>& rConns = pView->getTableConnections();
+ ::std::for_each(rConns.begin(),
+ rConns.end(),
::std::mem_fun(&OTableConnection::RecalcLines));
pView->InvalidateConnections();