fix linebreak problem for imported names #3798
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 21 Oct 2013 16:50:43 +0000 (16:50 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 21 Oct 2013 16:50:43 +0000 (16:50 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NameHelper.java

index aa626693b9b9e75181723a74c2919e0d18658913..0058d91d69ba07caf655a52023d5f7748dc41423 100644 (file)
@@ -52,7 +52,11 @@ public class NameHelper {
        public static String getDisplayNameWithRef(TaxonBase taxonBase) {
                TaxonNameBase name = (TaxonNameBase) HibernateProxyHelper.deproxy(taxonBase.getName());
                if (name != null) {
-                       return name.generateFullTitle();
+                       String fullTitle = name.generateFullTitle();
+                       if (fullTitle != null){  //should never be null
+                               fullTitle = fullTitle.replaceAll("(\\r|\\n|\\r\\n)", "");  //replaces LineBreaks, maybe we should include U+000C, U+0085, U+2028, U+2029 which are also linebreaks according to UNICODE stardard.
+                       }
+                       return fullTitle;
                }
                return "";
        }