summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/relationdesign/RTableConnection.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-15 20:39:06 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-16 21:57:15 +0900
commit264fb9f16336e2cfd8f937b630fc167faab0aae3 (patch)
tree95e716df471a385572d6a52570aa82cfc6d646c6 /dbaccess/source/ui/relationdesign/RTableConnection.cxx
parenta76dcdfaa6c6d2b1d73fb1c96fe38dd7e452f48a (diff)
refactor dbacess classes to use RenderContext
Change-Id: I60e436ec1e6974e5fb8c6525552c6e172ceca0ca
Diffstat (limited to 'dbaccess/source/ui/relationdesign/RTableConnection.cxx')
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnection.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
index 1f18d83af39a..b4f05c24fbd1 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
@@ -48,11 +48,11 @@ ORelationTableConnection& ORelationTableConnection::operator=( const ORelationTa
return *this;
}
-void ORelationTableConnection::Draw( const Rectangle& rRect )
+void ORelationTableConnection::Draw(vcl::RenderContext& rRenderContext, const Rectangle& rRect )
{
- OTableConnection::Draw( rRect );
+ OTableConnection::Draw(rRenderContext, rRect);
ORelationTableConnectionData* pData = static_cast< ORelationTableConnectionData* >(GetData().get());
- if ( pData && (pData->GetCardinality() == CARDINAL_UNDEFINED) )
+ if (pData && (pData->GetCardinality() == CARDINAL_UNDEFINED))
return;
// search lines for top line
@@ -62,15 +62,16 @@ void ORelationTableConnection::Draw( const Rectangle& rRect )
const OConnectionLine* pTopLine = NULL;
const ::std::vector<OConnectionLine*>& rConnLineList = GetConnLineList();
- ::std::vector<OConnectionLine*>::const_iterator aIter = rConnLineList.begin();
- ::std::vector<OConnectionLine*>::const_iterator aEnd = rConnLineList.end();
+ std::vector<OConnectionLine*>::const_iterator aIter = rConnLineList.begin();
+ std::vector<OConnectionLine*>::const_iterator aEnd = rConnLineList.end();
+
for(;aIter != aEnd;++aIter)
{
if( (*aIter)->IsValid() )
{
aBoundingRect = (*aIter)->GetBoundingRect();
nTemp = aBoundingRect.Top();
- if( nTemp<nTop )
+ if(nTemp < nTop)
{
nTop = nTemp;
pTopLine = (*aIter);
@@ -79,7 +80,7 @@ void ORelationTableConnection::Draw( const Rectangle& rRect )
}
// cardinality
- if( !pTopLine )
+ if (!pTopLine)
return;
Rectangle aSourcePos = pTopLine->GetSourceTextPos();
@@ -88,7 +89,7 @@ void ORelationTableConnection::Draw( const Rectangle& rRect )
OUString aSourceText;
OUString aDestText;
- switch( pData->GetCardinality() )
+ switch (pData->GetCardinality())
{
case CARDINAL_ONE_MANY:
aSourceText = "1";
@@ -107,12 +108,12 @@ void ORelationTableConnection::Draw( const Rectangle& rRect )
}
if (IsSelected())
- GetParent()->SetTextColor(Application::GetSettings().GetStyleSettings().GetHighlightColor());
+ rRenderContext.SetTextColor(Application::GetSettings().GetStyleSettings().GetHighlightColor());
else
- GetParent()->SetTextColor(Application::GetSettings().GetStyleSettings().GetWindowTextColor());
+ rRenderContext.SetTextColor(Application::GetSettings().GetStyleSettings().GetWindowTextColor());
- GetParent()->DrawText( aSourcePos, aSourceText, TEXT_DRAW_CLIP | TEXT_DRAW_CENTER | TEXT_DRAW_BOTTOM);
- GetParent()->DrawText( aDestPos, aDestText, TEXT_DRAW_CLIP | TEXT_DRAW_CENTER | TEXT_DRAW_BOTTOM);
+ rRenderContext.DrawText(aSourcePos, aSourceText, TEXT_DRAW_CLIP | TEXT_DRAW_CENTER | TEXT_DRAW_BOTTOM);
+ rRenderContext.DrawText(aDestPos, aDestText, TEXT_DRAW_CLIP | TEXT_DRAW_CENTER | TEXT_DRAW_BOTTOM);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */