diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-08-06 18:11:44 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-08-06 18:12:46 +0200 |
commit | f4a2c604c73337cd21cd98d975b4f2b943fbab60 (patch) | |
tree | c1078ebdd8c16ec014f544994ce0c532cf9c1f46 /vcl/source/control | |
parent | 21531da576eca7ef9cb2ee78d1643b25d5f86ae3 (diff) |
tdf#92982 vcl rendercontext: fix missing background repaint of Edit
Change-Id: Ic45f65d10835eb39b6709e7adeed1392905ea631
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/edit.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index cb10b95deafc..8d64c5e33e4f 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1034,6 +1034,27 @@ void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, long nXStart, if( !(ImplUseNativeBorder(rRenderContext, GetStyle()) || IsPaintTransparent())) rRenderContext.Erase(aRect); + else if (SupportsDoubleBuffering() && mbIsSubEdit) + { + // ImplPaintBorder() is a NOP, we have a native border, and this is a sub-edit of a control. + // That means we have to draw the parent native widget to paint the edit area to clear our background. + long nLeft = mnXOffset + ImplGetExtraXOffset(); + long nTop = ImplGetTextYPosition(); + long nRight = GetOutputWidthPixel(); + long nHeight = GetTextHeight(); + Rectangle aEditArea(nLeft, nTop, nRight, nTop + nHeight); + + ControlType aCtrlType = ImplGetNativeControlType(); + ControlPart aCtrlPart = PART_ENTIRE_CONTROL; + Rectangle aCtrlRegion(0, 0, GetParent()->GetOutputWidthPixel(), GetParent()->GetOutputHeightPixel()); + ControlState nState = ControlState::ENABLED; + ImplControlValue aControlValue; + + rRenderContext.Push(PushFlags::CLIPREGION); + rRenderContext.SetClipRegion(vcl::Region(aEditArea)); + rRenderContext.DrawNativeControl(aCtrlType, aCtrlPart, aCtrlRegion, nState, aControlValue, OUString()); + rRenderContext.Pop(); + } } void Edit::ImplPaintBorder(vcl::RenderContext& rRenderContext, long nXStart, long nXEnd) |