From ecab8f30de7d086f5b0f736e4aa77ba038b905b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 19 Sep 2021 12:46:45 +0100 Subject: [PATCH] cid#1492159 Uninitialized scalar field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since... commit c2e6a068c112f4c5866b6371d02362bd71f903a3 Date: Wed Sep 8 12:07:48 2021 +1000 vcl: create FontMetric from PhysicalFontFace where previously we had... FontMetric aFontMetric; ... aFontMetric.SetFamilyName( rData.GetFamilyName() ); ... return aFontMetric; so the FontMetric default ctor was called which initialized all FontMetric's members, but afterwards with... return FontMetric(rData); the new FontMetric ctor taking a const PhysicalFontFace& arg left all the non-inherited members of FontMetric uninitialized Change-Id: I91ee08ed1d63d15eccec44c87841884b2992eacb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122317 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/source/font/fontmetric.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx index 03996cd7a4d8..93984357d4d0 100644 --- a/vcl/source/font/fontmetric.cxx +++ b/vcl/source/font/fontmetric.cxx @@ -52,6 +52,7 @@ FontMetric::FontMetric() FontMetric::FontMetric( const FontMetric& rFontMetric ) = default; FontMetric::FontMetric(PhysicalFontFace const& rFace) + : FontMetric() { SetFamilyName(rFace.GetFamilyName()); SetStyleName(rFace.GetStyleName());