Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/a5222b579b8202f130e0afceb570b6e700385efe
...commit
http://git.netsurf-browser.org/netsurf.git/commit/a5222b579b8202f130e0afceb570b6e700385efe
...tree
http://git.netsurf-browser.org/netsurf.git/tree/a5222b579b8202f130e0afceb570b6e700385efe
The branch, master has been updated
via a5222b579b8202f130e0afceb570b6e700385efe (commit)
via e3b2f792c0250d219dc56976f8305a05b6b04e36 (commit)
via 24b7fdf4382dcef274092b4735093fc390815455 (commit)
from bb2341898113f37936832c8828bd515c3e3860c9 (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=a5222b579b8202f130e0afceb570b6e700385efe
commit a5222b579b8202f130e0afceb570b6e700385efe
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Windows: Fix font table to return nserror.
We were returning true on success, which when the return value was
tested for being NSERROR_OK (0), meant it was treated as failure.
Now we correctly return NSERROR_OK on success.
diff --git a/frontends/windows/font.c b/frontends/windows/font.c
index 551a0eb..1e99a78 100644
--- a/frontends/windows/font.c
+++ b/frontends/windows/font.c
@@ -138,7 +138,7 @@ HFONT get_font(const plot_font_style_t *style)
* \param[in] string UTF-8 string to measure
* \param[in] length length of string, in bytes
* \param[out] width updated to width of string[0..length)
- * \return true on success and width updated else false
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_width(const plot_font_style_t *style,
@@ -150,7 +150,7 @@ win32_font_width(const plot_font_style_t *style,
HFONT font;
HFONT fontbak;
SIZE s;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if (length == 0) {
*width = 0;
@@ -163,7 +163,7 @@ win32_font_width(const plot_font_style_t *style,
if (GetTextExtentPoint32A(hdc, string, length, &s) != 0) {
*width = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -183,7 +183,7 @@ win32_font_width(const plot_font_style_t *style,
* \param x x coordinate to search for
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_position(const plot_font_style_t *style,
@@ -198,7 +198,7 @@ win32_font_position(const plot_font_style_t *style,
HFONT fontbak;
SIZE s;
int offset;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if ((length == 0) || (x < 1)) {
*char_offset = 0;
@@ -213,7 +213,7 @@ win32_font_position(const plot_font_style_t *style,
*char_offset = (size_t)offset;
*actual_x = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -234,7 +234,7 @@ win32_font_position(const plot_font_style_t *style,
* \param x width available
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*
* On exit, [char_offset == 0 ||
* string[char_offset] == ' ' ||
@@ -249,13 +249,14 @@ win32_font_split(const plot_font_style_t *style,
int *actual_x)
{
int c_off;
- bool ret = false;
+ nserror ret = NSERROR_UNKNOWN;
if (win32_font_position(style, string, length, x, char_offset,
actual_x)) {
c_off = *char_offset;
if (*char_offset == length) {
- ret = true;
+ ret = NSERROR_OK;
} else {
+ bool success;
while ((string[*char_offset] != ' ') &&
(*char_offset > 0)) {
(*char_offset)--;
@@ -269,7 +270,10 @@ win32_font_split(const plot_font_style_t *style,
}
}
- ret = win32_font_width(style, string, *char_offset,
actual_x);
+ success = win32_font_width(style, string, *char_offset,
actual_x);
+ if (success) {
+ ret = NSERROR_OK;
+ }
}
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=e3b2f792c0250d219dc56976f8305a05b6b04e36
commit e3b2f792c0250d219dc56976f8305a05b6b04e36
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Framebuffer: Fix internal font table to return nserror.
We were returning true on success, which when the return value was
tested for being NSERROR_OK (0), meant it was treated as failure.
Now we correctly return NSERROR_OK on success.
diff --git a/frontends/framebuffer/font_internal.c
b/frontends/framebuffer/font_internal.c
index 9164a29..3fd3ac6 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -364,7 +364,7 @@ fb_font_width(const plot_font_style_t *fstyle,
}
*width *= fb_get_font_size(fstyle);
- return true;
+ return NSERROR_OK;
}
@@ -397,7 +397,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = x_pos;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -455,7 +455,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -463,7 +463,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=24b7fdf4382dcef274092b4735093fc390815455
commit 24b7fdf4382dcef274092b4735093fc390815455
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Framebuffer: Fix freetype font table to return nserror.
We were returning true on success, which when the return value was
tested for being NSERROR_OK (0), meant it was treated as failure.
Now we correctly return NSERROR_OK on success.
diff --git a/frontends/framebuffer/font_freetype.c
b/frontends/framebuffer/font_freetype.c
index 9235ad4..3239820 100644
--- a/frontends/framebuffer/font_freetype.c
+++ b/frontends/framebuffer/font_freetype.c
@@ -444,8 +444,7 @@ fb_font_width(const plot_font_style_t *fstyle,
*width += glyph->advance.x >> 16;
}
-
- return true;
+ return NSERROR_OK;
}
@@ -481,7 +480,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = prev_x;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -537,7 +536,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -545,7 +544,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
static struct gui_layout_table layout_table = {
-----------------------------------------------------------------------
Summary of changes:
frontends/framebuffer/font_freetype.c | 9 ++++-----
frontends/framebuffer/font_internal.c | 8 ++++----
frontends/windows/font.c | 24 ++++++++++++++----------
3 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/frontends/framebuffer/font_freetype.c
b/frontends/framebuffer/font_freetype.c
index 9235ad4..3239820 100644
--- a/frontends/framebuffer/font_freetype.c
+++ b/frontends/framebuffer/font_freetype.c
@@ -444,8 +444,7 @@ fb_font_width(const plot_font_style_t *fstyle,
*width += glyph->advance.x >> 16;
}
-
- return true;
+ return NSERROR_OK;
}
@@ -481,7 +480,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = prev_x;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -537,7 +536,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -545,7 +544,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
static struct gui_layout_table layout_table = {
diff --git a/frontends/framebuffer/font_internal.c
b/frontends/framebuffer/font_internal.c
index 9164a29..3fd3ac6 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -364,7 +364,7 @@ fb_font_width(const plot_font_style_t *fstyle,
}
*width *= fb_get_font_size(fstyle);
- return true;
+ return NSERROR_OK;
}
@@ -397,7 +397,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = x_pos;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -455,7 +455,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -463,7 +463,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
diff --git a/frontends/windows/font.c b/frontends/windows/font.c
index 551a0eb..1e99a78 100644
--- a/frontends/windows/font.c
+++ b/frontends/windows/font.c
@@ -138,7 +138,7 @@ HFONT get_font(const plot_font_style_t *style)
* \param[in] string UTF-8 string to measure
* \param[in] length length of string, in bytes
* \param[out] width updated to width of string[0..length)
- * \return true on success and width updated else false
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_width(const plot_font_style_t *style,
@@ -150,7 +150,7 @@ win32_font_width(const plot_font_style_t *style,
HFONT font;
HFONT fontbak;
SIZE s;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if (length == 0) {
*width = 0;
@@ -163,7 +163,7 @@ win32_font_width(const plot_font_style_t *style,
if (GetTextExtentPoint32A(hdc, string, length, &s) != 0) {
*width = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -183,7 +183,7 @@ win32_font_width(const plot_font_style_t *style,
* \param x x coordinate to search for
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_position(const plot_font_style_t *style,
@@ -198,7 +198,7 @@ win32_font_position(const plot_font_style_t *style,
HFONT fontbak;
SIZE s;
int offset;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if ((length == 0) || (x < 1)) {
*char_offset = 0;
@@ -213,7 +213,7 @@ win32_font_position(const plot_font_style_t *style,
*char_offset = (size_t)offset;
*actual_x = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -234,7 +234,7 @@ win32_font_position(const plot_font_style_t *style,
* \param x width available
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*
* On exit, [char_offset == 0 ||
* string[char_offset] == ' ' ||
@@ -249,13 +249,14 @@ win32_font_split(const plot_font_style_t *style,
int *actual_x)
{
int c_off;
- bool ret = false;
+ nserror ret = NSERROR_UNKNOWN;
if (win32_font_position(style, string, length, x, char_offset,
actual_x)) {
c_off = *char_offset;
if (*char_offset == length) {
- ret = true;
+ ret = NSERROR_OK;
} else {
+ bool success;
while ((string[*char_offset] != ' ') &&
(*char_offset > 0)) {
(*char_offset)--;
@@ -269,7 +270,10 @@ win32_font_split(const plot_font_style_t *style,
}
}
- ret = win32_font_width(style, string, *char_offset,
actual_x);
+ success = win32_font_width(style, string, *char_offset,
actual_x);
+ if (success) {
+ ret = NSERROR_OK;
+ }
}
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org