diff options
author | Tor Norbye <tnorbye@google.com> | 2013-04-01 09:49:46 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2013-04-01 09:50:05 -0700 |
commit | 67c3f1d864ad3338dfc1d194b35eaaaaa71a7aeb (patch) | |
tree | 2a21329e5c8c53927a31afd5fb8541eb4e9ea24b /eclipse/plugins | |
parent | 74119598e58a2ddb911e9ffabe328b2d435a71bc (diff) | |
download | sdk-67c3f1d864ad3338dfc1d194b35eaaaaa71a7aeb.zip sdk-67c3f1d864ad3338dfc1d194b35eaaaaa71a7aeb.tar.gz sdk-67c3f1d864ad3338dfc1d194b35eaaaaa71a7aeb.tar.bz2 |
Misc bug fixes
First, when computing the fully qualified package names of activities
to store the activity to theme mapping in the ManifestInfo, also allow
activities to not be prefixed by a dot and still prefix the package
path provided there are no dots in the activity name.
Second, escape string values specified in the Add Translation Dialog
when creating the corresponding resources.
Third, soon the ResourceRepository will no longer provide a protected
mWrapper field, so replicate it inside ProjectResources.
Change-Id: I7660aa6921e3b667e63a25c645ca21efc443b7ce
Diffstat (limited to 'eclipse/plugins')
3 files changed, 6 insertions, 5 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java index 55cad2b..e43b04c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java @@ -225,9 +225,9 @@ public class ManifestInfo { String theme = activity.getAttributeNS(NS_RESOURCES, ATTRIBUTE_THEME); if (theme != null && theme.length() > 0) { String name = activity.getAttributeNS(NS_RESOURCES, ATTRIBUTE_NAME); - if (name.startsWith(".") //$NON-NLS-1$ - && mPackage != null && mPackage.length() > 0) { - name = mPackage + name; + int index = name.indexOf('.'); + if (index <= 0 && mPackage != null && !mPackage.isEmpty()) { + name = mPackage + (index == -1 ? "." : "") + name; } mActivityThemes.put(name, theme); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java index 68c2257..7c3fd4c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java @@ -65,7 +65,7 @@ public class ProjectResources extends ResourceRepository { private Map<IntArrayWrapper, String> mStyleableValueToNameMap; private final DynamicIdMap mDynamicIdMap = new DynamicIdMap(DYNAMIC_ID_SEED_START); - + private final IntArrayWrapper mWrapper = new IntArrayWrapper(null); private final IProject mProject; public static ProjectResources create(IProject project) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java index ce7e936..f4f6361 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java @@ -21,6 +21,7 @@ import static com.android.SdkConstants.RES_QUALIFIER_SEP; import com.android.ide.common.rendering.api.ResourceValue; import com.android.ide.common.resources.ResourceItem; +import com.android.ide.common.resources.ValueResourceParser; import com.android.ide.common.resources.configuration.FolderConfiguration; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; @@ -384,7 +385,7 @@ public class AddTranslationDialog extends Dialog implements ControlListener, Sel sb.append(" <string name=\""); //$NON-NLS-1$ sb.append(key); sb.append("\">"); //$NON-NLS-1$ - sb.append(value); + sb.append(ValueResourceParser.escapeResourceString(value)); sb.append("</string>\n"); //$NON-NLS-1$ } sb.append("\n</resources>"); //$NON-NLS-1$ |