summaryrefslogtreecommitdiff
path: root/vcl/source/control/imgctrl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/imgctrl.cxx')
-rw-r--r--vcl/source/control/imgctrl.cxx41
1 files changed, 21 insertions, 20 deletions
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index f1ff32a111ba..265d018bbffe 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -130,26 +130,27 @@ void ImageControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
{
ImplDraw(rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel());
- if (HasFocus())
- {
- vcl::Window* pBorderWindow = GetWindow(GetWindowType::Border);
-
- bool bFlat = (GetBorderStyle() == WindowBorderStyle::MONO);
- tools::Rectangle aRect(Point(0,0), pBorderWindow->GetOutputSizePixel());
- Color oldLineCol = pBorderWindow->GetLineColor();
- Color oldFillCol = pBorderWindow->GetFillColor();
- pBorderWindow->SetFillColor();
- pBorderWindow->SetLineColor(bFlat ? COL_WHITE : COL_BLACK);
- pBorderWindow->DrawRect(aRect);
- ++aRect.Left();
- --aRect.Right();
- ++aRect.Top();
- --aRect.Bottom();
- pBorderWindow->SetLineColor(bFlat ? COL_BLACK : COL_WHITE);
- pBorderWindow->DrawRect(aRect);
- pBorderWindow->SetLineColor(oldLineCol);
- pBorderWindow->SetFillColor(oldFillCol);
- }
+ if (!HasFocus())
+ return;
+
+ vcl::Window* pBorderWindow = GetWindow(GetWindowType::Border);
+
+ bool bFlat = (GetBorderStyle() == WindowBorderStyle::MONO);
+ tools::Rectangle aRect(Point(0,0), pBorderWindow->GetOutputSizePixel());
+ Color oldLineCol = pBorderWindow->GetLineColor();
+ Color oldFillCol = pBorderWindow->GetFillColor();
+ pBorderWindow->SetFillColor();
+ pBorderWindow->SetLineColor(bFlat ? COL_WHITE : COL_BLACK);
+ pBorderWindow->DrawRect(aRect);
+ ++aRect.Left();
+ --aRect.Right();
+ ++aRect.Top();
+ --aRect.Bottom();
+ pBorderWindow->SetLineColor(bFlat ? COL_BLACK : COL_WHITE);
+ pBorderWindow->DrawRect(aRect);
+ pBorderWindow->SetLineColor(oldLineCol);
+ pBorderWindow->SetFillColor(oldFillCol);
+
}
void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags )