From 193c91d07600f74df736b645800e5f0c2f9f3d56 Mon Sep 17 00:00:00 2001 From: Minh Hiep Pham <minh.pham@telecom-paristech.fr> Date: Wed, 13 Feb 2019 16:01:49 +0100 Subject: [PATCH] Links between the clone components itself and sub components --- src/main/java/ui/TGComponent.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/ui/TGComponent.java b/src/main/java/ui/TGComponent.java index 25f735e6b9..943998bc6a 100644 --- a/src/main/java/ui/TGComponent.java +++ b/src/main/java/ui/TGComponent.java @@ -3489,8 +3489,12 @@ public abstract class TGComponent extends AbstractCDElement implements /*CDElem * added by Minh Hiep */ public boolean isInHierarchy(TGComponent mainTgc) { - TGComponent tgctmp = getFather(); - if (tgctmp == null) return tgctmp == mainTgc; + TGComponent tgctmp; + if (father == null) { + tgctmp = this; + } else { + tgctmp = father; + } while(tgctmp != null && tgctmp != mainTgc) { tgctmp = tgctmp.getFather(); } -- GitLab