diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-19 13:35:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-20 12:55:07 +0200 |
commit | 8270eb5d5600cc84dbf5f0e339f90c4519ef88bb (patch) | |
tree | 6253324edd37e5b13c17436a6378ee58ba6a723b /vcl/source | |
parent | 4f3dd930324552aec40b333d750ec7b95ff03c26 (diff) |
loplugin:unusedmethods
Change-Id: Ief95f111350808f010539bb733a553007d30a9df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152006
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/svapp.cxx | 10 | ||||
-rw-r--r-- | vcl/source/bitmap/alpha.cxx | 7 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmappaint.cxx | 75 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 18 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter2.cxx | 1 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter_internal.hxx | 27 |
6 files changed, 0 insertions, 138 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index c61d9ea0f2aa..6ee03f1ed9d4 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -307,16 +307,6 @@ IMPL_STATIC_LINK_NOARG( ImplSVAppData, ImplEndAllDialogsMsg, void*, void ) } } -void Application::EndAllDialogs() -{ - Application::PostUserEvent( LINK( nullptr, ImplSVAppData, ImplEndAllDialogsMsg ) ); -} - -void Application::EndAllPopups() -{ - Application::PostUserEvent( LINK( nullptr, ImplSVAppData, ImplEndAllPopupsMsg ) ); -} - void Application::notifyWindow(vcl::LOKWindowId /*nLOKWindowId*/, const OUString& /*rAction*/, const std::vector<vcl::LOKPayloadItem>& /*rPayload = std::vector<LOKPayloadItem>()*/) const diff --git a/vcl/source/bitmap/alpha.cxx b/vcl/source/bitmap/alpha.cxx index ab23c3e93427..f307dda63a28 100644 --- a/vcl/source/bitmap/alpha.cxx +++ b/vcl/source/bitmap/alpha.cxx @@ -63,13 +63,6 @@ const Bitmap& AlphaMask::ImplGetBitmap() const return *this; } -void AlphaMask::ImplSetBitmap( const Bitmap& rBitmap ) -{ - SAL_WARN_IF(rBitmap.getPixelFormat() != vcl::PixelFormat::N8_BPP, "vcl.gdi", "Bitmap should be 8bpp, not " << vcl::pixelFormatBitCount(rBitmap.getPixelFormat()) << "bpp" ); - SAL_WARN_IF( !rBitmap.HasGreyPalette8Bit(), "vcl.gdi", "Bitmap isn't greyscale" ); - *static_cast<Bitmap*>(this) = rBitmap; -} - Bitmap const & AlphaMask::GetBitmap() const { return ImplGetBitmap(); diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index 388dbe89c57b..f454aa97affa 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -706,81 +706,6 @@ vcl::Region Bitmap::CreateRegion(const Color& rColor, const tools::Rectangle& rR return aRegion; } -bool Bitmap::Replace(const Bitmap& rMask, const Color& rReplaceColor) -{ - ScopedReadAccess pMaskAcc(const_cast<Bitmap&>(rMask)); - BitmapScopedWriteAccess pAcc(*this); - - if (!pMaskAcc || !pAcc) - return false; - - const tools::Long nWidth = std::min(pMaskAcc->Width(), pAcc->Width()); - const tools::Long nHeight = std::min(pMaskAcc->Height(), pAcc->Height()); - const BitmapColor aMaskWhite(pMaskAcc->GetBestMatchingColor(COL_WHITE)); - BitmapColor aReplace; - - if (pAcc->HasPalette()) - { - const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount(); - const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount(); - - // default to the nearest color - aReplace = pAcc->GetBestMatchingColor(rReplaceColor); - - // for paletted images without a matching palette entry - // look for an unused palette entry (NOTE: expensive!) - if (pAcc->GetPaletteColor(aReplace.GetIndex()) != BitmapColor(rReplaceColor)) - { - // if the palette has empty entries use the last one - if (nActColors < nMaxColors) - { - pAcc->SetPaletteEntryCount(nActColors + 1); - pAcc->SetPaletteColor(nActColors, rReplaceColor); - aReplace = BitmapColor(static_cast<sal_uInt8>(nActColors)); - } - else - { - std::unique_ptr<bool[]> pFlags(new bool[nMaxColors]); - - // Set all entries to false - std::fill(pFlags.get(), pFlags.get() + nMaxColors, false); - - for (tools::Long nY = 0; nY < nHeight; nY++) - { - Scanline pScanline = pAcc->GetScanline(nY); - for (tools::Long nX = 0; nX < nWidth; nX++) - pFlags[pAcc->GetIndexFromData(pScanline, nX)] = true; - } - - for (sal_uInt16 i = 0; i < nMaxColors; i++) - { - // Hurray, we do have an unused entry - if (!pFlags[i]) - { - pAcc->SetPaletteColor(i, rReplaceColor); - aReplace = BitmapColor(static_cast<sal_uInt8>(i)); - } - } - } - } - } - else - aReplace = rReplaceColor; - - for (tools::Long nY = 0; nY < nHeight; nY++) - { - Scanline pScanline = pAcc->GetScanline(nY); - Scanline pScanlineMask = pMaskAcc->GetScanline(nY); - for (tools::Long nX = 0; nX < nWidth; nX++) - { - if (pMaskAcc->GetPixelFromData(pScanlineMask, nX) == aMaskWhite) - pAcc->SetPixelOnData(pScanline, nX, aReplace); - } - } - - return true; -} - bool Bitmap::Replace(const AlphaMask& rAlpha, const Color& rMergeColor) { Bitmap aNewBmp(GetSizePixel(), vcl::PixelFormat::N24_BPP); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 2cbe95e50194..441d32a28adf 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -89,7 +89,6 @@ #include <vcl/TypeSerializer.hxx> #include "FilterConfigCache.hxx" -#include "graphicfilter_internal.hxx" #include <graphic/GraphicFormatDetector.hxx> #include <graphic/GraphicReader.hxx> @@ -141,23 +140,6 @@ public: // Helper functions -sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8 const * pDest, sal_uLong nComp, sal_uLong nSize ) -{ - while ( nComp-- >= nSize ) - { - sal_uLong i; - for ( i = 0; i < nSize; i++ ) - { - if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) ) - break; - } - if ( i == nSize ) - return pSource; - pSource++; - } - return nullptr; -} - static OUString ImpGetExtension( std::u16string_view rPath ) { OUString aExt; diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index fa5c25e30c93..1beeeaa3e8ac 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -26,7 +26,6 @@ #include <vcl/graphicfilter.hxx> #include <unotools/ucbstreamhelper.hxx> #include <graphic/GraphicFormatDetector.hxx> -#include "graphicfilter_internal.hxx" namespace { diff --git a/vcl/source/filter/graphicfilter_internal.hxx b/vcl/source/filter/graphicfilter_internal.hxx deleted file mode 100644 index e7afbaf8cb79..000000000000 --- a/vcl/source/filter/graphicfilter_internal.hxx +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include <tools/solar.h> -#include <tools/stream.hxx> - -sal_uInt8* ImplSearchEntry(sal_uInt8*, sal_uInt8 const*, sal_uLong, sal_uLong); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |