From 1f62091b7335d6205fb45efbe4d490769c4339f3 Mon Sep 17 00:00:00 2001 From: yparitcher Date: Tue, 13 Jun 2023 05:52:46 -0400 Subject: [PATCH] HtmlboxWidget: pairs->ipairs (#10574) thanks @poire-z Closes: #10565 --- frontend/ui/widget/htmlboxwidget.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/ui/widget/htmlboxwidget.lua b/frontend/ui/widget/htmlboxwidget.lua index 9c2be7e20..02a1cc48c 100644 --- a/frontend/ui/widget/htmlboxwidget.lua +++ b/frontend/ui/widget/htmlboxwidget.lua @@ -182,8 +182,8 @@ function HtmlBoxWidget:getSelectedText(lines, start_pos, end_pos) local found_start = false local words = {} - for _, line in pairs(lines) do - for _, w in pairs(line) do + for _, line in ipairs(lines) do + for _, w in ipairs(line) do if type(w) == 'table' then if not found_start then if start_pos.x >= w.x0 and start_pos.x < w.x1 and start_pos.y >= w.y0 and start_pos.y < w.y1 then @@ -246,7 +246,7 @@ function HtmlBoxWidget:getLinkByPosition(pos) local links = page:getPageLinks() page:close() - for _, link in pairs(links) do + for _, link in ipairs(links) do if pos.x >= link.x0 and pos.x < link.x1 and pos.y >= link.y0 and pos.y < link.y1 then return link end