This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new 7bbca3947d Delete multiple notes doesn't remove the correct notes 
#6090 (#6091)
7bbca3947d is described below

commit 7bbca3947d09c6a8033e0453447b366adb545b3e
Author: Nicolas Adment <[email protected]>
AuthorDate: Fri Dec 5 14:46:25 2025 +0100

    Delete multiple notes doesn't remove the correct notes #6090 (#6091)
---
 .../file/delegates/HopGuiNotePadDelegate.java      | 43 +++++++++++-----------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/delegates/HopGuiNotePadDelegate.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/delegates/HopGuiNotePadDelegate.java
index 13db1c9990..269461e882 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/delegates/HopGuiNotePadDelegate.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/delegates/HopGuiNotePadDelegate.java
@@ -52,7 +52,8 @@ public class HopGuiNotePadDelegate {
       idxs[i] = meta.indexOfNote(notes.get(i));
       noteCopies[i] = new NotePadMeta(notes.get(i));
     }
-    for (int idx : idxs) {
+    for (NotePadMeta notePadMeta : notes) {
+      int idx = meta.indexOfNote(notePadMeta);
       meta.removeNote(idx);
     }
     hopGui.undoDelegate.addUndoDelete(meta, noteCopies, idxs);
@@ -71,32 +72,32 @@ public class HopGuiNotePadDelegate {
 
   public void newNote(IVariables variables, AbstractMeta meta, int x, int y) {
     String title = BaseMessages.getString(PKG, 
"PipelineGraph.Dialog.NoteEditor.Title");
-    NotePadDialog dd = new NotePadDialog(variables, hopGui.getShell(), title);
-    NotePadMeta n = dd.open();
-    if (n != null) {
-      NotePadMeta npi =
+    NotePadDialog dialog = new NotePadDialog(variables, hopGui.getShell(), 
title);
+    NotePadMeta note = dialog.open();
+    if (note != null) {
+      NotePadMeta newNote =
           new NotePadMeta(
-              n.getNote(),
+              note.getNote(),
               x,
               y,
               ConstUi.NOTE_MIN_SIZE,
               ConstUi.NOTE_MIN_SIZE,
-              n.getFontName(),
-              n.getFontSize(),
-              n.isFontBold(),
-              n.isFontItalic(),
-              n.getFontColorRed(),
-              n.getFontColorGreen(),
-              n.getFontColorBlue(),
-              n.getBackGroundColorRed(),
-              n.getBackGroundColorGreen(),
-              n.getBackGroundColorBlue(),
-              n.getBorderColorRed(),
-              n.getBorderColorGreen(),
-              n.getBorderColorBlue());
-      meta.addNote(npi);
+              note.getFontName(),
+              note.getFontSize(),
+              note.isFontBold(),
+              note.isFontItalic(),
+              note.getFontColorRed(),
+              note.getFontColorGreen(),
+              note.getFontColorBlue(),
+              note.getBackGroundColorRed(),
+              note.getBackGroundColorGreen(),
+              note.getBackGroundColorBlue(),
+              note.getBorderColorRed(),
+              note.getBorderColorGreen(),
+              note.getBorderColorBlue());
+      meta.addNote(newNote);
       hopGui.undoDelegate.addUndoNew(
-          meta, new NotePadMeta[] {npi}, new int[] {meta.indexOfNote(npi)});
+          meta, new NotePadMeta[] {newNote}, new int[] 
{meta.indexOfNote(newNote)});
       handler.updateGui();
     }
   }

Reply via email to