summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-05 17:19:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-05 21:39:24 +0200
commitad0d1db3ce862ef74a7a1849b821f5010f9ba3fd (patch)
treefed7546790323a328aa3b01eb97e87a425550081
parent09954c381895f340c9b73af64b0833d8b4689c06 (diff)
tdf#116799 Border selection icon tool in sidebar disappearing
regression from commit fe96d07621f75e6e5a106407c8ef80ace1b7f137 move CellBorderUpdater bitmap update to VirtualDevice Change-Id: I9a021b121b6da5d387ee710363b301543a31582e Reviewed-on: https://gerrit.libreoffice.org/52467 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/sidebar/CellBorderUpdater.cxx39
1 files changed, 22 insertions, 17 deletions
diff --git a/sc/source/ui/sidebar/CellBorderUpdater.cxx b/sc/source/ui/sidebar/CellBorderUpdater.cxx
index 3f06f92eb7b8..394835ff4d57 100644
--- a/sc/source/ui/sidebar/CellBorderUpdater.cxx
+++ b/sc/source/ui/sidebar/CellBorderUpdater.cxx
@@ -39,29 +39,34 @@ CellBorderUpdater::~CellBorderUpdater()
void CellBorderUpdater::UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool bRight, Image const & aImg, bool bVer, bool bHor)
{
const Size aBmpSize = aImg.GetBitmapEx().GetSizePixel();
- if(aBmpSize.Width() != 43 || aBmpSize.Height() != 43)
- return;
- ScopedVclPtr<VirtualDevice> pVirDev(VclPtr<VirtualDevice>::Create());
+ ScopedVclPtr<VirtualDevice> pVirDev(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(),
+ DeviceFormat::DEFAULT, DeviceFormat::DEFAULT));
pVirDev->SetOutputSizePixel(aBmpSize);
+ pVirDev->SetBackground(COL_TRANSPARENT);
+ pVirDev->Erase();
pVirDev->SetLineColor( ::Application::GetSettings().GetStyleSettings().GetFieldTextColor() ) ;
pVirDev->SetFillColor(COL_BLACK);
- Point aTL(2, 1), aTR(42,1), aBL(2, 41), aBR(42, 41), aHL(2,21), aHR(42, 21), aVT(22,1), aVB(22, 41);
- if(bLeft)
- pVirDev->DrawLine( aTL,aBL );
- if(bRight)
- pVirDev->DrawLine( aTR,aBR );
- if(bTop)
- pVirDev->DrawLine( aTL,aTR );
- if(bBot)
- pVirDev->DrawLine( aBL,aBR );
- if(bVer)
- pVirDev->DrawLine( aVT,aVB );
- if(bHor)
- pVirDev->DrawLine( aHL,aHR );
+ if(aBmpSize.Width() == 43 && aBmpSize.Height() == 43)
+ {
+ Point aTL(2, 1), aTR(42,1), aBL(2, 41), aBR(42, 41), aHL(2,21), aHR(42, 21), aVT(22,1), aVB(22, 41);
+ if(bLeft)
+ pVirDev->DrawLine( aTL,aBL );
+ if(bRight)
+ pVirDev->DrawLine( aTR,aBR );
+ if(bTop)
+ pVirDev->DrawLine( aTL,aTR );
+ if(bBot)
+ pVirDev->DrawLine( aBL,aBR );
+ if(bVer)
+ pVirDev->DrawLine( aVT,aVB );
+ if(bHor)
+ pVirDev->DrawLine( aHL,aHR );
+ mrTbx.SetItemOverlayImage( mnBtnId, Image( pVirDev->GetBitmapEx(Point(0,0), aBmpSize) ) );
+ }
- mrTbx.SetItemOverlayImage( mnBtnId, Image( pVirDev->GetBitmapEx(Point(0,0), aBmpSize) ) );
+ mrTbx.SetItemImage( mnBtnId, aImg );
}
} } // end of namespace svx::sidebar