Huw Davies : wordpad: Keep the list indentation aligned when the margins are changed.

Alexandre Julliard julliard at winehq.org
Tue Oct 11 15:21:10 CDT 2016


Module: wine
Branch: master
Commit: 9a1cc45edd8d1db98fbcf78697f4100ddb329b4a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9a1cc45edd8d1db98fbcf78697f4100ddb329b4a

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Oct 11 13:01:12 2016 +0100

wordpad: Keep the list indentation aligned when the margins are changed.

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

---

 programs/wordpad/wordpad.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index 8d07d7b..f0a7d14 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -1579,8 +1579,15 @@ static INT_PTR CALLBACK paraformat_proc(HWND hWnd, UINT message, WPARAM wParam,
                         int index;
                         float num;
                         int ret = 0;
-                        PARAFORMAT pf;
+                        PARAFORMAT2 pf;
                         UNIT unit;
+                        BOOL in_list = FALSE;
+
+                        pf.cbSize = sizeof(pf);
+                        pf.dwMask = PFM_NUMBERING;
+                        SendMessageW(hEditorWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
+                        if ((pf.dwMask & PFM_NUMBERING) && pf.wNumbering)
+                            in_list = TRUE;
 
                         index = SendMessageW(hListWnd, CB_GETCURSEL, 0, 0);
                         pf.wAlignment = ALIGNMENT_VALUES[index];
@@ -1630,6 +1637,12 @@ static INT_PTR CALLBACK paraformat_proc(HWND hWnd, UINT message, WPARAM wParam,
                             pf.cbSize = sizeof(pf);
                             pf.dwMask = PFM_ALIGNMENT | PFM_OFFSET | PFM_RIGHTINDENT |
                                         PFM_STARTINDENT;
+                            if (in_list)
+                            {
+                                pf.wNumberingTab = max(pf.dxOffset, 0);
+                                pf.dwMask |= PFM_NUMBERINGTAB;
+                            }
+
                             SendMessageW(hEditorWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
                         }
                     }




More information about the wine-cvs mailing list