vcl/qa/cppunit/outdev.cxx | 4 ++-- vcl/source/outdev/wallpaper.cxx | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-)
New commits: commit ff3c9428e7936ed409fb012ffb66d0321f169e94 Author: Noel Grandin <noelgran...@collabora.co.uk> AuthorDate: Thu Jan 30 09:14:04 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jan 30 11:52:36 2025 +0100 tdf#164799 Tooltips appear empty regression from commit e0d4d178caff1414a9a21fa57f06bc8d4d2c389a Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon Jan 13 15:03:05 2025 +0200 Change alpha behavour of OutputDevice::SetFillColor where DrawColorWallpaper is not correctly saving/restoring the fill color. Previously this worked because GetFillColor would return a transparent color if no fill color was set, and a transparent fill color would be interpreted as "no color" when drawing. Change-Id: I63e1ba2df0a5e2088d018068fe0a0e45453b7c77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180928 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index 78c3396bb4df..a6dfd4f901d6 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -971,11 +971,11 @@ CPPUNIT_TEST_FIXTURE(VclOutdevTest, testErase) CPPUNIT_ASSERT_EQUAL_MESSAGE("Not a rect action", MetaActionType::RECT, pAction->GetType()); pAction = aMtf.GetAction(INITIAL_SETUP_ACTION_COUNT + 3); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Not a line color action (end)", MetaActionType::LINECOLOR, + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not a fill color action (end)", MetaActionType::FILLCOLOR, pAction->GetType()); pAction = aMtf.GetAction(INITIAL_SETUP_ACTION_COUNT + 4); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Not a fill color action (end)", MetaActionType::FILLCOLOR, + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not a line color action (end)", MetaActionType::LINECOLOR, pAction->GetType()); } diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx index 2ae7cb2e5a26..8ab8698323aa 100644 --- a/vcl/source/outdev/wallpaper.cxx +++ b/vcl/source/outdev/wallpaper.cxx @@ -80,17 +80,27 @@ void OutputDevice::DrawColorWallpaper( tools::Long nX, tools::Long nY, assert(!is_double_buffered_window()); // draw wallpaper without border + bool bOldIsLineColor = IsLineColor(); Color aOldLineColor = GetLineColor(); + bool bOldIsFillColor = IsFillColor(); Color aOldFillColor = GetFillColor(); + bool bMap = mbMap; + SetLineColor(); SetFillColor( rWallpaper.GetColor() ); - - bool bMap = mbMap; EnableMapMode( false ); + DrawRect( tools::Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) ); - SetLineColor( aOldLineColor ); - SetFillColor( aOldFillColor ); + EnableMapMode( bMap ); + if (bOldIsFillColor) + SetFillColor(aOldFillColor); + else + SetFillColor(); + if (bOldIsLineColor) + SetLineColor(aOldLineColor); + else + SetLineColor(); } void OutputDevice::Erase()