diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-15 20:39:06 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-16 21:57:15 +0900 |
commit | 264fb9f16336e2cfd8f937b630fc167faab0aae3 (patch) | |
tree | 95e716df471a385572d6a52570aa82cfc6d646c6 /dbaccess/source/ui/querydesign | |
parent | a76dcdfaa6c6d2b1d73fb1c96fe38dd7e452f48a (diff) |
refactor dbacess classes to use RenderContext
Change-Id: I60e436ec1e6974e5fb8c6525552c6e172ceca0ca
Diffstat (limited to 'dbaccess/source/ui/querydesign')
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinTableView.cxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/TableConnection.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/TableWindow.cxx | 26 |
3 files changed, 22 insertions, 22 deletions
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index f3ef5af16ff7..16879ed1b1d9 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -935,26 +935,26 @@ void OJoinTableView::SelectConn(OTableConnection* pConn) } } -void OJoinTableView::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect ) +void OJoinTableView::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { - DrawConnections( rRect ); + DrawConnections(rRenderContext, rRect); } void OJoinTableView::InvalidateConnections() { // draw Joins - for(auto & conn : m_vTableConnection) + for (auto & conn : m_vTableConnection) conn->InvalidateConnection(); } -void OJoinTableView::DrawConnections( const Rectangle& rRect ) +void OJoinTableView::DrawConnections(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { // draw Joins - for(auto conn : m_vTableConnection) - conn->Draw(rRect); + for(auto connection : m_vTableConnection) + connection->Draw(rRenderContext, rRect); // finally redraw the selected one above all others if (GetSelectedConn()) - GetSelectedConn()->Draw( rRect ); + GetSelectedConn()->Draw(rRenderContext, rRect); } ::std::vector<VclPtr<OTableConnection> >::const_iterator OJoinTableView::getTableConnections(const OTableWindow* _pFromWin) const diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx index b0967c4cfbaa..ec91c07646fd 100644 --- a/dbaccess/source/ui/querydesign/TableConnection.cxx +++ b/dbaccess/source/ui/querydesign/TableConnection.cxx @@ -193,10 +193,10 @@ namespace dbaui return aBoundingRect; } - void OTableConnection::Draw( const Rectangle& /*rRect*/ ) + void OTableConnection::Draw(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/) { // Draw line - ::std::for_each(m_vConnLine.begin(),m_vConnLine.end(),TConnectionLineDrawFunctor(m_pParent)); + std::for_each(m_vConnLine.begin(), m_vConnLine.end(), TConnectionLineDrawFunctor(&rRenderContext)); } } diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index 52dcde3d589a..3b960ade7047 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -312,33 +312,33 @@ void OTableWindow::DataChanged(const DataChangedEvent& rDCEvt) } } -void OTableWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) +void OTableWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { Rectangle aRect(Point(0,0), GetOutputSizePixel()); Window::Paint(rRenderContext, rRect); - Draw3DBorder( aRect ); + Draw3DBorder(rRenderContext, aRect); } -void OTableWindow::Draw3DBorder(const Rectangle& rRect) +void OTableWindow::Draw3DBorder(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { // Use the System Style-Settings for my colours const StyleSettings& aSystemStyle = Application::GetSettings().GetStyleSettings(); // Black lines for bottom and right - SetLineColor(aSystemStyle.GetDarkShadowColor()); - DrawLine( rRect.BottomLeft(), rRect.BottomRight() ); - DrawLine( rRect.BottomRight(), rRect.TopRight() ); + rRenderContext.SetLineColor(aSystemStyle.GetDarkShadowColor()); + rRenderContext.DrawLine(rRect.BottomLeft(), rRect.BottomRight()); + rRenderContext.DrawLine(rRect.BottomRight(), rRect.TopRight()); // Dark grey lines over the black lines - SetLineColor(aSystemStyle.GetShadowColor()); - Point aEHvector(1,1); - DrawLine( rRect.BottomLeft()+Point(1,-1), rRect.BottomRight() - aEHvector ); - DrawLine( rRect.BottomRight() - aEHvector, rRect.TopRight()+Point(-1,1) ); + rRenderContext.SetLineColor(aSystemStyle.GetShadowColor()); + Point aEHvector(1, 1); + rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -1), rRect.BottomRight() - aEHvector); + rRenderContext.DrawLine(rRect.BottomRight() - aEHvector, rRect.TopRight() + Point(-1, 1)); // Light grey lines for top and left - SetLineColor(aSystemStyle.GetLightColor()); - DrawLine( rRect.BottomLeft()+Point(1,-2), rRect.TopLeft() + aEHvector ); - DrawLine( rRect.TopLeft() + aEHvector, rRect.TopRight()+Point(-2,1) ); + rRenderContext.SetLineColor(aSystemStyle.GetLightColor()); + rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -2), rRect.TopLeft() + aEHvector); + rRenderContext.DrawLine(rRect.TopLeft() + aEHvector, rRect.TopRight() + Point(-2, 1)); } Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSize) const |