Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/cae22b17ac28ba77d72ecf9d6bd33614981713cf
...commit
http://git.netsurf-browser.org/netsurf.git/commit/cae22b17ac28ba77d72ecf9d6bd33614981713cf
...tree
http://git.netsurf-browser.org/netsurf.git/tree/cae22b17ac28ba77d72ecf9d6bd33614981713cf
The branch, master has been updated
via cae22b17ac28ba77d72ecf9d6bd33614981713cf (commit)
via d6b6dafe50807138da5ad340157042318bc36615 (commit)
from e44bd09ac3a28823d9947c54949d115619003fe4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=cae22b17ac28ba77d72ecf9d6bd33614981713cf
commit cae22b17ac28ba77d72ecf9d6bd33614981713cf
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
fix RISC OS font layout routines to return the correct error codes
During the font layout table refactor the return type was changed to
nserror and the risc os code was not updated correctly.
diff --git a/riscos/font.c b/riscos/font.c
index 99542a4..2f2ba9a 100644
--- a/riscos/font.c
+++ b/riscos/font.c
@@ -221,7 +221,7 @@ ro_font_width(const plot_font_style_t *fstyle,
nsfont_read_style(fstyle, &font_family, &font_size, &font_style);
if (font_size == 0) {
*width = 0;
- return true;
+ return NSERROR_OK;
}
code = rufl_width(font_family, font_style, font_size,
@@ -234,11 +234,11 @@ ro_font_width(const plot_font_style_t *fstyle,
LOG("rufl_width: 0x%x", code);
/* ro_warn_user("MiscError", "font error"); */
*width = 0;
- return false;
+ return NSERROR_INVALID;
}
*width /= 2;
- return true;
+ return NSERROR_OK;
}
@@ -267,7 +267,7 @@ ro_font_position(const plot_font_style_t *fstyle,
if (font_size == 0) {
*char_offset = 0;
*actual_x = 0;
- return true;
+ return NSERROR_OK;
}
code = rufl_x_to_offset(font_family, font_style, font_size,
@@ -281,11 +281,12 @@ ro_font_position(const plot_font_style_t *fstyle,
/* ro_warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
- return false;
+ return NSERROR_INVALID;
}
*actual_x /= 2;
- return true;
+
+ return NSERROR_OK;
}
@@ -325,21 +326,23 @@ ro_font_split(const plot_font_style_t *fstyle,
if (font_size == 0) {
*char_offset = 0;
*actual_x = 0;
- return true;
+ return NSERROR_OK;
}
code = rufl_split(font_family, font_style, font_size,
string, length,
x * 2, char_offset, actual_x);
if (code != rufl_OK) {
- if (code == rufl_FONT_MANAGER_ERROR)
- LOG("rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s",
rufl_fm_error->errnum, rufl_fm_error->errmess);
- else
+ if (code == rufl_FONT_MANAGER_ERROR) {
+ LOG("rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s",
+ rufl_fm_error->errnum, rufl_fm_error->errmess);
+ } else {
LOG("rufl_split: 0x%x", code);
+ }
/* ro_warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
- return false;
+ return NSERROR_INVALID;
}
if (*char_offset != length) {
@@ -347,15 +350,17 @@ ro_font_split(const plot_font_style_t *fstyle,
size_t orig = *char_offset;
/* ensure a space at <= the split point we found */
- while (*char_offset && string[*char_offset] != ' ')
+ while (*char_offset && string[*char_offset] != ' ') {
(*char_offset)--;
+ }
/* nothing valid found <= split point, advance to next space */
if (*char_offset == 0) {
*char_offset = orig;
- while (*char_offset != length &&
- string[*char_offset] != ' ')
+ while ((*char_offset != length) &&
+ (string[*char_offset] != ' ')) {
(*char_offset)++;
+ }
}
}
@@ -363,18 +368,20 @@ ro_font_split(const plot_font_style_t *fstyle,
string, *char_offset,
actual_x);
if (code != rufl_OK) {
- if (code == rufl_FONT_MANAGER_ERROR)
- LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
rufl_fm_error->errnum, rufl_fm_error->errmess);
- else
+ if (code == rufl_FONT_MANAGER_ERROR) {
+ LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
+ rufl_fm_error->errnum, rufl_fm_error->errmess);
+ } else {
LOG("rufl_width: 0x%x", code);
+ }
/* ro_warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
- return false;
+ return NSERROR_INVALID;
}
*actual_x /= 2;
- return true;
+ return NSERROR_OK;
}
@@ -407,10 +414,11 @@ bool nsfont_paint(const plot_font_style_t *fstyle, const
char *string,
code = rufl_paint(font_family, font_style, font_size,
string, length, x, y, flags);
if (code != rufl_OK) {
- if (code == rufl_FONT_MANAGER_ERROR)
+ if (code == rufl_FONT_MANAGER_ERROR) {
LOG("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
rufl_fm_error->errnum, rufl_fm_error->errmess);
- else
+ } else {
LOG("rufl_paint: 0x%x", code);
+ }
}
return true;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=d6b6dafe50807138da5ad340157042318bc36615
commit d6b6dafe50807138da5ad340157042318bc36615
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
fix plain text render regression introduced in layout table changes
diff --git a/render/textplain.c b/render/textplain.c
index e999c35..c825b79 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -924,6 +924,7 @@ bool textplain_redraw(struct content *c, struct
content_redraw_data *data,
size_t next_offset = offset;
int width;
int ntx;
+ nserror res;
while (next_offset < length && text_d[next_offset] !=
'\t')
next_offset = utf8_next(text_d, length,
next_offset);
@@ -940,11 +941,12 @@ bool textplain_redraw(struct content *c, struct
content_redraw_data *data,
if (next_offset >= length)
break;
- /* locate end of string and align to next tab position
*/
- if (guit->layout->width(&textplain_style,
+ res = guit->layout->width(&textplain_style,
&text_d[offset],
next_offset - offset,
- &width)) {
+ &width);
+ /* locate end of string and align to next tab position
*/
+ if (res == NSERROR_OK) {
tx += (int)(width * data->scale);
}
-----------------------------------------------------------------------
Summary of changes:
render/textplain.c | 8 +++++---
riscos/font.c | 50 +++++++++++++++++++++++++++++---------------------
2 files changed, 34 insertions(+), 24 deletions(-)
diff --git a/render/textplain.c b/render/textplain.c
index e999c35..c825b79 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -924,6 +924,7 @@ bool textplain_redraw(struct content *c, struct
content_redraw_data *data,
size_t next_offset = offset;
int width;
int ntx;
+ nserror res;
while (next_offset < length && text_d[next_offset] !=
'\t')
next_offset = utf8_next(text_d, length,
next_offset);
@@ -940,11 +941,12 @@ bool textplain_redraw(struct content *c, struct
content_redraw_data *data,
if (next_offset >= length)
break;
- /* locate end of string and align to next tab position
*/
- if (guit->layout->width(&textplain_style,
+ res = guit->layout->width(&textplain_style,
&text_d[offset],
next_offset - offset,
- &width)) {
+ &width);
+ /* locate end of string and align to next tab position
*/
+ if (res == NSERROR_OK) {
tx += (int)(width * data->scale);
}
diff --git a/riscos/font.c b/riscos/font.c
index 99542a4..2f2ba9a 100644
--- a/riscos/font.c
+++ b/riscos/font.c
@@ -221,7 +221,7 @@ ro_font_width(const plot_font_style_t *fstyle,
nsfont_read_style(fstyle, &font_family, &font_size, &font_style);
if (font_size == 0) {
*width = 0;
- return true;
+ return NSERROR_OK;
}
code = rufl_width(font_family, font_style, font_size,
@@ -234,11 +234,11 @@ ro_font_width(const plot_font_style_t *fstyle,
LOG("rufl_width: 0x%x", code);
/* ro_warn_user("MiscError", "font error"); */
*width = 0;
- return false;
+ return NSERROR_INVALID;
}
*width /= 2;
- return true;
+ return NSERROR_OK;
}
@@ -267,7 +267,7 @@ ro_font_position(const plot_font_style_t *fstyle,
if (font_size == 0) {
*char_offset = 0;
*actual_x = 0;
- return true;
+ return NSERROR_OK;
}
code = rufl_x_to_offset(font_family, font_style, font_size,
@@ -281,11 +281,12 @@ ro_font_position(const plot_font_style_t *fstyle,
/* ro_warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
- return false;
+ return NSERROR_INVALID;
}
*actual_x /= 2;
- return true;
+
+ return NSERROR_OK;
}
@@ -325,21 +326,23 @@ ro_font_split(const plot_font_style_t *fstyle,
if (font_size == 0) {
*char_offset = 0;
*actual_x = 0;
- return true;
+ return NSERROR_OK;
}
code = rufl_split(font_family, font_style, font_size,
string, length,
x * 2, char_offset, actual_x);
if (code != rufl_OK) {
- if (code == rufl_FONT_MANAGER_ERROR)
- LOG("rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s",
rufl_fm_error->errnum, rufl_fm_error->errmess);
- else
+ if (code == rufl_FONT_MANAGER_ERROR) {
+ LOG("rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s",
+ rufl_fm_error->errnum, rufl_fm_error->errmess);
+ } else {
LOG("rufl_split: 0x%x", code);
+ }
/* ro_warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
- return false;
+ return NSERROR_INVALID;
}
if (*char_offset != length) {
@@ -347,15 +350,17 @@ ro_font_split(const plot_font_style_t *fstyle,
size_t orig = *char_offset;
/* ensure a space at <= the split point we found */
- while (*char_offset && string[*char_offset] != ' ')
+ while (*char_offset && string[*char_offset] != ' ') {
(*char_offset)--;
+ }
/* nothing valid found <= split point, advance to next space */
if (*char_offset == 0) {
*char_offset = orig;
- while (*char_offset != length &&
- string[*char_offset] != ' ')
+ while ((*char_offset != length) &&
+ (string[*char_offset] != ' ')) {
(*char_offset)++;
+ }
}
}
@@ -363,18 +368,20 @@ ro_font_split(const plot_font_style_t *fstyle,
string, *char_offset,
actual_x);
if (code != rufl_OK) {
- if (code == rufl_FONT_MANAGER_ERROR)
- LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
rufl_fm_error->errnum, rufl_fm_error->errmess);
- else
+ if (code == rufl_FONT_MANAGER_ERROR) {
+ LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
+ rufl_fm_error->errnum, rufl_fm_error->errmess);
+ } else {
LOG("rufl_width: 0x%x", code);
+ }
/* ro_warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
- return false;
+ return NSERROR_INVALID;
}
*actual_x /= 2;
- return true;
+ return NSERROR_OK;
}
@@ -407,10 +414,11 @@ bool nsfont_paint(const plot_font_style_t *fstyle, const
char *string,
code = rufl_paint(font_family, font_style, font_size,
string, length, x, y, flags);
if (code != rufl_OK) {
- if (code == rufl_FONT_MANAGER_ERROR)
+ if (code == rufl_FONT_MANAGER_ERROR) {
LOG("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
rufl_fm_error->errnum, rufl_fm_error->errmess);
- else
+ } else {
LOG("rufl_paint: 0x%x", code);
+ }
}
return true;
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org