mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-18 17:12:54 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
Notes:
sideshowbarker
2024-07-17 16:21:09 +09:00
Author: https://github.com/IdanHo
Commit: 086969277e
Pull-request: https://github.com/SerenityOS/serenity/pull/12321
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/bgianfo ✅
1665 changed files with 8479 additions and 8479 deletions
|
@ -35,7 +35,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
size_t y_offset = 10;
|
||||
size_t current_original_line_index = 0;
|
||||
for (const auto& hunk : m_hunks) {
|
||||
for (auto const& hunk : m_hunks) {
|
||||
for (size_t i = current_original_line_index; i < hunk.original_start_line; ++i) {
|
||||
draw_line(painter, m_original_lines[i], y_offset, LinePosition::Both, LineType::Normal);
|
||||
y_offset += line_height();
|
||||
|
@ -43,7 +43,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
|
|||
current_original_line_index = hunk.original_start_line + hunk.removed_lines.size();
|
||||
|
||||
size_t left_y_offset = y_offset;
|
||||
for (const auto& removed_line : hunk.removed_lines) {
|
||||
for (auto const& removed_line : hunk.removed_lines) {
|
||||
draw_line(painter, removed_line, left_y_offset, LinePosition::Left, LineType::Diff);
|
||||
left_y_offset += line_height();
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
|
|||
}
|
||||
|
||||
size_t right_y_offset = y_offset;
|
||||
for (const auto& added_line : hunk.added_lines) {
|
||||
for (auto const& added_line : hunk.added_lines) {
|
||||
draw_line(painter, added_line, right_y_offset, LinePosition::Right, LineType::Diff);
|
||||
right_y_offset += line_height();
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
void DiffViewer::draw_line(GUI::Painter& painter, const String& line, size_t y_offset, LinePosition line_position, LineType line_type)
|
||||
void DiffViewer::draw_line(GUI::Painter& painter, String const& line, size_t y_offset, LinePosition line_position, LineType line_type)
|
||||
{
|
||||
size_t line_width = font().width(line);
|
||||
|
||||
|
@ -131,7 +131,7 @@ Gfx::IntRect DiffViewer::separator_rect() const
|
|||
frame_inner_rect().height() };
|
||||
}
|
||||
|
||||
void DiffViewer::set_content(const String& original, const String& diff)
|
||||
void DiffViewer::set_content(String const& original, String const& diff)
|
||||
{
|
||||
m_original_lines = split_to_lines(original);
|
||||
m_hunks = Diff::parse_hunks(diff);
|
||||
|
@ -147,7 +147,7 @@ DiffViewer::DiffViewer()
|
|||
setup_properties();
|
||||
}
|
||||
|
||||
DiffViewer::DiffViewer(const String& original, const String& diff)
|
||||
DiffViewer::DiffViewer(String const& original, String const& diff)
|
||||
: m_original_lines(split_to_lines(original))
|
||||
, m_hunks(Diff::parse_hunks(diff))
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ void DiffViewer::setup_properties()
|
|||
set_foreground_role(ColorRole::BaseText);
|
||||
}
|
||||
|
||||
Vector<String> DiffViewer::split_to_lines(const String& text)
|
||||
Vector<String> DiffViewer::split_to_lines(String const& text)
|
||||
{
|
||||
// NOTE: This is slightly different than text.split('\n')
|
||||
Vector<String> lines;
|
||||
|
@ -204,7 +204,7 @@ void DiffViewer::update_content_size()
|
|||
|
||||
size_t num_lines = 0;
|
||||
size_t current_original_line_index = 0;
|
||||
for (const auto& hunk : m_hunks) {
|
||||
for (auto const& hunk : m_hunks) {
|
||||
num_lines += ((int)hunk.original_start_line - (int)current_original_line_index);
|
||||
|
||||
num_lines += hunk.removed_lines.size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue