Huw Davies : riched20: Return the underline pen as the return value.

Alexandre Julliard julliard at winehq.org
Mon Feb 19 13:52:02 CST 2018


Module: wine
Branch: master
Commit: 08c15246ca3de32f5f375d261c51b70e98b02665
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=08c15246ca3de32f5f375d261c51b70e98b02665

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Feb 19 09:36:01 2018 +0000

riched20: Return the underline pen as the return value.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/riched20/paint.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index b4b6697..d3b908a 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -216,9 +216,8 @@ static COLORREF get_back_color( ME_Context *c, ME_Style *style, BOOL highlight )
     return color;
 }
 
-static void get_underline_pen( ME_Style *style, COLORREF color, HPEN *pen )
+static HPEN get_underline_pen( ME_Style *style, COLORREF color )
 {
-    *pen = NULL;
     /* Choose the pen type for underlining the text. */
     if (style->fmt.dwEffects & CFE_UNDERLINE)
     {
@@ -227,11 +226,9 @@ static void get_underline_pen( ME_Style *style, COLORREF color, HPEN *pen )
         case CFU_UNDERLINE:
         case CFU_UNDERLINEWORD: /* native seems to map it to simple underline (MSDN) */
         case CFU_UNDERLINEDOUBLE: /* native seems to map it to simple underline (MSDN) */
-            *pen = CreatePen( PS_SOLID, 1, color );
-            break;
+            return CreatePen( PS_SOLID, 1, color );
         case CFU_UNDERLINEDOTTED:
-            *pen = CreatePen( PS_DOT, 1, color );
-            break;
+            return CreatePen( PS_DOT, 1, color );
         default:
             FIXME( "Unknown underline type (%u)\n", style->fmt.bUnderlineType );
             /* fall through */
@@ -240,14 +237,14 @@ static void get_underline_pen( ME_Style *style, COLORREF color, HPEN *pen )
             break;
         }
     }
-    return;
+    return NULL;
 }
 
 static void draw_underline( ME_Context *c, ME_Run *run, int x, int y, COLORREF color )
 {
     HPEN pen;
 
-    get_underline_pen( run->style, color, &pen );
+    pen = get_underline_pen( run->style, color );
     if (pen)
     {
         HPEN old_pen = SelectObject( c->hDC, pen );




More information about the wine-cvs mailing list