Kaydet (Commit) 02a2b755 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

Fix SalLayoutGlyphs copy constructor

Since we can't know the real SalLayoutGlyphsImpl type, we
always have to clone and delete it on assignemt and in the
copy constructor.

Change-Id: I3e3aa1e0271c5ecbb1474a70fae5e63bd7124677
Reviewed-on: https://gerrit.libreoffice.org/62583
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst b9e4bb65
......@@ -26,14 +26,12 @@ SalLayoutGlyphs::SalLayoutGlyphs()
SalLayoutGlyphs::~SalLayoutGlyphs() { delete m_pImpl; }
SalLayoutGlyphs::SalLayoutGlyphs(const SalLayoutGlyphs& rOther) { *m_pImpl = *rOther.m_pImpl; }
SalLayoutGlyphs::SalLayoutGlyphs(const SalLayoutGlyphs& rOther) { operator=(rOther); }
SalLayoutGlyphs& SalLayoutGlyphs::operator=(const SalLayoutGlyphs& rOther)
{
if (m_pImpl)
*m_pImpl = *rOther.m_pImpl;
else
m_pImpl = rOther.m_pImpl->clone(*this);
delete m_pImpl;
m_pImpl = rOther.m_pImpl ? rOther.m_pImpl->clone(*this) : nullptr;
return *this;
}
......
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