diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2015-03-08 22:34:24 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2015-03-08 22:34:24 +0100 |
| commit | b451e9a06f3f5ee7f1b6914031413f9c2b0b6432 (patch) | |
| tree | ca2a477144990780ad5ad2ebe524240f67002649 /main | |
| parent | b6140ee20f1a74c580208c3f513954a13b7aa572 (diff) | |
| parent | f44a56394254731f63eb279073f2949b09966aa1 (diff) | |
| download | cgeo-b451e9a06f3f5ee7f1b6914031413f9c2b0b6432.zip cgeo-b451e9a06f3f5ee7f1b6914031413f9c2b0b6432.tar.gz cgeo-b451e9a06f3f5ee7f1b6914031413f9c2b0b6432.tar.bz2 | |
Merge branch 'issue-4727' into upstream
Diffstat (limited to 'main')
| -rw-r--r-- | main/res/values/changelog_release.xml | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/Geocache.java | 2 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/Trackable.java | 2 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/utils/ImageUtils.java | 27 |
4 files changed, 20 insertions, 15 deletions
diff --git a/main/res/values/changelog_release.xml b/main/res/values/changelog_release.xml index 3c3c8fa..a5603d2 100644 --- a/main/res/values/changelog_release.xml +++ b/main/res/values/changelog_release.xml @@ -2,6 +2,10 @@ <resources> <!-- changelog for the release branch --> <string name="changelog_release" translatable="false">\n + <b>Next bugfix release</b>\n + · Fix: Smilies in waypoints not shown\n + \n + \n <b>2015.02.23</b>\n · Fix: Home location not parsed correctly\n · Fix: Crash exporting GPX for lab caches\n diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index e2eed56..c2edf44 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -1682,7 +1682,7 @@ public class Geocache implements IWaypoint { for (final LogEntry log : getLogs()) { result.addAll(log.getLogImages()); } - ImageUtils.addImagesFromHtml(result, getDescription(), geocode); + ImageUtils.addImagesFromHtml(result, geocode, getShortDescription(), getDescription()); return result; } diff --git a/main/src/cgeo/geocaching/Trackable.java b/main/src/cgeo/geocaching/Trackable.java index f93ec7b..d7d2357 100644 --- a/main/src/cgeo/geocaching/Trackable.java +++ b/main/src/cgeo/geocaching/Trackable.java @@ -227,7 +227,7 @@ public class Trackable implements ILogable { if (StringUtils.isNotBlank(image)) { images.add(new Image(image, StringUtils.defaultIfBlank(name, geocode))); } - ImageUtils.addImagesFromHtml(images, getDetails(), geocode); + ImageUtils.addImagesFromHtml(images, geocode, getDetails()); for (final LogEntry log : getLogs()) { images.addAll(log.getLogImages()); } diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java index 9011ab9..71d5e39 100644 --- a/main/src/cgeo/geocaching/utils/ImageUtils.java +++ b/main/src/cgeo/geocaching/utils/ImageUtils.java @@ -320,26 +320,27 @@ public final class ImageUtils { /** * Add images present in the HTML description to the existing collection. - * - * @param images a collection of images - * @param htmlText the HTML description to be parsed + * @param images a collection of images * @param geocode the common title for images in the description + * @param htmlText the HTML description to be parsed, can be repeated */ - public static void addImagesFromHtml(final Collection<Image> images, final String htmlText, final String geocode) { + public static void addImagesFromHtml(final Collection<Image> images, final String geocode, final String... htmlText) { final Set<String> urls = new LinkedHashSet<>(); for (final Image image : images) { urls.add(image.getUrl()); } - Html.fromHtml(StringUtils.defaultString(htmlText), new ImageGetter() { - @Override - public Drawable getDrawable(final String source) { - if (!urls.contains(source) && canBeOpenedExternally(source)) { - images.add(new Image(source, StringUtils.defaultString(geocode))); - urls.add(source); + for (final String text: htmlText) { + Html.fromHtml(StringUtils.defaultString(text), new ImageGetter() { + @Override + public Drawable getDrawable(final String source) { + if (!urls.contains(source) && canBeOpenedExternally(source)) { + images.add(new Image(source, StringUtils.defaultString(geocode))); + urls.add(source); + } + return null; } - return null; - } - }, null); + }, null); + } } /** |
