76 lines
3.6 KiB
Diff
76 lines
3.6 KiB
Diff
From 32ec6094e81d292346f83db6e18a3daec99bd2ff Mon Sep 17 00:00:00 2001
|
||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||
Date: Fri, 4 Feb 2022 15:13:28 +0000
|
||
Subject: [PATCH] this test assumes KacstBook has no Latin glyphs
|
||
|
||
which is true for the one bundled with LibreOffice but is not
|
||
true for the fedora one (kacst-book-fonts-2.0-26.fc35), but
|
||
neither of them have Cyrillic glyphs
|
||
|
||
Change-Id: Ide8b84502886c7b9e0bc4fcef4685b4b89ec2bc3
|
||
|
||
test fails with both fedora KacstBook and bundled KacstBook installed
|
||
|
||
fedora KacstBook ver is less than bundled KacstBook ver so bundled is
|
||
preferred, bundled KacstBook has no Latin glyphs, but glyph fallback
|
||
finds system one and sees it has the missing glyphs, determines that the
|
||
whole thing can be done in the fallback font, so the toplevel is unused
|
||
and so "invalid" and this test fails on checking that.
|
||
|
||
The test is supposed to ensure that glyph caching gives the same result
|
||
as uncached, which it does, so just assert if there is a difference
|
||
between cached and uncached
|
||
|
||
Change-Id: I3c424a17f3e544aa64f4af98e0c151fc00b2e6e5
|
||
---
|
||
vcl/qa/cppunit/complextext.cxx | 4 +---
|
||
vcl/qa/cppunit/text.cxx | 6 ++++--
|
||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||
|
||
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
|
||
index 21e1e58f96ac..5d9ac92f1f69 100644
|
||
--- a/vcl/qa/cppunit/complextext.cxx
|
||
+++ b/vcl/qa/cppunit/complextext.cxx
|
||
@@ -172,13 +172,11 @@ static void testCachedGlyphs( const OUString& aText, const OUString& aFontName =
|
||
std::unique_ptr<SalLayout> pLayout1 = pOutputDevice->ImplLayout(
|
||
aText, 0, aText.getLength(), Point(0, 0), 0, {}, SalLayoutFlags::GlyphItemsOnly);
|
||
SalLayoutGlyphs aGlyphs1 = pLayout1->GetGlyphs();
|
||
- CPPUNIT_ASSERT_MESSAGE(message, aGlyphs1.IsValid());
|
||
- CPPUNIT_ASSERT_MESSAGE(message, aGlyphs1.Impl(0) != nullptr);
|
||
// Reuse the cached glyphs to get glyphs again.
|
||
std::unique_ptr<SalLayout> pLayout2 = pOutputDevice->ImplLayout(
|
||
aText, 0, aText.getLength(), Point(0, 0), 0, {}, SalLayoutFlags::GlyphItemsOnly, nullptr, &aGlyphs1);
|
||
SalLayoutGlyphs aGlyphs2 = pLayout2->GetGlyphs();
|
||
- CPPUNIT_ASSERT_MESSAGE(message, aGlyphs2.IsValid());
|
||
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(message, aGlyphs1.IsValid(), aGlyphs2.IsValid());
|
||
// And check it's the same.
|
||
for( int level = 0; level < MAX_FALLBACK; ++level )
|
||
{
|
||
diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx
|
||
index 072a0d0a1f98..3647589a38d1 100644
|
||
--- a/vcl/qa/cppunit/text.cxx
|
||
+++ b/vcl/qa/cppunit/text.cxx
|
||
@@ -690,7 +690,8 @@ void VclTextTest::testImplLayoutArgs_PrepareFallback_precalculatedglyphs()
|
||
ScopedVclPtrInstance<VirtualDevice> pVirDev;
|
||
pVirDev->SetFont(aFont);
|
||
|
||
- const OUString sTestString = "The quick\n jumped over";
|
||
+ const OString sUTF8String(u8"Тхе яуицк\n ыумпед овер");
|
||
+ const OUString sTestString(OUString::fromUtf8(sUTF8String));
|
||
std::unique_ptr<SalLayout> pLayout
|
||
= pVirDev->ImplLayout(sTestString, 0, sTestString.getLength(), Point(0, 0), 0, {},
|
||
SalLayoutFlags::GlyphItemsOnly);
|
||
@@ -698,7 +699,8 @@ void VclTextTest::testImplLayoutArgs_PrepareFallback_precalculatedglyphs()
|
||
SalLayoutGlyphsImpl* pGlyphsImpl = aGlyphs.Impl(1);
|
||
|
||
vcl::text::ImplLayoutArgs aArgs(sTestString, 0, sTestString.getLength(),
|
||
- SalLayoutFlags::BiDiRtl, LanguageTag(LANGUAGE_LATIN), nullptr);
|
||
+ SalLayoutFlags::BiDiRtl, LanguageTag(LANGUAGE_RUSSIAN),
|
||
+ nullptr);
|
||
|
||
aArgs.PrepareFallback(pGlyphsImpl);
|
||
|
||
--
|
||
2.33.1
|
||
|