OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 180 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 180 Rev 182
Line 56... Line 56...
56
            }
56
            }
57
        }
57
        }
58
    }
58
    }
59
 
59
 
60
    // newline or line separator or paragraph separator
60
    // newline or line separator or paragraph separator
61
    static private final Pattern SEP_PATTERN = Pattern.compile("(\r?\n)|" + TextNode.VERTICAL_TAB_CHAR + "|\\p{Zl}|\\p{Zp}");
61
    static private final Pattern SEP_PATTERN = Pattern.compile("(\r?\n)|\f|" + TextNode.VERTICAL_TAB_CHAR + "|\\p{Zl}|\\p{Zp}");
62
 
62
 
63
    static private enum Sep {
63
    static private enum Sep {
64
        // allow to re-use exiting lines (be it a line-break or a new paragraph)
64
        // allow to re-use exiting lines (be it a line-break or a new paragraph)
65
        ANY,
65
        ANY,
66
        // explicit line-break
66
        // explicit line-break
Line 74... Line 74...
74
        final Sep res;
74
        final Sep res;
75
        if (codePoint == '\n' || codePoint == '\r') {
75
        if (codePoint == '\n' || codePoint == '\r') {
76
            res = Sep.ANY;
76
            res = Sep.ANY;
77
        } else if (codePoint == TextNode.VERTICAL_TAB_CHAR) {
77
        } else if (codePoint == TextNode.VERTICAL_TAB_CHAR) {
78
            res = Sep.LINE;
78
            res = Sep.LINE;
-
 
79
        } else if (codePoint == '\f') {
-
 
80
            res = Sep.PARAGRAPH;
79
        } else {
81
        } else {
80
            final int cat = Character.getType(codePoint);
82
            final int cat = Character.getType(codePoint);
81
            if (cat == Character.PARAGRAPH_SEPARATOR) {
83
            if (cat == Character.PARAGRAPH_SEPARATOR) {
82
                res = Sep.PARAGRAPH;
84
                res = Sep.PARAGRAPH;
83
            } else if (cat == Character.LINE_SEPARATOR) {
85
            } else if (cat == Character.LINE_SEPARATOR) {