From 46d3163f779a43cc7c023a6e8141f990e5d23292 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 22 Dec 2016 14:32:22 +0200 Subject: loplugin:unusedmethods Change-Id: Ife4c8d948ffa116f044d43903de9485e43cfcae5 Reviewed-on: https://gerrit.libreoffice.org/32336 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/unx/generic/glyphs/freetype_glyphcache.cxx | 53 -------------------------- vcl/unx/generic/print/common_gfx.cxx | 19 --------- vcl/unx/generic/print/glyphset.hxx | 4 +- vcl/unx/generic/print/psputil.cxx | 28 -------------- vcl/unx/generic/print/psputil.hxx | 6 +-- 5 files changed, 2 insertions(+), 108 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index cc5683c93a60..ca84009d81d1 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -454,59 +454,6 @@ FreetypeFont::FreetypeFont( const FontSelectPattern& rFSD, FreetypeFontInfo* pFI mnLoadFlags |= FT_LOAD_NO_BITMAP; } -void FreetypeFont::SetFontOptions(const std::shared_ptr& xFontOptions) -{ - mxFontOptions = xFontOptions; - - if (!mxFontOptions) - return; - - FontAutoHint eHint = mxFontOptions->GetUseAutoHint(); - if( eHint == FontAutoHint::DontKnow ) - eHint = mbUseGamma ? FontAutoHint::Yes : FontAutoHint::No; - - if( eHint == FontAutoHint::Yes ) - mnLoadFlags |= FT_LOAD_FORCE_AUTOHINT; - - if( (mnSin != 0) && (mnCos != 0) ) // hinting for 0/90/180/270 degrees only - mnLoadFlags |= FT_LOAD_NO_HINTING; - mnLoadFlags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; - - if (mxFontOptions->DontUseAntiAlias()) - mnPrioAntiAlias = 0; - if (mxFontOptions->DontUseEmbeddedBitmaps()) - mnPrioEmbedded = 0; - if (mxFontOptions->DontUseHinting()) - mnPrioAutoHint = 0; - - if( mnPrioAutoHint <= 0 ) - mnLoadFlags |= FT_LOAD_NO_HINTING; - -#if defined(FT_LOAD_TARGET_LIGHT) && defined(FT_LOAD_TARGET_NORMAL) - if( !(mnLoadFlags & FT_LOAD_NO_HINTING) ) - { - mnLoadFlags |= FT_LOAD_TARGET_NORMAL; - switch (mxFontOptions->GetHintStyle()) - { - case FontHintStyle::NONE: - mnLoadFlags |= FT_LOAD_NO_HINTING; - break; - case FontHintStyle::Slight: - mnLoadFlags |= FT_LOAD_TARGET_LIGHT; - break; - case FontHintStyle::Medium: - break; - case FontHintStyle::Full: - default: - break; - } - } -#endif - - if( mnPrioEmbedded <= 0 ) - mnLoadFlags |= FT_LOAD_NO_BITMAP; -} - namespace { FontConfigFontOptions* GetFCFontOptions( const FontAttributes& rFontAttributes, int nSize) diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx index d8b199b708b4..d6e0508f451e 100644 --- a/vcl/unx/generic/print/common_gfx.cxx +++ b/vcl/unx/generic/print/common_gfx.cxx @@ -1052,25 +1052,6 @@ PrinterGfx::PSShowGlyph (const unsigned char nGlyphId) PSGRestore (); } -void -PrinterGfx::PSComment( const sal_Char* pComment ) -{ - const sal_Char* pLast = pComment; - while( pComment && *pComment ) - { - while( *pComment && *pComment != '\n' && *pComment != '\r' ) - pComment++; - if( pComment - pLast > 1 ) - { - WritePS( mpPageBody, "% ", 2 ); - WritePS( mpPageBody, pLast, pComment - pLast ); - WritePS( mpPageBody, "\n", 1 ); - } - if( *pComment ) - pLast = ++pComment; - } -} - bool PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize ) { diff --git a/vcl/unx/generic/print/glyphset.hxx b/vcl/unx/generic/print/glyphset.hxx index 01ae3488c8d0..c7b023cc2610 100644 --- a/vcl/unx/generic/print/glyphset.hxx +++ b/vcl/unx/generic/print/glyphset.hxx @@ -70,9 +70,7 @@ public: static OString GetReencodedFontName (rtl_TextEncoding nEnc, const OString &rFontName); - static OString - GetGlyphSetEncodingName (rtl_TextEncoding nEnc, - const OString &rFontName); + bool IsVertical () { return mbVertical;} void DrawGlyph (PrinterGfx& rGfx, diff --git a/vcl/unx/generic/print/psputil.cxx b/vcl/unx/generic/print/psputil.cxx index 53b94c465e99..5c68bf687781 100644 --- a/vcl/unx/generic/print/psputil.cxx +++ b/vcl/unx/generic/print/psputil.cxx @@ -208,29 +208,6 @@ ConverterFactory::Get (rtl_TextEncoding nEncoding) return nullptr; } -// wrapper for rtl_convertUnicodeToText that handles the usual cases for -// textconversion in drawtext -std::size_t -ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen, - unsigned char *pBuffer, std::size_t nBufferSize, rtl_TextEncoding nEncoding) -{ - const sal_uInt32 nCvtFlags = RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK - | RTL_UNICODETOTEXT_FLAGS_INVALID_QUESTIONMARK ; - sal_uInt32 nCvtInfo; - sal_Size nCvtChars; - - rtl_UnicodeToTextConverter aConverter = Get (nEncoding); - rtl_UnicodeToTextContext aContext = rtl_createUnicodeToTextContext (aConverter); - - sal_Size nSize = rtl_convertUnicodeToText (aConverter, aContext, - pText, nTextLen, reinterpret_cast(pBuffer), nBufferSize, - nCvtFlags, &nCvtInfo, &nCvtChars); - - rtl_destroyUnicodeToTextContext (aConverter, aContext); - - return nSize; -} - namespace { class theConverterFactory @@ -239,11 +216,6 @@ namespace }; } -ConverterFactory& GetConverterFactory() -{ - return theConverterFactory::get(); -} - } /* namespace psp */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/print/psputil.hxx b/vcl/unx/generic/print/psputil.hxx index b035de16aafe..8cdd337eff21 100644 --- a/vcl/unx/generic/print/psputil.hxx +++ b/vcl/unx/generic/print/psputil.hxx @@ -53,16 +53,12 @@ public: ConverterFactory(); ~ConverterFactory(); rtl_UnicodeToTextConverter Get (rtl_TextEncoding nEncoding); - std::size_t Convert (const sal_Unicode *pText, int nTextLen, - unsigned char *pBuffer, std::size_t nBufferSize, - rtl_TextEncoding nEncoding); + private: std::map< rtl_TextEncoding, rtl_UnicodeToTextConverter > m_aConverters; }; -ConverterFactory& GetConverterFactory (); - } /* namespace psp */ #endif // INCLUDED_VCL_GENERIC_PRINT_PSPUTIL_HXX -- cgit