diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-07 15:57:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-11 08:51:23 +0200 |
commit | a901e48579e203a28cc0871ceed0356ae6a5798b (patch) | |
tree | 6186461f1e95c929a404db49b90da92c53746242 | |
parent | a49440b1c4a7cd831212e2e3c19f89ce12a4e889 (diff) |
drop PhysicalFontFace::Clone
since we are now holding these via reference counting, no need to clone
them
Change-Id: I7b0bd86f4a5bca428f7dcd989f838a9aa0c7e179
Reviewed-on: https://gerrit.libreoffice.org/55427
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | vcl/inc/PhysicalFontFace.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/qt5/Qt5FontFace.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 4 | ||||
-rw-r--r-- | vcl/inc/unx/freetype_glyphcache.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 1 | ||||
-rw-r--r-- | vcl/qt5/Qt5FontFace.cxx | 2 | ||||
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 6 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 8 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontFace.cxx | 8 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontFamily.cxx | 10 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/generic/print/genpspgraphics.cxx | 1 | ||||
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 5 |
13 files changed, 2 insertions, 48 deletions
diff --git a/vcl/inc/PhysicalFontFace.hxx b/vcl/inc/PhysicalFontFace.hxx index e289345716ca..c350a6c81649 100644 --- a/vcl/inc/PhysicalFontFace.hxx +++ b/vcl/inc/PhysicalFontFace.hxx @@ -55,7 +55,6 @@ class VCL_PLUGIN_PUBLIC PhysicalFontFace : public FontAttributes, public salhelp { public: virtual rtl::Reference<LogicalFontInstance> CreateFontInstance(const FontSelectPattern&) const; - virtual rtl::Reference<PhysicalFontFace> Clone() const = 0; int GetHeight() const { return mnHeight; } int GetWidth() const { return mnWidth; } @@ -67,7 +66,6 @@ public: protected: explicit PhysicalFontFace(const FontAttributes&); - PhysicalFontFace(const PhysicalFontFace&); void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; } long mnWidth; // Width (in pixels) diff --git a/vcl/inc/qt5/Qt5FontFace.hxx b/vcl/inc/qt5/Qt5FontFace.hxx index 0e1a359acbb5..3c94f46777e1 100644 --- a/vcl/inc/qt5/Qt5FontFace.hxx +++ b/vcl/inc/qt5/Qt5FontFace.hxx @@ -38,7 +38,6 @@ public: static Qt5FontFace* fromQFont(const QFont& rFont); - rtl::Reference<PhysicalFontFace> Clone() const override; sal_IntPtr GetFontId() const override; int GetFontTable(const char pTagName[5], unsigned char*) const; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 1dd896058890..92b7b0349673 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -61,7 +61,6 @@ public: CoreTextFontFace( const FontAttributes&, sal_IntPtr nFontID ); virtual ~CoreTextFontFace() override; - rtl::Reference<PhysicalFontFace> Clone() const override; sal_IntPtr GetFontId() const override; int GetFontTable( uint32_t nTagCode, unsigned char* ) const; @@ -73,9 +72,6 @@ public: rtl::Reference<LogicalFontInstance> CreateFontInstance(const FontSelectPattern&) const override; -protected: - CoreTextFontFace( const CoreTextFontFace& ); - private: const sal_IntPtr mnFontId; mutable FontCharMapRef mxCharMap; diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx index bf00935b15a1..910aa2a70ae6 100644 --- a/vcl/inc/unx/freetype_glyphcache.hxx +++ b/vcl/inc/unx/freetype_glyphcache.hxx @@ -115,7 +115,6 @@ public: FreetypeFontFace( FreetypeFontInfo*, const FontAttributes& ); virtual rtl::Reference<LogicalFontInstance> CreateFontInstance( const FontSelectPattern& ) const override; - virtual rtl::Reference<PhysicalFontFace> Clone() const override { return new FreetypeFontFace( *this ); } virtual sal_IntPtr GetFontId() const override { return mpFreetypeFontInfo->GetFontId(); } }; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 661c47908865..5f6dbe21836e 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -63,7 +63,6 @@ public: BYTE nPitchAndFamily ); virtual ~WinFontFace() override; - virtual rtl::Reference<PhysicalFontFace> Clone() const override; virtual rtl::Reference<LogicalFontInstance> CreateFontInstance( const FontSelectPattern& ) const override; virtual sal_IntPtr GetFontId() const override; void SetFontId( sal_IntPtr nId ) { mnId = nId; } diff --git a/vcl/qt5/Qt5FontFace.cxx b/vcl/qt5/Qt5FontFace.cxx index d0efb488d57c..043a9b6e798b 100644 --- a/vcl/qt5/Qt5FontFace.cxx +++ b/vcl/qt5/Qt5FontFace.cxx @@ -116,6 +116,4 @@ bool Qt5FontFace::GetFontCapabilities(vcl::FontCapabilities& rFontCapabilities) return rFontCapabilities.oUnicodeRange || rFontCapabilities.oCodePageRange; } -rtl::Reference<PhysicalFontFace> Qt5FontFace::Clone() const { return new Qt5FontFace(*this); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index dc372325e9e8..6e029da574bc 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -283,10 +283,6 @@ hb_font_t* CoreTextStyle::ImplInitHbFont() return InitHbFont(pHbFace); } -rtl::Reference<PhysicalFontFace> CoreTextFontFace::Clone() const -{ - return new CoreTextFontFace( *this); -} rtl::Reference<LogicalFontInstance> CoreTextFontFace::CreateFontInstance(const FontSelectPattern& rFSD) const { @@ -540,7 +536,7 @@ void SystemFontList::AnnounceFonts( PhysicalFontCollection& rFontCollection ) co auto it = maFontContainer.cbegin(); for(; it != maFontContainer.cend(); ++it ) { - rFontCollection.Add( (*it).second->Clone().get() ); + rFontCollection.Add( (*it).second.get() ); } } diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index fcb583af8cfb..e9522835a8f1 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -103,14 +103,6 @@ bool CoreTextGlyphFallbackSubstititution::FindFontSubstitute(FontSelectPattern& return bFound; } -CoreTextFontFace::CoreTextFontFace( const CoreTextFontFace& rSrc ) - : PhysicalFontFace( rSrc ) - , mnFontId( rSrc.mnFontId ) -{ - if( rSrc.mxCharMap.is() ) - mxCharMap = rSrc.mxCharMap; -} - CoreTextFontFace::CoreTextFontFace( const FontAttributes& rDFA, sal_IntPtr nFontId ) : PhysicalFontFace( rDFA ) , mnFontId( nFontId ) diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index d356438e43a1..1b0940c8fb76 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -37,14 +37,6 @@ PhysicalFontFace::PhysicalFontFace( const FontAttributes& rDFA ) SetSymbolFlag( true ); } -PhysicalFontFace::PhysicalFontFace( const PhysicalFontFace& other ) - : FontAttributes( other ) - , salhelper::SimpleReferenceObject() - , mnWidth(other.mnWidth) - , mnHeight(other.mnWidth) -{ -} - rtl::Reference<LogicalFontInstance> PhysicalFontFace::CreateFontInstance(const FontSelectPattern& rFSD) const { return new LogicalFontInstance(*this, rFSD); diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index d0c1c2dad165..6953d259798f 100644 --- a/vcl/source/font/PhysicalFontFamily.cxx +++ b/vcl/source/font/PhysicalFontFamily.cxx @@ -264,15 +264,7 @@ void PhysicalFontFamily::UpdateCloneFontList(PhysicalFontCollection& rFontCollec pFamily = rFontCollection.FindOrCreateFontFamily(aFamilyName); } assert(pFamily); - rtl::Reference<PhysicalFontFace> pClonedFace = pFoundFontFace->Clone(); - -#if OSL_DEBUG_LEVEL > 0 - OUString aClonedFamilyName = GetEnglishSearchFontName( pClonedFace->GetFamilyName() ); - assert( aClonedFamilyName == aFamilyName ); - assert( rFontCollection.FindOrCreateFontFamily( aClonedFamilyName ) == pFamily ); -#endif - - pFamily->AddFontFace( pClonedFace.get() ); + pFamily->AddFontFace( pFoundFontFace ); } } diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index e17ca2a5f73a..e663ef6ab875 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -1290,7 +1290,6 @@ public: explicit PdfBuiltinFontFace( const PDFWriterImpl::BuiltinFont& ); const PDFWriterImpl::BuiltinFont& GetBuiltinFont() const { return mrBuiltin; } - virtual rtl::Reference<PhysicalFontFace> Clone() const override { return new PdfBuiltinFontFace(*this); } virtual sal_IntPtr GetFontId() const override { return reinterpret_cast<sal_IntPtr>(&mrBuiltin); } }; diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index f8df235fb236..a16bf100d466 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -520,7 +520,6 @@ private: public: explicit ImplPspFontData( const psp::FastPrintFontInfo& ); virtual sal_IntPtr GetFontId() const override { return mnFontId; } - virtual rtl::Reference<PhysicalFontFace> Clone() const override { return new ImplPspFontData( *this ); } }; ImplPspFontData::ImplPspFontData(const psp::FastPrintFontInfo& rInfo) diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 765d64e0c5b0..77fc91b8b2a4 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -658,11 +658,6 @@ sal_IntPtr WinFontFace::GetFontId() const return mnId; } -rtl::Reference<PhysicalFontFace> WinFontFace::Clone() const -{ - return new WinFontFace(*this); -} - rtl::Reference<LogicalFontInstance> WinFontFace::CreateFontInstance(const FontSelectPattern& rFSD) const { return new WinFontInstance(*this, rFSD); |