Aric Stewart : comctl32/tab: Return default tab width in TCM_SETMINTABWIDTH if lParam is a negative value .
Alexandre Julliard
julliard at winehq.org
Wed Dec 3 05:56:42 CST 2008
Module: wine
Branch: master
Commit: 110a6048af1d4e9f5384869b00ced148f7e93eee
URL: http://source.winehq.org/git/wine.git/?a=commit;h=110a6048af1d4e9f5384869b00ced148f7e93eee
Author: Aric Stewart <aric at codeweavers.com>
Date: Tue Dec 2 08:14:35 2008 -0600
comctl32/tab: Return default tab width in TCM_SETMINTABWIDTH if lParam is a negative value.
---
dlls/comctl32/tab.c | 5 ++++-
dlls/comctl32/tests/tab.c | 8 ++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c
index 6a9b8e8..0cc8cf9 100644
--- a/dlls/comctl32/tab.c
+++ b/dlls/comctl32/tab.c
@@ -2662,7 +2662,10 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx)
TRACE("(%p,%d)\n", infoPtr, cx);
- oldcx = infoPtr->tabMinWidth;
+ if (infoPtr->tabMinWidth < 0)
+ oldcx = DEFAULT_MIN_TAB_WIDTH;
+ else
+ oldcx = infoPtr->tabMinWidth;
infoPtr->tabMinWidth = cx;
TAB_SetItemBounds(infoPtr);
return oldcx;
diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c
index 9d98e11..61bab44 100644
--- a/dlls/comctl32/tests/tab.c
+++ b/dlls/comctl32/tests/tab.c
@@ -509,6 +509,9 @@ static void test_tab(INT nMinTabWidth)
hwTab = create_tabcontrol(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE);
SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth);
+ /* Get System default MinTabWidth */
+ if (nMinTabWidth < 0)
+ nMinTabWidth = SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth);
hdc = GetDC(hwTab);
dpi = GetDeviceCaps(hdc, LOGPIXELSX);
@@ -663,10 +666,7 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
"Parent after sequence, adding tab control to parent", TRUE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
- todo_wine{
- expect(DEFAULT_MIN_TAB_WIDTH, (int)SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1));
- }
- ok_sequence(sequences, TAB_SEQ_INDEX, set_min_tab_width_seq, "Set minTabWidth test sequence", FALSE);
+ ok(SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1) > 0,"TCM_SETMINTABWIDTH returned < 0\n");
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Set minTabWidth test parent sequence", FALSE);
/* Testing GetItemCount */
More information about the wine-cvs
mailing list