summaryrefslogtreecommitdiff
path: root/vcl/win/gdi/salnativewidgets-luna.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win/gdi/salnativewidgets-luna.cxx')
-rw-r--r--vcl/win/gdi/salnativewidgets-luna.cxx36
1 files changed, 27 insertions, 9 deletions
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx
index 1fa4d589f233..f789f17e1972 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -1162,20 +1162,35 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
* aCaption: A caption or title string (like button text etc)
*/
bool WinSalGraphics::drawNativeControl( ControlType nType,
- ControlPart nPart,
- const Rectangle& rControlRegion,
- ControlState nState,
- const ImplControlValue& aValue,
- const OUString& aCaption )
+ ControlPart nPart,
+ const Rectangle& rControlRegion,
+ ControlState nState,
+ const ImplControlValue& aValue,
+ const OUString& aCaption )
{
bool bOk = false;
HTHEME hTheme = NULL;
Rectangle buttonRect = rControlRegion;
+ Rectangle cacheRect = rControlRegion;
+ Size keySize = cacheRect.GetSize();
WinOpenGLSalGraphicsImpl* pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get());
- ControlCacheKey aControlCacheKey(nType, nPart, nState, buttonRect.GetSize());
+ // tdf#95618 - A few controls render outside the region they're given.
+ if (pImpl && nType == CTRL_TAB_ITEM)
+ {
+ Rectangle rNativeBoundingRegion;
+ Rectangle rNativeContentRegion;
+ if (getNativeControlRegion(nType, nPart, rControlRegion, nState, aValue, aCaption,
+ rNativeBoundingRegion, rNativeContentRegion))
+ {
+ cacheRect = rNativeBoundingRegion;
+ keySize = rNativeBoundingRegion.GetSize();
+ }
+ }
+
+ ControlCacheKey aControlCacheKey(nType, nPart, nState, keySize);
if (pImpl != NULL && pImpl->TryRenderCachedNativeControl(aControlCacheKey, buttonRect.Left(), buttonRect.Top()))
{
return true;
@@ -1288,18 +1303,18 @@ bool WinSalGraphics::drawNativeControl( ControlType nType,
else
{
// We can do OpenGL
- OpenGLCompatibleDC aBlackDC(*this, buttonRect.Left(), buttonRect.Top(), buttonRect.GetWidth(), buttonRect.GetHeight());
+ OpenGLCompatibleDC aBlackDC(*this, cacheRect.Left(), cacheRect.Top(), cacheRect.GetWidth()+1, cacheRect.GetHeight()+1);
SetTextAlign(aBlackDC.getCompatibleHDC(), TA_LEFT|TA_TOP|TA_NOUPDATECP);
aBlackDC.fill(MAKE_SALCOLOR(0, 0, 0));
- OpenGLCompatibleDC aWhiteDC(*this, buttonRect.Left(), buttonRect.Top(), buttonRect.GetWidth(), buttonRect.GetHeight());
+ OpenGLCompatibleDC aWhiteDC(*this, cacheRect.Left(), cacheRect.Top(), cacheRect.GetWidth()+1, cacheRect.GetHeight()+1);
SetTextAlign(aWhiteDC.getCompatibleHDC(), TA_LEFT|TA_TOP|TA_NOUPDATECP);
aWhiteDC.fill(MAKE_SALCOLOR(0xff, 0xff, 0xff));
if (ImplDrawNativeControl(aBlackDC.getCompatibleHDC(), hTheme, rc, nType, nPart, nState, aValue, aCaptionStr) &&
ImplDrawNativeControl(aWhiteDC.getCompatibleHDC(), hTheme, rc, nType, nPart, nState, aValue, aCaptionStr))
{
- bOk = pImpl->RenderAndCacheNativeControl(aWhiteDC, aBlackDC, buttonRect.Left(), buttonRect.Top(), aControlCacheKey);
+ bOk = pImpl->RenderAndCacheNativeControl(aWhiteDC, aBlackDC, cacheRect.Left(), cacheRect.Top(), aControlCacheKey);
}
}
@@ -1330,6 +1345,9 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType,
{
bool bRet = FALSE;
+ // FIXME: rNativeBoundingRegion has a different origin
+ // depending on which part is used; horrors.
+
HDC hDC = GetDC( mhWnd );
if( nType == CTRL_TOOLBAR )
{