[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 30 15:13:20 UTC 2018
vcl/source/gdi/impglyphitem.cxx | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
New commits:
commit 02a2b75550e8e94e29d252178cfb223452812d2b
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Oct 30 12:44:06 2018 +0000
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Tue Oct 30 16:12:56 2018 +0100
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: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 47125f6cd595..8955ea890a9f 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -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;
}
More information about the Libreoffice-commits
mailing list