From 6e805fb2b209a2d346fa561ad02e8f67de70684a Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Wed, 5 Oct 2011 08:46:19 -0700 Subject: [PATCH] 20542: Contextual prop menu doesn't work well for textStyle. DO NOT MERGE. Change-Id: I6092924b63448b9700ebe5906fab87f11520e27f --- .../src/com/android/ide/common/layout/BaseViewRule.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java index daef677d4..abf47b824 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java @@ -274,7 +274,20 @@ public class BaseViewRule implements IViewRule { } else { newValues.remove(valueId); } - values = join('|', newValues); + + List sorted = new ArrayList(newValues); + Collections.sort(sorted); + values = join('|', sorted); + + // Special case + if (valueId.equals("normal")) { //$NON-NLS-1$ + // For textStyle for example, if you have "bold|italic" + // and you select the "normal" property, this should + // not behave in the normal flag way and "or" itself in; + // it should replace the other two. + // This also applies to imeOptions. + values = valueId; + } } n.setAttribute(uri, actionId, values); } else if (prop.isEnum()) { -- 2.11.0