1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibGUI: Fix const-correctness issues

This commit is contained in:
Andreas Kling 2023-02-20 19:03:44 +01:00
parent bfe081caad
commit faa1a09042
44 changed files with 180 additions and 183 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2020-2023, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
@ -46,7 +46,7 @@ static constexpr auto s_emoji_groups = Array {
EmojiCateogry { Unicode::EmojiGroup::SerenityOS, 0x10CD0B },
};
static void resize_bitmap_if_needed(RefPtr<Gfx::Bitmap>& bitmap)
static void resize_bitmap_if_needed(RefPtr<Gfx::Bitmap const>& bitmap)
{
constexpr int max_icon_size = 12;
@ -74,7 +74,7 @@ private:
if (m_first_paint_event) {
m_first_paint_event = false;
RefPtr<Gfx::Bitmap> bitmap = Gfx::Emoji::emoji_for_code_points(m_emoji_code_points);
RefPtr<Gfx::Bitmap const> bitmap = Gfx::Emoji::emoji_for_code_points(m_emoji_code_points);
VERIFY(bitmap);
resize_bitmap_if_needed(bitmap);
@ -113,7 +113,7 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window)
auto name = Unicode::emoji_group_to_string(category.group);
auto tooltip = name.replace("&"sv, "&&"sv, ReplaceMode::FirstOnly);
RefPtr<Gfx::Bitmap> bitmap = Gfx::Emoji::emoji_for_code_point(category.emoji_code_point);
RefPtr<Gfx::Bitmap const> bitmap = Gfx::Emoji::emoji_for_code_point(category.emoji_code_point);
VERIFY(bitmap);
resize_bitmap_if_needed(bitmap);