[Libreoffice-commits] core.git: sc/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Apr 5 19:39:45 UTC 2018


 sc/source/ui/sidebar/CellBorderUpdater.cxx |   39 ++++++++++++++++-------------
 1 file changed, 22 insertions(+), 17 deletions(-)

New commits:
commit ad0d1db3ce862ef74a7a1849b821f5010f9ba3fd
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Apr 5 17:19:45 2018 +0200

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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


More information about the Libreoffice-commits mailing list