vcl/unx/gtk3/gtkinst.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
New commits: commit 94081225aa7925cbeea359446d50c2daccc3a7b4 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Nov 28 10:32:00 2024 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Nov 28 11:47:37 2024 +0100 PVS: V612 An unconditional 'break' within a loop. Change-Id: I512969e1583f780b54c035f6a3c3c3e14e783016 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177472 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 6558fa36d763..834984642a1e 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -16014,7 +16014,7 @@ public: { GtkTreeModel* pModel; GList* pList = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(m_pTreeView), &pModel); - for (GList* pItem = g_list_first(pList); pItem; pItem = g_list_next(pItem)) + if (GList* pItem = g_list_first(pList)) { if (pIter) { @@ -16022,7 +16022,6 @@ public: gtk_tree_model_get_iter(pModel, pIter, path); } bRet = true; - break; } g_list_free_full(pList, reinterpret_cast<GDestroyNotify>(gtk_tree_path_free)); } @@ -17131,7 +17130,7 @@ private: { GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); GList* pList = gtk_icon_view_get_selected_items(m_pIconView); - for (GList* pItem = g_list_first(pList); pItem; pItem = g_list_next(pItem)) + if (GList* pItem = g_list_first(pList)) { if (pIter) { @@ -17139,7 +17138,6 @@ private: gtk_tree_model_get_iter(pModel, pIter, path); } bRet = true; - break; } g_list_free_full(pList, reinterpret_cast<GDestroyNotify>(gtk_tree_path_free)); }