Kaydet (Commit) a901e485 authored tarafından Noel Grandin's avatar Noel Grandin

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/55427Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a49440b1
......@@ -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)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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(); }
};
......
......@@ -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; }
......
......@@ -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: */
......@@ -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() );
}
}
......
......@@ -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 )
......
......@@ -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);
......
......@@ -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 );
}
}
......
......@@ -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); }
};
......
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment