vcl/source/bitmap/bitmappaint.cxx |   65 --------------------------------------
 1 file changed, 1 insertion(+), 64 deletions(-)

New commits:
commit eb959d4a964e973ea1cf4b066f6007878c22fcf5
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Mon Jun 29 21:09:43 2020 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Wed Jul 1 07:35:49 2020 +0200

    avoid Bitmap::Erase() duplicating code
    
    Change-Id: I68d388175355fe1fcf5acc300730e8473fa559fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97486
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/vcl/source/bitmap/bitmappaint.cxx 
b/vcl/source/bitmap/bitmappaint.cxx
index 5c14e1476aca..22ddf2ea5e6b 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -41,70 +41,7 @@ bool Bitmap::Erase(const Color& rFillColor)
 
     if (pWriteAcc)
     {
-        const ScanlineFormat nFormat = pWriteAcc->GetScanlineFormat();
-        sal_uInt8 cIndex = 0;
-        bool bFast = false;
-
-        switch (nFormat)
-        {
-            case ScanlineFormat::N1BitMsbPal:
-            case ScanlineFormat::N1BitLsbPal:
-            {
-                cIndex = 
static_cast<sal_uInt8>(pWriteAcc->GetBestPaletteIndex(rFillColor));
-                cIndex = (cIndex ? 255 : 0);
-                bFast = true;
-            }
-            break;
-
-            case ScanlineFormat::N4BitMsnPal:
-            case ScanlineFormat::N4BitLsnPal:
-            {
-                cIndex = 
static_cast<sal_uInt8>(pWriteAcc->GetBestPaletteIndex(rFillColor));
-                cIndex = cIndex | (cIndex << 4);
-                bFast = true;
-            }
-            break;
-
-            case ScanlineFormat::N8BitPal:
-            {
-                cIndex = 
static_cast<sal_uInt8>(pWriteAcc->GetBestPaletteIndex(rFillColor));
-                bFast = true;
-            }
-            break;
-
-            case ScanlineFormat::N24BitTcBgr:
-            case ScanlineFormat::N24BitTcRgb:
-            {
-                if (rFillColor.GetRed() == rFillColor.GetGreen()
-                    && rFillColor.GetRed() == rFillColor.GetBlue())
-                {
-                    cIndex = rFillColor.GetRed();
-                    bFast = true;
-                }
-                else
-                {
-                    bFast = false;
-                }
-            }
-            break;
-
-            default:
-                bFast = false;
-                break;
-        }
-
-        if (bFast)
-        {
-            const sal_uLong nBufSize = pWriteAcc->GetScanlineSize() * 
pWriteAcc->Height();
-            memset(pWriteAcc->GetBuffer(), cIndex, nBufSize);
-        }
-        else
-        {
-            const tools::Rectangle aRect(Point(), Size(pWriteAcc->Width(), 
pWriteAcc->Height()));
-            pWriteAcc->SetFillColor(rFillColor);
-            pWriteAcc->FillRect(aRect);
-        }
-
+        pWriteAcc->Erase(rFillColor);
         bRet = true;
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to