From 36f27094d0e4cd1b82b4ba50a7c9f92736a86817 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 17 Apr 2021 00:46:43 +0200 Subject: [PATCH] LibTTF: Make load_from_file() take String instead of StringView --- Userland/Libraries/LibTTF/Font.cpp | 4 ++-- Userland/Libraries/LibTTF/Font.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibTTF/Font.cpp b/Userland/Libraries/LibTTF/Font.cpp index 67c85a7767..1142827d73 100644 --- a/Userland/Libraries/LibTTF/Font.cpp +++ b/Userland/Libraries/LibTTF/Font.cpp @@ -225,9 +225,9 @@ GlyphHorizontalMetrics Hmtx::get_glyph_horizontal_metrics(u32 glyph_id) const }; } -RefPtr Font::load_from_file(const StringView& path, unsigned index) +RefPtr Font::load_from_file(String path, unsigned index) { - auto file_or_error = Core::File::open(String(path), Core::IODevice::ReadOnly); + auto file_or_error = Core::File::open(move(path), Core::IODevice::ReadOnly); if (file_or_error.is_error()) { dbgln("Could not open file: {}", file_or_error.error()); return nullptr; diff --git a/Userland/Libraries/LibTTF/Font.h b/Userland/Libraries/LibTTF/Font.h index 19e619261a..21b44da7e8 100644 --- a/Userland/Libraries/LibTTF/Font.h +++ b/Userland/Libraries/LibTTF/Font.h @@ -66,7 +66,7 @@ class Font : public RefCounted { AK_MAKE_NONCOPYABLE(Font); public: - static RefPtr load_from_file(const StringView& path, unsigned index = 0); + static RefPtr load_from_file(String path, unsigned index = 0); static RefPtr load_from_memory(ByteBuffer&, unsigned index = 0); ScaledFontMetrics metrics(float x_scale, float y_scale) const;