Skip to content

Commit

Permalink
process reviewer comments: start == str
Browse files Browse the repository at this point in the history
check on 0 char not needed anymore
  • Loading branch information
johanvos committed Jun 12, 2020
1 parent d345c74 commit 998f55c
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ private boolean check(long checkValue, String message, long context, long desc,

private Map<TextRun, Long> runUtf8 = new HashMap<>();
public void layout(TextRun run, PGFont font, FontStrike strike, char[] text) {
for (char c: text) {
if (c == 0) c = '\f';
}
/* Create the pango font and attribute list */
FontResource fr = font.getFontResource();
boolean composite = fr instanceof CompositeFontResource;
Expand Down Expand Up @@ -143,10 +140,9 @@ public void layout(TextRun run, PGFont font, FontStrike strike, char[] text) {
}

/* Itemize */
long start = OSPango.g_utf8_offset_to_pointer(str, run.getStart());
long utflen = OSPango.g_utf8_strlen(str,-1);
long end = OSPango.g_utf8_offset_to_pointer(str, utflen);
long runs = OSPango.pango_itemize(context, str, (int)(start - str), (int)(end - start), attrList, 0);
long runs = OSPango.pango_itemize(context, str, 0, (int)(end - str), attrList, 0);

if (runs != 0) {
/* Shape all PangoItem into PangoGlyphString */
Expand Down

0 comments on commit 998f55c

Please sign in to comment.