diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-06-19 17:52:26 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-06-19 17:59:07 +0200 |
commit | 7f19a7f1f15159321964d6a8873c66c8b68f3df9 (patch) | |
tree | cb121000ee1d8be5b4541e34ec553188d7e5522a /vcl | |
parent | b7faad20cebe2b92e51fa2279f9c49d9fbd5a2d3 (diff) |
rendercontext: Fix crash with double-buffering in the Styles combo box.
Decouple the actual window from rendercontext in UserDrawEvent.
Change-Id: Ic440c4e7f59fcffb7800c578146e8eb528cbb7b4
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/combobox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/status.cxx | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 096452a21baf..4f41c31c420c 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1254,8 +1254,8 @@ void ComboBox::EnableUserDraw( bool bUserDraw ) void ComboBox::DrawEntry(const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos) { - DBG_ASSERT(rEvt.GetDevice() == mpImplLB->GetMainWindow(), "DrawEntry?!"); - mpImplLB->GetMainWindow()->DrawEntry(*rEvt.GetDevice(), rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos); + DBG_ASSERT(rEvt.GetWindow() == mpImplLB->GetMainWindow(), "DrawEntry?!"); + mpImplLB->GetMainWindow()->DrawEntry(*rEvt.GetRenderContext(), rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos); } void ComboBox::SetSeparatorPos( sal_Int32 n ) diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 5d47dacf9580..d13931877b44 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -1736,7 +1736,7 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 nCurr = GetEntryList()->FindEntry(GetEntryList()->GetEntryText(nCurr)); nCurr = sal::static_int_cast<sal_Int32>(nCurr - GetEntryList()->GetMRUCount()); - UserDrawEvent aUDEvt(&rRenderContext, aRect, nPos, nCurr); + UserDrawEvent aUDEvt(this, &rRenderContext, aRect, nPos, nCurr); userDrawSignal(&aUDEvt); mbInUserDraw = false; } @@ -2747,7 +2747,7 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout) if ( IsUserDrawEnabled() ) { mbInUserDraw = true; - UserDrawEvent aUDEvt(&rRenderContext, maFocusRect, mnItemPos, 0); + UserDrawEvent aUDEvt(this, &rRenderContext, maFocusRect, mnItemPos, 0); userDrawSignal( &aUDEvt ); mbInUserDraw = false; } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index b476d8647ada..315e405b7a7a 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1383,10 +1383,10 @@ void ListBox::UserDraw( const UserDrawEvent& ) void ListBox::DrawEntry(const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos) { - if (rEvt.GetDevice() == mpImplLB->GetMainWindow()) - mpImplLB->GetMainWindow()->DrawEntry(*rEvt.GetDevice(), rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos ); - else if (rEvt.GetDevice() == mpImplWin) - mpImplWin->DrawEntry(*rEvt.GetDevice(), bDrawImage, bDrawText, bDrawTextAtImagePos); + if (rEvt.GetWindow() == mpImplLB->GetMainWindow()) + mpImplLB->GetMainWindow()->DrawEntry(*rEvt.GetRenderContext(), rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos ); + else if (rEvt.GetWindow() == mpImplWin) + mpImplWin->DrawEntry(*rEvt.GetRenderContext(), bDrawImage, bDrawText, bDrawTextAtImagePos); } void ListBox::SetUserItemSize( const Size& rSz ) diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 0ea944d82c66..bc1e553f2421 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -415,14 +415,14 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen { mbInUserDraw = true; mpImplData->mpVirDev->EnableRTL( IsRTLEnabled() ); - UserDrawEvent aODEvt(mpImplData->mpVirDev, Rectangle(Point(), aTextRectSize), pItem->mnId); + UserDrawEvent aODEvt(this, mpImplData->mpVirDev, Rectangle(Point(), aTextRectSize), pItem->mnId); UserDraw(aODEvt); mpImplData->mpVirDev->EnableRTL(false); mbInUserDraw = false; } else { - UserDrawEvent aODEvt(&rRenderContext, aTextRect, pItem->mnId); + UserDrawEvent aODEvt(this, &rRenderContext, aTextRect, pItem->mnId); UserDraw(aODEvt); } } |