summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-25 20:53:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-27 12:53:09 +0200
commit726b6b1ce644705e551b62e3e046209eded968b9 (patch)
tree63fe9514599caeaaeb24468bb7d76125cccc35e1
parentc688b01d9102832226251fc84045408afe392459 (diff)
loplugin:unusedmethods
Change-Id: I360ed9c98a42026f6f3894e93f89be39080af6b5 Reviewed-on: https://gerrit.libreoffice.org/53542 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--accessibility/inc/standard/vclxaccessibletoolbox.hxx1
-rw-r--r--include/filter/msfilter/svdfppt.hxx1
-rw-r--r--include/svx/sdr/contact/viewcontact.hxx3
-rw-r--r--include/svx/txencbox.hxx2
-rw-r--r--include/vcl/BitmapMedianColorQuantizationFilter.hxx49
-rw-r--r--svx/source/dialog/txencbox.cxx9
-rw-r--r--vcl/Library_vcl.mk1
-rw-r--r--vcl/inc/headless/svpgdi.hxx1
-rw-r--r--vcl/source/bitmap/BitmapMedianColorQuantizationFilter.cxx300
9 files changed, 0 insertions, 367 deletions
diff --git a/accessibility/inc/standard/vclxaccessibletoolbox.hxx b/accessibility/inc/standard/vclxaccessibletoolbox.hxx
index 192445291065..b739463ec289 100644
--- a/accessibility/inc/standard/vclxaccessibletoolbox.hxx
+++ b/accessibility/inc/standard/vclxaccessibletoolbox.hxx
@@ -54,7 +54,6 @@ private:
void HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent );
void ReleaseSubToolBox( ToolBox* _pSubToolBox );
sal_Int32 implGetAccessibleChildCount();
- sal_Int32 implGetSelectedAccessibleChildCount();
virtual ~VCLXAccessibleToolBox() override;
diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx
index 1103bc56d3b5..3ce61ea3d0b4 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -484,7 +484,6 @@ public:
virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPageCapsule pPage ) const;
virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, tools::Rectangle& rTextRect, SdrObject* pObj ) override;
virtual void NotifyFreeObj(void* pData, SdrObject* pObj) override;
- void FreeObj(void* pData, SdrObject* pObj);
virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* pData, DffObjData& rObj ) override;
void ImportHeaderFooterContainer( DffRecordHeader const & rHeader, HeaderFooterEntry& rEntry );
};
diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx
index 0912d47dbf90..aeb82f04cd33 100644
--- a/include/svx/sdr/contact/viewcontact.hxx
+++ b/include/svx/sdr/contact/viewcontact.hxx
@@ -79,9 +79,6 @@ protected:
// asserted there
virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const;
- // method for flushing View Independent Primitive2DContainer for VOC implementations
- void flushViewIndependentPrimitive2DSequence() { mxViewIndependentPrimitive2DSequence.clear(); }
-
// basic constructor. Since this is a base class only, it shall
// never be called directly
ViewContact();
diff --git a/include/svx/txencbox.hxx b/include/svx/txencbox.hxx
index f7db496394f8..4555b7d338da 100644
--- a/include/svx/txencbox.hxx
+++ b/include/svx/txencbox.hxx
@@ -118,8 +118,6 @@ public:
bool bExcludeImportSubsets
);
- void InsertTextEncoding( const rtl_TextEncoding nEnc );
-
void InsertTextEncoding( const rtl_TextEncoding nEnc,
const OUString& rEntry );
diff --git a/include/vcl/BitmapMedianColorQuantizationFilter.hxx b/include/vcl/BitmapMedianColorQuantizationFilter.hxx
deleted file mode 100644
index c15b0ac80ac7..000000000000
--- a/include/vcl/BitmapMedianColorQuantizationFilter.hxx
+++ /dev/null
@@ -1,49 +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/.
- *
- */
-
-#ifndef INCLUDED_INCLUDE_VCL_BITMAPMEDIANCOLORQUANTIZATIONFILTER_HXX
-#define INCLUDED_INCLUDE_VCL_BITMAPMEDIANCOLORQUANTIZATIONFILTER_HXX
-
-#include <tools/color.hxx>
-
-#include <vcl/BitmapFilter.hxx>
-
-#define RGB15(_def_cR, _def_cG, _def_cB) \
- ((static_cast<sal_uLong>(_def_cR) << 10) | (static_cast<sal_uLong>(_def_cG) << 5) \
- | static_cast<sal_uLong>(_def_cB))
-#define GAMMA(_def_cVal, _def_InvGamma) \
- (static_cast<sal_uInt8>(MinMax(FRound(pow(_def_cVal / 255.0, _def_InvGamma) * 255.0), 0, 255)))
-
-class VCL_DLLPUBLIC BitmapMedianColorQuantizationFilter : public BitmapFilter
-{
-public:
- /** Reduce number of colors for the bitmap using the median algorithm
-
- @param nNewColorCount
- Maximal number of bitmap colors after the reduce operation
- */
- BitmapMedianColorQuantizationFilter(sal_uInt16 nNewColorCount)
- : mnNewColorCount(nNewColorCount)
- {
- }
-
- virtual BitmapEx execute(BitmapEx const& rBitmapEx) override;
-
-private:
- sal_uInt16 mnNewColorCount;
-
- void medianCut(Bitmap& rBitmap, sal_uLong* pColBuf, BitmapPalette& rPal, long nR1, long nR2,
- long nG1, long nG2, long nB1, long nB2, long nColors, long nPixels,
- long& rIndex);
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx
index 448b6aa14912..e4ba0b09a9d3 100644
--- a/svx/source/dialog/txencbox.cxx
+++ b/svx/source/dialog/txencbox.cxx
@@ -267,15 +267,6 @@ void TextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc,
m_xControl->append(OUString::number(nEnc), rEntry);
}
-void TextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc )
-{
- const OUString& rEntry = SvxTextEncodingTable::GetTextString(nEnc);
- if (!rEntry.isEmpty())
- InsertTextEncoding( nEnc, rEntry );
- else
- SAL_WARN( "svx.dialog", "TextEncodingBox::InsertTextEncoding: no resource string for text encoding: " << static_cast<sal_Int32>( nEnc ) );
-}
-
rtl_TextEncoding TextEncodingBox::GetSelectTextEncoding() const
{
OUString sId(m_xControl->get_active_id());
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 6d21dc36302f..2669db6003eb 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -335,7 +335,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/bitmap/BitmapSymmetryCheck \
vcl/source/bitmap/BitmapColorQuantizationFilter \
vcl/source/bitmap/BitmapSimpleColorQuantizationFilter \
- vcl/source/bitmap/BitmapMedianColorQuantizationFilter \
vcl/source/bitmap/BitmapTools \
vcl/source/bitmap/checksum \
vcl/source/image/Image \
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 7569476c1600..2576feb0f60f 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -239,7 +239,6 @@ public:
cairo_t* getCairoContext(bool bXorModeAllowed) const;
void releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, const basegfx::B2DRange& rExtents) const;
static cairo_surface_t* createCairoSurface(const BitmapBuffer *pBuffer);
- double getScale() const { return m_fScale; }
void clipRegion(cairo_t* cr);
};
diff --git a/vcl/source/bitmap/BitmapMedianColorQuantizationFilter.cxx b/vcl/source/bitmap/BitmapMedianColorQuantizationFilter.cxx
deleted file mode 100644
index 807e8a049a13..000000000000
--- a/vcl/source/bitmap/BitmapMedianColorQuantizationFilter.cxx
+++ /dev/null
@@ -1,300 +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/.
- *
- */
-
-#include <vcl/bitmap.hxx>
-#include <vcl/bitmapex.hxx>
-#include <vcl/bitmapaccess.hxx>
-#include <vcl/BitmapMedianColorQuantizationFilter.hxx>
-
-#include <bitmapwriteaccess.hxx>
-#include <impoctree.hxx>
-
-#include <cstdlib>
-
-BitmapEx BitmapMedianColorQuantizationFilter::execute(BitmapEx const& aBitmapEx)
-{
- Bitmap aBitmap = aBitmapEx.GetBitmap();
-
- bool bRet = false;
-
- if (aBitmap.GetColorCount() <= static_cast<sal_uLong>(mnNewColorCount))
- {
- bRet = true;
- }
- else
- {
- Bitmap::ScopedReadAccess pRAcc(aBitmap);
- sal_uInt16 nBitCount;
-
- if (mnNewColorCount < 17)
- {
- nBitCount = 4;
- }
- else if (mnNewColorCount < 257)
- {
- nBitCount = 8;
- }
- else
- {
- OSL_FAIL("Bitmap::ImplReduceMedian(): invalid color count!");
- nBitCount = 8;
- mnNewColorCount = 256;
- }
-
- if (pRAcc)
- {
- Bitmap aNewBmp(aBitmap.GetSizePixel(), nBitCount);
- BitmapScopedWriteAccess pWAcc(aNewBmp);
-
- if (pWAcc)
- {
- const sal_uLong nSize = 32768 * sizeof(sal_uLong);
- sal_uLong* pColBuf = static_cast<sal_uLong*>(rtl_allocateMemory(nSize));
- const long nWidth = pWAcc->Width();
- const long nHeight = pWAcc->Height();
- long nIndex = 0;
-
- memset(pColBuf, 0, nSize);
-
- // create Buffer
- if (pRAcc->HasPalette())
- {
- for (long nY = 0; nY < nHeight; nY++)
- {
- Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
- {
- const BitmapColor& rCol = pRAcc->GetPaletteColor(
- pRAcc->GetIndexFromData(pScanlineRead, nX));
-
- pColBuf[RGB15(rCol.GetRed() >> 3, rCol.GetGreen() >> 3,
- rCol.GetBlue() >> 3)]++;
- }
- }
- }
- else
- {
- for (long nY = 0; nY < nHeight; nY++)
- {
- Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
- {
- const BitmapColor aCol(pRAcc->GetPixelFromData(pScanlineRead, nX));
- pColBuf[RGB15(aCol.GetRed() >> 3, aCol.GetGreen() >> 3,
- aCol.GetBlue() >> 3)]++;
- }
- }
- }
-
- // create palette via median cut
- BitmapPalette aPal(pWAcc->GetPaletteEntryCount());
- medianCut(aBitmap, pColBuf, aPal, 0, 31, 0, 31, 0, 31, mnNewColorCount,
- nWidth * nHeight, nIndex);
-
- // do mapping of colors to palette
- InverseColorMap aMap(aPal);
- pWAcc->SetPalette(aPal);
- for (long nY = 0; nY < nHeight; nY++)
- {
- Scanline pScanline = pWAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
- {
- pWAcc->SetPixelOnData(
- pScanline, nX,
- BitmapColor(static_cast<sal_uInt8>(
- aMap.GetBestPaletteIndex(pRAcc->GetColor(nY, nX)))));
- }
- }
-
- rtl_freeMemory(pColBuf);
- pWAcc.reset();
- bRet = true;
- }
-
- pRAcc.reset();
- if (bRet)
- {
- const MapMode aMap(aBitmap.GetPrefMapMode());
- const Size aSize(aBitmap.GetPrefSize());
-
- aBitmap = aNewBmp;
-
- aBitmap.SetPrefMapMode(aMap);
- aBitmap.SetPrefSize(aSize);
- }
- }
- }
-
- if (bRet)
- return BitmapEx(aBitmap);
-
- return BitmapEx();
-}
-
-void BitmapMedianColorQuantizationFilter::medianCut(Bitmap& rBitmap, sal_uLong* pColBuf,
- BitmapPalette& rPal, long nR1, long nR2,
- long nG1, long nG2, long nB1, long nB2,
- long nColors, long nPixels, long& rIndex)
-{
- if (!nPixels)
- return;
-
- BitmapColor aCol;
- const long nRLen = nR2 - nR1;
- const long nGLen = nG2 - nG1;
- const long nBLen = nB2 - nB1;
- sal_uLong* pBuf = pColBuf;
-
- if (!nRLen && !nGLen && !nBLen)
- {
- if (pBuf[RGB15(nR1, nG1, nB1)])
- {
- aCol.SetRed(static_cast<sal_uInt8>(nR1 << 3));
- aCol.SetGreen(static_cast<sal_uInt8>(nG1 << 3));
- aCol.SetBlue(static_cast<sal_uInt8>(nB1 << 3));
- rPal[static_cast<sal_uInt16>(rIndex++)] = aCol;
- }
- }
- else
- {
- if (nColors == 1 || nPixels == 1)
- {
- long nPixSum = 0, nRSum = 0, nGSum = 0, nBSum = 0;
-
- for (long nR = nR1; nR <= nR2; nR++)
- {
- for (long nG = nG1; nG <= nG2; nG++)
- {
- for (long nB = nB1; nB <= nB2; nB++)
- {
- nPixSum = pBuf[RGB15(nR, nG, nB)];
-
- if (nPixSum)
- {
- nRSum += nR * nPixSum;
- nGSum += nG * nPixSum;
- nBSum += nB * nPixSum;
- }
- }
- }
- }
-
- aCol.SetRed(static_cast<sal_uInt8>((nRSum / nPixels) << 3));
- aCol.SetGreen(static_cast<sal_uInt8>((nGSum / nPixels) << 3));
- aCol.SetBlue(static_cast<sal_uInt8>((nBSum / nPixels) << 3));
- rPal[static_cast<sal_uInt16>(rIndex++)] = aCol;
- }
- else
- {
- const long nTest = (nPixels >> 1);
- long nPixOld = 0;
- long nPixNew = 0;
-
- if (nBLen > nGLen && nBLen > nRLen)
- {
- long nB = nB1 - 1;
-
- while (nPixNew < nTest)
- {
- nB++;
- nPixOld = nPixNew;
- for (long nR = nR1; nR <= nR2; nR++)
- {
- for (long nG = nG1; nG <= nG2; nG++)
- {
- nPixNew += pBuf[RGB15(nR, nG, nB)];
- }
- }
- }
-
- if (nB < nB2)
- {
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG1, nG2, nB1, nB, nColors >> 1,
- nPixNew, rIndex);
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG1, nG2, nB + 1, nB2, nColors >> 1,
- nPixels - nPixNew, rIndex);
- }
- else
- {
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG1, nG2, nB1, nB - 1, nColors >> 1,
- nPixOld, rIndex);
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG1, nG2, nB, nB2, nColors >> 1,
- nPixels - nPixOld, rIndex);
- }
- }
- else if (nGLen > nRLen)
- {
- long nG = nG1 - 1;
-
- while (nPixNew < nTest)
- {
- nG++;
- nPixOld = nPixNew;
- for (long nR = nR1; nR <= nR2; nR++)
- {
- for (long nB = nB1; nB <= nB2; nB++)
- {
- nPixNew += pBuf[RGB15(nR, nG, nB)];
- }
- }
- }
-
- if (nG < nG2)
- {
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG1, nG, nB1, nB2, nColors >> 1,
- nPixNew, rIndex);
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG + 1, nG2, nB1, nB2, nColors >> 1,
- nPixels - nPixNew, rIndex);
- }
- else
- {
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG1, nG - 1, nB1, nB2, nColors >> 1,
- nPixOld, rIndex);
- medianCut(rBitmap, pBuf, rPal, nR1, nR2, nG, nG2, nB1, nB2, nColors >> 1,
- nPixels - nPixOld, rIndex);
- }
- }
- else
- {
- long nR = nR1 - 1;
-
- while (nPixNew < nTest)
- {
- nR++;
- nPixOld = nPixNew;
- for (long nG = nG1; nG <= nG2; nG++)
- {
- for (long nB = nB1; nB <= nB2; nB++)
- {
- nPixNew += pBuf[RGB15(nR, nG, nB)];
- }
- }
- }
-
- if (nR < nR2)
- {
- medianCut(rBitmap, pBuf, rPal, nR1, nR, nG1, nG2, nB1, nB2, nColors >> 1,
- nPixNew, rIndex);
- medianCut(rBitmap, pBuf, rPal, nR1 + 1, nR2, nG1, nG2, nB1, nB2, nColors >> 1,
- nPixels - nPixNew, rIndex);
- }
- else
- {
- medianCut(rBitmap, pBuf, rPal, nR1, nR - 1, nG1, nG2, nB1, nB2, nColors >> 1,
- nPixOld, rIndex);
- medianCut(rBitmap, pBuf, rPal, nR, nR2, nG1, nG2, nB1, nB2, nColors >> 1,
- nPixels - nPixOld, rIndex);
- }
- }
- }
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */