winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2019
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
672 discussions
Start a n
N
ew thread
Nikolay Sivov : mfplat: Implement MFInvokeCallback().
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: b4c5dd49a3e44992c0c5a96e2c6bee68d0ba5c75 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b4c5dd49a3e44992c0c5a96e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Feb 21 13:32:00 2019 +0300 mfplat: Implement MFInvokeCallback(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/mfplat.spec | 6 +++--- dlls/mfplat/queue.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ include/mfapi.h | 2 ++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec index 8f5ee77..e55cfb9 100644 --- a/dlls/mfplat/mfplat.spec +++ b/dlls/mfplat/mfplat.spec @@ -116,12 +116,12 @@ @ stub MFInitMediaTypeFromWaveFormatEx @ stub MFInitVideoFormat @ stub MFInitVideoFormat_RGB -@ stub MFInvokeCallback +@ stdcall MFInvokeCallback(ptr) @ stub MFJoinIoPort @ stdcall MFLockPlatform() @ stdcall MFLockWorkQueue(long) -@ stub MFPutWorkItem -@ stub MFPutWorkItemEx +@ stdcall MFPutWorkItem(long ptr ptr) +@ stdcall MFPutWorkItemEx(long ptr) @ stub MFRecordError @ stub MFRemovePeriodicCallback @ stub MFScheduleWorkItem diff --git a/dlls/mfplat/queue.c b/dlls/mfplat/queue.c index 65f111b..ebc2ad4 100644 --- a/dlls/mfplat/queue.c +++ b/dlls/mfplat/queue.c @@ -331,3 +331,57 @@ HRESULT WINAPI MFUnlockWorkQueue(DWORD queue) return unlock_user_queue(queue); } + +/*********************************************************************** + * MFPutWorkItem (mfplat.@) + */ +HRESULT WINAPI MFPutWorkItem(DWORD queue, IMFAsyncCallback *callback, IUnknown *state) +{ + IMFAsyncResult *result; + HRESULT hr; + + TRACE("%#x, %p, %p.\n", queue, callback, state); + + if (FAILED(hr = MFCreateAsyncResult(NULL, callback, state, &result))) + return hr; + + hr = MFPutWorkItemEx(queue, result); + + IMFAsyncResult_Release(result); + + return hr; +} + +/*********************************************************************** + * MFPutWorkItemEx (mfplat.@) + */ +HRESULT WINAPI MFPutWorkItemEx(DWORD queue, IMFAsyncResult *result) +{ + FIXME("%#x, %p\n", queue, result); + + return E_NOTIMPL; +} + +/*********************************************************************** + * MFInvokeCallback (mfplat.@) + */ +HRESULT WINAPI MFInvokeCallback(IMFAsyncResult *result) +{ + MFASYNCRESULT *result_data = (MFASYNCRESULT *)result; + DWORD queue = MFASYNC_CALLBACK_QUEUE_STANDARD, flags; + HRESULT hr; + + TRACE("%p.\n", result); + + if (FAILED(IMFAsyncCallback_GetParameters(result_data->pCallback, &flags, &queue))) + queue = MFASYNC_CALLBACK_QUEUE_STANDARD; + + if (FAILED(MFLockWorkQueue(queue))) + queue = MFASYNC_CALLBACK_QUEUE_STANDARD; + + hr = MFPutWorkItemEx(queue, result); + + MFUnlockWorkQueue(queue); + + return hr; +} diff --git a/include/mfapi.h b/include/mfapi.h index d70a300..d85f740 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -102,6 +102,8 @@ HRESULT WINAPI MFTEnumEx(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_IN UINT32 *pcount); HRESULT WINAPI MFInvokeCallback(IMFAsyncResult *result); HRESULT WINAPI MFLockPlatform(void); +HRESULT WINAPI MFPutWorkItem(DWORD queue, IMFAsyncCallback *callback, IUnknown *state); +HRESULT WINAPI MFPutWorkItemEx(DWORD queue, IMFAsyncResult *result); HRESULT WINAPI MFTRegister(CLSID clsid, GUID category, LPWSTR name, UINT32 flags, UINT32 cinput, MFT_REGISTER_TYPE_INFO *input_types, UINT32 coutput, MFT_REGISTER_TYPE_INFO *output_types, IMFAttributes *attributes);
1
0
0
0
Henri Verbeet : wined3d: Get rid of unused wined3d_blit_op enum elements.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 0f0d4b147737eda9e26782221f11cc3d937dbfbb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0f0d4b147737eda9e2678222…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Feb 20 13:55:12 2019 +0330 wined3d: Get rid of unused wined3d_blit_op enum elements. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/wined3d_private.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 5751bb2..a8ba1d0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2106,8 +2106,6 @@ enum wined3d_blit_op WINED3D_BLIT_OP_COLOR_BLIT, WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST, WINED3D_BLIT_OP_COLOR_BLIT_CKEY, - WINED3D_BLIT_OP_COLOR_FILL, - WINED3D_BLIT_OP_DEPTH_FILL, WINED3D_BLIT_OP_DEPTH_BLIT, WINED3D_BLIT_OP_RAW_BLIT, };
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Implement LBS_NODATA for single-selection listboxes.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 8a9ff9fb1335fa1372ba37b8556ce8ef64a9083d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8a9ff9fb1335fa1372ba37b8…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 20 15:13:13 2019 +0200 user32/listbox: Implement LBS_NODATA for single-selection listboxes. The LBS_NODATA style's purpose is to drastically improve performance and memory usage on very large lists, since they should function as virtual lists. Thus, don't store any data for single-selection listboxes (descr->items always NULL). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=32374
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 87404c6..0be4867 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * TODO: - * - LBS_NODATA + * - LBS_NODATA for multi-selection listboxes */ #include <string.h> @@ -130,17 +130,20 @@ static BOOL resize_storage(LB_DESCR *descr, UINT items_size) items_size + LB_ARRAY_GRANULARITY * 2 < descr->items_size) { items_size = (items_size + LB_ARRAY_GRANULARITY - 1) & ~(LB_ARRAY_GRANULARITY - 1); - items = heap_realloc(descr->items, items_size * sizeof(LB_ITEMDATA)); - if (!items) + if ((descr->style & (LBS_NODATA | LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != LBS_NODATA) { - SEND_NOTIFICATION(descr, LBN_ERRSPACE); - return FALSE; + items = heap_realloc(descr->items, items_size * sizeof(LB_ITEMDATA)); + if (!items) + { + SEND_NOTIFICATION(descr, LBN_ERRSPACE); + return FALSE; + } + descr->items = items; } descr->items_size = items_size; - descr->items = items; } - if ((descr->style & LBS_NODATA) && items_size > descr->nb_items) + if ((descr->style & LBS_NODATA) && descr->items && items_size > descr->nb_items) { memset(&descr->items[descr->nb_items], 0, (items_size - descr->nb_items) * sizeof(LB_ITEMDATA)); @@ -185,6 +188,8 @@ static void insert_item_data(LB_DESCR *descr, UINT index, WCHAR *str, ULONG_PTR { LB_ITEMDATA *item; + if (!descr->items) return; + item = descr->items + index; if (index < descr->nb_items) memmove(item + 1, item, (descr->nb_items - index) * sizeof(LB_ITEMDATA)); @@ -199,6 +204,8 @@ static void remove_item_data(LB_DESCR *descr, UINT index) { LB_ITEMDATA *item; + if (!descr->items) return; + item = descr->items + index; if (index < descr->nb_items) memmove(item, item + 1, (descr->nb_items - index) * sizeof(LB_ITEMDATA)); @@ -1772,7 +1779,8 @@ static void LISTBOX_ResetContent( LB_DESCR *descr ) { INT i; - for(i = descr->nb_items - 1; i>=0; i--) LISTBOX_DeleteItem( descr, i); + if (!(descr->style & LBS_NODATA)) + for (i = descr->nb_items - 1; i >= 0; i--) LISTBOX_DeleteItem(descr, i); HeapFree( GetProcessHeap(), 0, descr->items ); descr->nb_items = 0; descr->top_item = 0;
1
0
0
0
Gabriel Ivăncescu : user32/tests: Test negative counts in LB_SETCOUNT.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 20c0dda05040f5f47465f455503aeb6e3f6fc0d1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=20c0dda05040f5f47465f455…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 20 15:13:14 2019 +0200 user32/tests: Test negative counts in LB_SETCOUNT. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/listbox.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 5bdffc5..d15b18a 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1893,6 +1893,11 @@ static void test_set_count( void ) GetUpdateRect( listbox, &r, TRUE ); ok( !IsRectEmpty( &r ), "got empty rect\n"); + ret = SendMessageA( listbox, LB_SETCOUNT, -5, 0 ); + ok( ret == 0, "got %d\n", ret ); + ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 ); + ok( ret == -5, "got %d\n", ret ); + DestroyWindow( listbox ); for (i = 0; i < ARRAY_SIZE(styles); ++i)
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Move the item data removal into a separate function.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 9f5865342180af56fddec002c995fd0ae5ac7bff URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9f5865342180af56fddec002…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 20 15:13:12 2019 +0200 user32/listbox: Move the item data removal into a separate function. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 7caf24c..87404c6 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -195,6 +195,15 @@ static void insert_item_data(LB_DESCR *descr, UINT index, WCHAR *str, ULONG_PTR item->selected = FALSE; } +static void remove_item_data(LB_DESCR *descr, UINT index) +{ + LB_ITEMDATA *item; + + item = descr->items + index; + if (index < descr->nb_items) + memmove(item, item + 1, (descr->nb_items - index) * sizeof(LB_ITEMDATA)); +} + /********************************************************************* * listbox class descriptor */ @@ -1709,8 +1718,6 @@ static void LISTBOX_DeleteItem( LB_DESCR *descr, INT index ) */ static LRESULT LISTBOX_RemoveItem( LB_DESCR *descr, INT index ) { - LB_ITEMDATA *item; - if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; /* We need to invalidate the original rect instead of the updated one. */ @@ -1723,15 +1730,9 @@ static LRESULT LISTBOX_RemoveItem( LB_DESCR *descr, INT index ) } descr->nb_items--; LISTBOX_DeleteItem( descr, index ); + remove_item_data(descr, index); - /* Remove the item */ - - item = &descr->items[index]; - if (index < descr->nb_items) - RtlMoveMemory( item, item + 1, - (descr->nb_items - index) * sizeof(LB_ITEMDATA) ); if (descr->anchor_item == descr->nb_items) descr->anchor_item--; - resize_storage(descr, descr->nb_items); /* Repaint the items */
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Use a helper to set item height by index.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 9b6d9cb8ae7b5b12783dc92c387afe4b37c16209 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9b6d9cb8ae7b5b12783dc92c…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 20 15:13:10 2019 +0200 user32/listbox: Use a helper to set item height by index. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 9cecd00..7dc3e66 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -163,6 +163,11 @@ static UINT get_item_height( const LB_DESCR *descr, UINT index ) return (descr->style & LBS_NODATA) ? 0 : descr->items[index].height; } +static void set_item_height( LB_DESCR *descr, UINT index, UINT height ) +{ + if (!(descr->style & LBS_NODATA)) descr->items[index].height = height; +} + static BOOL is_item_selected( const LB_DESCR *descr, UINT index ) { if (!(descr->style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL))) @@ -1243,7 +1248,7 @@ static LRESULT LISTBOX_SetItemHeight( LB_DESCR *descr, INT index, INT height, BO return LB_ERR; } TRACE("[%p]: item %d height = %d\n", descr->self, index, height ); - descr->items[index].height = height; + set_item_height(descr, index, height); LISTBOX_UpdateScroll( descr ); if (repaint) LISTBOX_InvalidateItems( descr, index ); @@ -1600,7 +1605,7 @@ static LRESULT LISTBOX_InsertItem( LB_DESCR *descr, INT index, mis.itemData = str ? (ULONG_PTR)str : data; mis.itemHeight = descr->item_height; SendMessageW( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis ); - item->height = mis.itemHeight ? mis.itemHeight : 1; + set_item_height(descr, index, mis.itemHeight ? mis.itemHeight : 1); TRACE("[%p]: measure item %d (%s) = %d\n", descr->self, index, str ? debugstr_w(str) : "", get_item_height(descr, index)); }
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Use a helper to retrieve item height by index.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 4a27ea8494ccc149ed36279eb123a4296fad2062 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4a27ea8494ccc149ed36279e…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 20 15:13:09 2019 +0200 user32/listbox: Use a helper to retrieve item height by index. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 118f564..9cecd00 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -158,6 +158,11 @@ static WCHAR *get_item_string( const LB_DESCR *descr, UINT index ) return HAS_STRINGS(descr) ? descr->items[index].str : NULL; } +static UINT get_item_height( const LB_DESCR *descr, UINT index ) +{ + return (descr->style & LBS_NODATA) ? 0 : descr->items[index].height; +} + static BOOL is_item_selected( const LB_DESCR *descr, UINT index ) { if (!(descr->style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL))) @@ -212,7 +217,7 @@ static INT LISTBOX_GetCurrentPageSize( const LB_DESCR *descr ) if (!(descr->style & LBS_OWNERDRAWVARIABLE)) return descr->page_size; for (i = descr->top_item, height = 0; i < descr->nb_items; i++) { - if ((height += descr->items[i].height) > descr->height) break; + if ((height += get_item_height(descr, i)) > descr->height) break; } if (i == descr->top_item) return 1; else return i - descr->top_item; @@ -232,7 +237,7 @@ static INT LISTBOX_GetMaxTopIndex( const LB_DESCR *descr ) { page = descr->height; for (max = descr->nb_items - 1; max >= 0; max--) - if ((page -= descr->items[max].height) < 0) break; + if ((page -= get_item_height(descr, max)) < 0) break; if (max < descr->nb_items - 1) max++; } else if (descr->style & LBS_MULTICOLUMN) @@ -360,12 +365,12 @@ static LRESULT LISTBOX_SetTopItem( LB_DESCR *descr, INT index, BOOL scroll ) if (index > descr->top_item) { for (i = index - 1; i >= descr->top_item; i--) - dy -= descr->items[i].height; + dy -= get_item_height(descr, i); } else { for (i = index; i < descr->top_item; i++) - dy += descr->items[i].height; + dy += get_item_height(descr, i); } } else @@ -481,14 +486,14 @@ static LRESULT LISTBOX_GetItemRect( const LB_DESCR *descr, INT index, RECT *rect if (index < descr->top_item) { for (i = descr->top_item-1; i >= index; i--) - rect->top -= descr->items[i].height; + rect->top -= get_item_height(descr, i); } else { for (i = descr->top_item; i < index; i++) - rect->top += descr->items[i].height; + rect->top += get_item_height(descr, i); } - rect->bottom = rect->top + descr->items[index].height; + rect->bottom = rect->top + get_item_height(descr, index); } } @@ -523,7 +528,7 @@ static INT LISTBOX_GetItemFromPoint( const LB_DESCR *descr, INT x, INT y ) { while (index < descr->nb_items) { - if ((pos += descr->items[index].height) > y) break; + if ((pos += get_item_height(descr, index)) > y) break; index++; } } @@ -532,7 +537,7 @@ static INT LISTBOX_GetItemFromPoint( const LB_DESCR *descr, INT x, INT y ) while (index > 0) { index--; - if ((pos -= descr->items[index].height) <= y) break; + if ((pos -= get_item_height(descr, index)) <= y) break; } } } @@ -1099,7 +1104,7 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) if (!(descr->style & LBS_OWNERDRAWVARIABLE)) rect.bottom = rect.top + descr->item_height; else - rect.bottom = rect.top + descr->items[i].height; + rect.bottom = rect.top + get_item_height(descr, i); /* keep the focus rect, to paint the focus item after */ if (i == descr->focus_item) @@ -1214,7 +1219,7 @@ static LRESULT LISTBOX_GetItemHeight( const LB_DESCR *descr, INT index ) SetLastError(ERROR_INVALID_INDEX); return LB_ERR; } - return descr->items[index].height; + return get_item_height(descr, index); } else return descr->item_height; } @@ -1384,9 +1389,9 @@ static void LISTBOX_MakeItemVisible( LB_DESCR *descr, INT index, BOOL fully ) } else if (descr->style & LBS_OWNERDRAWVARIABLE) { - INT height = fully ? descr->items[index].height : 1; + INT height = fully ? get_item_height(descr, index) : 1; for (top = index; top > descr->top_item; top--) - if ((height += descr->items[top-1].height) > descr->height) break; + if ((height += get_item_height(descr, top - 1)) > descr->height) break; } else { @@ -1597,7 +1602,7 @@ static LRESULT LISTBOX_InsertItem( LB_DESCR *descr, INT index, SendMessageW( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis ); item->height = mis.itemHeight ? mis.itemHeight : 1; TRACE("[%p]: measure item %d (%s) = %d\n", - descr->self, index, str ? debugstr_w(str) : "", item->height ); + descr->self, index, str ? debugstr_w(str) : "", get_item_height(descr, index)); } /* Repaint the items */
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Move the item data insertion into a separate function.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: ff1ebccdd0e3e41298f2e14cad7f43edc8551e8a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff1ebccdd0e3e41298f2e14c…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 20 15:13:11 2019 +0200 user32/listbox: Move the item data insertion into a separate function. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 7dc3e66..7caf24c 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -181,6 +181,20 @@ static void set_item_selected_state(LB_DESCR *descr, UINT index, BOOL state) descr->items[index].selected = state; } +static void insert_item_data(LB_DESCR *descr, UINT index, WCHAR *str, ULONG_PTR data) +{ + LB_ITEMDATA *item; + + item = descr->items + index; + if (index < descr->nb_items) + memmove(item + 1, item, (descr->nb_items - index) * sizeof(LB_ITEMDATA)); + + item->str = str; + item->data = HAS_STRINGS(descr) ? 0 : data; + item->height = 0; + item->selected = FALSE; +} + /********************************************************************* * listbox class descriptor */ @@ -1573,23 +1587,13 @@ static void LISTBOX_MoveCaret( LB_DESCR *descr, INT index, BOOL fully_visible ) static LRESULT LISTBOX_InsertItem( LB_DESCR *descr, INT index, LPWSTR str, ULONG_PTR data ) { - LB_ITEMDATA *item; INT oldfocus = descr->focus_item; if (index == -1) index = descr->nb_items; else if ((index < 0) || (index > descr->nb_items)) return LB_ERR; if (!resize_storage(descr, descr->nb_items + 1)) return LB_ERR; - /* Insert the item structure */ - - item = &descr->items[index]; - if (index < descr->nb_items) - RtlMoveMemory( item + 1, item, - (descr->nb_items - index) * sizeof(LB_ITEMDATA) ); - item->str = str; - item->data = HAS_STRINGS(descr) ? 0 : data; - item->height = 0; - item->selected = FALSE; + insert_item_data(descr, index, str, data); descr->nb_items++; /* Get item height */
1
0
0
0
Michael Stefaniuc : wineandroid.drv: Remove redundant not-NULL checks ( coccinellery).
by Alexandre Julliard
20 Feb '19
20 Feb '19
Module: wine Branch: master Commit: c0cc126d579e078f2804112c14f0c18b38f68937 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c0cc126d579e078f2804112c…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Feb 20 20:54:26 2019 +0100 wineandroid.drv: Remove redundant not-NULL checks (coccinellery). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineandroid.drv/device.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/dlls/wineandroid.drv/device.c b/dlls/wineandroid.drv/device.c index 0800ad7..0b8bf67 100644 --- a/dlls/wineandroid.drv/device.c +++ b/dlls/wineandroid.drv/device.c @@ -520,8 +520,8 @@ static void CALLBACK register_native_window_callback( ULONG_PTR arg1, ULONG_PTR if (!data || data->parent == win) { - if (win) pANativeWindow_release( win ); - if (data && win) PostMessageW( hwnd, WM_ANDROID_REFRESH, opengl, 0 ); + pANativeWindow_release( win ); + if (data) PostMessageW( hwnd, WM_ANDROID_REFRESH, opengl, 0 ); TRACE( "%p -> %p win %p (unchanged)\n", hwnd, data, win ); return; } @@ -529,15 +529,12 @@ static void CALLBACK register_native_window_callback( ULONG_PTR arg1, ULONG_PTR release_native_window( data ); data->parent = win; data->generation++; - if (win) - { - wrap_java_call(); - if (data->api) win->perform( win, NATIVE_WINDOW_API_CONNECT, data->api ); - win->perform( win, NATIVE_WINDOW_SET_BUFFERS_FORMAT, data->buffer_format ); - win->setSwapInterval( win, data->swap_interval ); - unwrap_java_call(); - PostMessageW( hwnd, WM_ANDROID_REFRESH, opengl, 0 ); - } + wrap_java_call(); + if (data->api) win->perform( win, NATIVE_WINDOW_API_CONNECT, data->api ); + win->perform( win, NATIVE_WINDOW_SET_BUFFERS_FORMAT, data->buffer_format ); + win->setSwapInterval( win, data->swap_interval ); + unwrap_java_call(); + PostMessageW( hwnd, WM_ANDROID_REFRESH, opengl, 0 ); TRACE( "%p -> %p win %p\n", hwnd, data, win ); }
1
0
0
0
Michael Stefaniuc : kernel32: Remove redundant not 0 check (coccinellery).
by Alexandre Julliard
20 Feb '19
20 Feb '19
Module: wine Branch: master Commit: 099303c4590d0f76274f9e9cdbc707fee6e3209b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=099303c4590d0f76274f9e9c…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Feb 20 20:54:25 2019 +0100 kernel32: Remove redundant not 0 check (coccinellery). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c index 3419898..eb0471c 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -1612,7 +1612,7 @@ DWORD WINAPI K32GetModuleFileNameExA(HANDLE process, HMODULE module, if ( process == GetCurrentProcess() ) { len = GetModuleFileNameA( module, file_name, size ); - if (size) file_name[size - 1] = '\0'; + file_name[size - 1] = '\0'; return len; }
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
68
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Results per page:
10
25
50
100
200