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

merge SalLayoutGlyphsImpl and SalGenericLayoutGlyphsImpl

Change-Id: I5697d2b7961ce714835316879610f23aeabbd8ec
Reviewed-on: https://gerrit.libreoffice.org/69030
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 2513e686
......@@ -92,33 +92,23 @@ VCL_DLLPUBLIC bool GlyphItem::GetGlyphOutline(basegfx::B2DPolyPolygon& rPoly) co
class SalLayoutGlyphsImpl : public std::vector<GlyphItem>
{
protected:
void SetPImpl(SalLayoutGlyphs* pFacade) { pFacade->m_pImpl = this; }
friend class GenericSalLayout;
public:
virtual ~SalLayoutGlyphsImpl();
virtual SalLayoutGlyphsImpl* clone(SalLayoutGlyphs&) const = 0;
virtual bool IsValid() const = 0;
virtual void Invalidate() = 0;
};
class SalGenericLayoutGlyphsImpl : public SalLayoutGlyphsImpl
{
friend class GenericSalLayout;
~SalLayoutGlyphsImpl();
SalLayoutGlyphsImpl* clone(SalLayoutGlyphs& rGlyphs) const;
LogicalFontInstance& GetFont() const { return *m_rFontInstance; }
bool IsValid() const;
void Invalidate();
private:
mutable rtl::Reference<LogicalFontInstance> m_rFontInstance;
SalGenericLayoutGlyphsImpl(SalLayoutGlyphs& rGlyphs, LogicalFontInstance& rFontInstance)
SalLayoutGlyphsImpl(SalLayoutGlyphs& rGlyphs, LogicalFontInstance& rFontInstance)
: m_rFontInstance(&rFontInstance)
{
SetPImpl(&rGlyphs);
rGlyphs.m_pImpl = this;
}
public:
SalLayoutGlyphsImpl* clone(SalLayoutGlyphs& rGlyphs) const override;
LogicalFontInstance& GetFont() const { return *m_rFontInstance; }
bool IsValid() const override;
void Invalidate() override;
};
#endif // INCLUDED_VCL_IMPGLYPHITEM_HXX
......
......@@ -182,7 +182,7 @@ public:
// used by display layers
LogicalFontInstance& GetFont() const
{ return static_cast<SalGenericLayoutGlyphsImpl*>(m_GlyphItems.Impl())->GetFont(); }
{ return m_GlyphItems.Impl()->GetFont(); }
bool GetNextGlyph(const GlyphItem** pGlyph, Point& rPos, int& nStart,
const PhysicalFontFace** pFallbackFont = nullptr,
......
......@@ -60,7 +60,7 @@ GenericSalLayout::GenericSalLayout(LogicalFontInstance &rFont)
: mpVertGlyphs(nullptr)
, mbFuzzing(utl::ConfigManager::IsFuzzing())
{
new SalGenericLayoutGlyphsImpl(m_GlyphItems, rFont);
new SalLayoutGlyphsImpl(m_GlyphItems, rFont);
}
GenericSalLayout::~GenericSalLayout()
......
......@@ -55,14 +55,14 @@ void SalLayoutGlyphs::Invalidate()
SalLayoutGlyphsImpl::~SalLayoutGlyphsImpl() {}
SalLayoutGlyphsImpl* SalGenericLayoutGlyphsImpl::clone(SalLayoutGlyphs& rGlyphs) const
SalLayoutGlyphsImpl* SalLayoutGlyphsImpl::clone(SalLayoutGlyphs& rGlyphs) const
{
SalLayoutGlyphsImpl* pNew = new SalGenericLayoutGlyphsImpl(rGlyphs, *m_rFontInstance);
SalLayoutGlyphsImpl* pNew = new SalLayoutGlyphsImpl(rGlyphs, *m_rFontInstance);
*pNew = *this;
return pNew;
}
bool SalGenericLayoutGlyphsImpl::IsValid() const
bool SalLayoutGlyphsImpl::IsValid() const
{
if (!m_rFontInstance.is())
return false;
......@@ -79,7 +79,7 @@ bool SalGenericLayoutGlyphsImpl::IsValid() const
return true;
}
void SalGenericLayoutGlyphsImpl::Invalidate()
void SalLayoutGlyphsImpl::Invalidate()
{
m_rFontInstance.clear();
clear();
......
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