Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2017-08-22 14:15:13 +0000
committerBenoit Maggi2018-06-04 13:22:27 +0000
commit4d8969b36ae2c95a7f38631c0ce6a9a29b241a4b (patch)
tree0f14a48b9fad303064765cbf5a9761143f43ec79 /plugins/infra/gmfdiag
parentde53a4e63fb648e7250ea24d9ca3e3e1ae7b2b4a (diff)
downloadorg.eclipse.papyrus-4d8969b36ae2c95a7f38631c0ce6a9a29b241a4b.tar.gz
org.eclipse.papyrus-4d8969b36ae2c95a7f38631c0ce6a9a29b241a4b.tar.xz
org.eclipse.papyrus-4d8969b36ae2c95a7f38631c0ce6a9a29b241a4b.zip
Bug 521232 - [All diagrams] NPE if SVG unit is not in pixels
- Use getValueInSpecifiedUnits instead of getValue Test: SVG shape with mm units (see forum) is correctly displayed in class (class diagram). Also tested existing SVG in class (composite diagram) Signed-off-by: Ansgar Radermacher <ansgar.radermacher@cea.fr>
Diffstat (limited to 'plugins/infra/gmfdiag')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/SVGNodePlateFigure.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/SVGNodePlateFigure.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/SVGNodePlateFigure.java
index 91311ff80ec..9bae204100a 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/SVGNodePlateFigure.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/SVGNodePlateFigure.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST and others.
+ * Copyright (c) 2010, 2014, 2018 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -10,6 +10,7 @@
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
* Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Refactoring, cleanup, added support for PapyrusLabel element
* Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Add IRoundedRectangleFigure use case(436547)
+ * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - NPE if SVG unit is not in pixels (521232)
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.figure.node;
@@ -194,7 +195,13 @@ public class SVGNodePlateFigure extends DefaultSizeNodeFigure {
if (base == null) {
return 0;
}
- return base.getValue();
+ try {
+ return base.getValue();
+ }
+ catch (NullPointerException e) {
+ // NPE during getValue (bug 521232) => retry using getValueInSpecifiedUnits)
+ return base.getValueInSpecifiedUnits();
+ }
}
/**

Back to the top