summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-09-30 16:10:58 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-10-25 14:02:32 +0200
commitdd16804e52984ded1ee739a22822daa068a13707 (patch)
tree9e005e8bdc9d438cbcf7190f9440e60fc0769de0 /vcl/unx/generic
parent655e3bd9a880a8bf3a1f9d3514e64d0da3d36b8a (diff)
Drop duplicate PhysicalFontFace reference
A LogicalFontInstance has a pointer to its parent font face. And don't pretend we can actually nest MultiSalLayout, so store the GenericSalLayout internally. Change-Id: I801acbc34497fc57e8e185eee34c1a1162dbea93 Reviewed-on: https://gerrit.libreoffice.org/62314 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx8
-rw-r--r--vcl/unx/generic/print/genpspgraphics.cxx8
2 files changed, 8 insertions, 8 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index b7356eda56a5..adcb0deec8ac 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -40,6 +40,7 @@
#include <cairo.h>
#include <cairo-ft.h>
#include <sallayout.hxx>
+#include <o3tl/make_unique.hxx>
namespace {
@@ -487,10 +488,9 @@ bool CairoTextRender::GetGlyphOutline(const GlyphItem& rGlyph,
std::unique_ptr<SalLayout> CairoTextRender::GetTextLayout(ImplLayoutArgs& /*rArgs*/, int nFallbackLevel)
{
- if (mpFreetypeFont[nFallbackLevel])
- return std::unique_ptr<SalLayout>(new GenericSalLayout(*mpFreetypeFont[nFallbackLevel]->GetFontInstance()));
-
- return nullptr;
+ if (!mpFreetypeFont[nFallbackLevel])
+ return nullptr;
+ return o3tl::make_unique<GenericSalLayout>(*mpFreetypeFont[nFallbackLevel]->GetFontInstance());
}
#if ENABLE_CAIRO_CANVAS
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index ae30cfad6286..b11a87083c68 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -55,6 +55,7 @@
#include <salbmp.hxx>
#include <salprn.hxx>
#include <sallayout.hxx>
+#include <o3tl/make_unique.hxx>
using namespace psp;
@@ -761,10 +762,9 @@ bool GenPspGraphics::GetGlyphOutline(const GlyphItem& rGlyph,
std::unique_ptr<SalLayout> GenPspGraphics::GetTextLayout(ImplLayoutArgs& /*rArgs*/, int nFallbackLevel)
{
- if (m_pFreetypeFont[nFallbackLevel])
- return std::unique_ptr<SalLayout>(new PspSalLayout(*m_pPrinterGfx, *m_pFreetypeFont[nFallbackLevel]));
-
- return nullptr;
+ if (!m_pFreetypeFont[nFallbackLevel])
+ return nullptr;
+ return o3tl::make_unique<PspSalLayout>(*m_pPrinterGfx, *m_pFreetypeFont[nFallbackLevel]);
}
bool GenPspGraphics::CreateFontSubset(