[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/CppunitTest_vcl_fontmetric.mk vcl/qa vcl/source
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 25 19:54:29 UTC 2019
vcl/CppunitTest_vcl_fontmetric.mk | 2 ++
vcl/qa/cppunit/FontFeatureTest.cxx | 5 +----
vcl/source/outdev/font.cxx | 1 +
3 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit bf65ab4ecf4d2dac0f845d7c9997bea7bc209be9
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon Jun 24 08:47:57 2019 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Tue Jun 25 21:53:52 2019 +0200
Initialize the font list before querying it
And the vcl_fontmetric test must depend on more_fonts. This way
there should never be a missing font, so just assert on it.
Change-Id: If3b71d7c3e52f1beeda73197c56f5efc6a83dbb4
Reviewed-on: https://gerrit.libreoffice.org/74717
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
(cherry picked from commit 2ec032e01f03ae22ead30be77b8e89b861504128)
Reviewed-on: https://gerrit.libreoffice.org/74718
diff --git a/vcl/CppunitTest_vcl_fontmetric.mk b/vcl/CppunitTest_vcl_fontmetric.mk
index 70e2386e5f50..5496a75c14f9 100644
--- a/vcl/CppunitTest_vcl_fontmetric.mk
+++ b/vcl/CppunitTest_vcl_fontmetric.mk
@@ -50,4 +50,6 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_fontmetric,\
harfbuzz \
))
+$(eval $(call gb_CppunitTest_use_more_fonts,vcl_fontmetric))
+
# vim: set noet sw=4 ts=4:
diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx
index 47e610f50018..15cf92e0589e 100644
--- a/vcl/qa/cppunit/FontFeatureTest.cxx
+++ b/vcl/qa/cppunit/FontFeatureTest.cxx
@@ -36,16 +36,13 @@ public:
void FontFeatureTest::testGetFontFeatures()
{
-// "Linux Libertine G" is a font bundled with LO, but sometimes the
-// bundled fonts aren't available so we need to disable test in that case
#if HAVE_MORE_FONTS
ScopedVclPtrInstance<VirtualDevice> aVDev(*Application::GetDefaultDevice(),
DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
aVDev->SetOutputSizePixel(Size(10, 10));
OUString aFontName("Linux Libertine G");
- if (aVDev->IsFontAvailable(aFontName))
- return; // Can't test this because the font is not available, so exit
+ CPPUNIT_ASSERT(aVDev->IsFontAvailable(aFontName));
vcl::Font aFont = aVDev->GetFont();
aFont.SetFamilyName(aFontName);
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 65fb116ae047..af12cf540712 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -89,6 +89,7 @@ int OutputDevice::GetDevFontCount() const
bool OutputDevice::IsFontAvailable( const OUString& rFontName ) const
{
+ ImplInitFontList();
PhysicalFontFamily* pFound = mxFontCollection->FindFontFamily( rFontName );
return (pFound != nullptr);
}
More information about the Libreoffice-commits
mailing list