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
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
August 2011
----- 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
2 participants
770 discussions
Start a n
N
ew thread
Ričardas Barkauskas : ddraw/tests: Properly release no longer used interfaces.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 1a609ecab81bfa90d1aa3afbae0711e728f4e643 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a609ecab81bfa90d1aa3afba…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Aug 8 01:25:54 2011 +0300 ddraw/tests: Properly release no longer used interfaces. --- dlls/ddraw/tests/d3d.c | 4 ++-- dlls/ddraw/tests/dsurface.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 0df3780..2197c64 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -1365,8 +1365,8 @@ static void Direct3D1Test(void) /* Interface consistency check. */ hr = IDirect3DDevice_GetDirect3D(Direct3DDevice1, &Direct3D_alt); ok(hr == D3D_OK, "IDirect3DDevice_GetDirect3D failed: %08x\n", hr); - if (hr == D3D_OK) - ok(Direct3D_alt == Direct3D1, "Direct3D1 struct pointer missmatch: %p != %p\n", Direct3D_alt, Direct3D1); + ok(Direct3D_alt == Direct3D1, "Direct3D1 struct pointer missmatch: %p != %p\n", Direct3D_alt, Direct3D1); + IDirect3D_Release(Direct3D_alt); memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index b1a2940..1bbf5cc 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -3159,6 +3159,8 @@ static void GetDCTest(void) hr = IDirectDrawSurface4_ReleaseDC(surf4, dc); ok(SUCCEEDED(hr), "ReleaseDC failed, hr %#x.\n", hr); + IDirectDrawSurface_Release(tmp); + dc = CreateCompatibleDC(NULL); ok(!!dc, "CreateCompatibleDC failed.\n"); @@ -3175,11 +3177,12 @@ static void GetDCTest(void) ok(!tmp, "Expected surface NULL, got %p.\n", tmp); IDirectDrawSurface4_Release(surf4); + IDirectDrawSurface_Release(surf); IDirectDraw4_Release(dd4); hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); ok(hr == DD_OK, "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); - surf = NULL; + hr = IDirectDraw7_CreateSurface(dd7, &ddsd2, &surf7, NULL); ok(hr == DD_OK, "IDirectDraw7_CreateSurface failed: 0x%08x\n", hr); dctest_surf((IDirectDrawSurface *) surf7, 2);
1
0
0
0
Thomas Faber : riched20: Fix uninitialized variable usage.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 73876d6ccd22172d56d6338328f639365fd48554 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=73876d6ccd22172d56d633832…
Author: Thomas Faber <thfabba(a)gmx.de> Date: Sat Aug 6 01:48:38 2011 +0200 riched20: Fix uninitialized variable usage. --- dlls/riched20/paint.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index cd85139..0655010 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -957,7 +957,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) rc.left = c->pt.x + run->pt.x; rc.right = rc.left + run->nWidth; rc.top = c->pt.y + para->pt.y + run->pt.y; - rc.bottom = rc.bottom + height; + rc.bottom = rc.top + height; TRACE("rc = (%d, %d, %d, %d)\n", rc.left, rc.top, rc.right, rc.bottom); FrameRect(c->hDC, &rc, GetSysColorBrush(COLOR_GRAYTEXT)); }
1
0
0
0
Nikolay Sivov : oleaut32: Use type names and sizeof() instead of hardcoded values for save/load methods.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 2de8137f11d53538c2e58a931ae476186a145f98 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2de8137f11d53538c2e58a931…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 21 18:44:54 2011 +0400 oleaut32: Use type names and sizeof() instead of hardcoded values for save/load methods. --- dlls/oleaut32/olefont.c | 190 ++++++++++++++++------------------------------- 1 files changed, 64 insertions(+), 126 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index be88f51..a66a25b 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -287,13 +287,6 @@ struct OLEFontImpl IConnectionPoint *pFontEventsCP; }; -/* - * Here, I define utility macros to help with the casting of the - * "this" parameter. - * There is a version to accommodate all of the VTables implemented - * by this object. - */ - static inline OLEFontImpl *impl_from_IFont(IFont *iface) { return CONTAINING_RECORD(iface, OLEFontImpl, IFont_iface); @@ -1626,80 +1619,50 @@ static HRESULT WINAPI OLEFontImpl_Load( IPersistStream* iface, IStream* pLoadStream) { - char readBuffer[0x100]; + OLEFontImpl *this = impl_from_IPersistStream(iface); + BYTE version, attributes, string_size; + char readBuffer[0x100]; ULONG cbRead; - BYTE bVersion; - BYTE bAttributes; - BYTE bStringSize; INT len; - OLEFontImpl *this = impl_from_IPersistStream(iface); - - /* - * Read the version byte - */ - IStream_Read(pLoadStream, &bVersion, 1, &cbRead); - - if ( (cbRead!=1) || - (bVersion!=0x01) ) - return E_FAIL; - - /* - * Charset - */ - IStream_Read(pLoadStream, &this->description.sCharset, 2, &cbRead); - - if (cbRead!=2) - return E_FAIL; - - /* - * Attributes - */ - IStream_Read(pLoadStream, &bAttributes, 1, &cbRead); + /* Version */ + IStream_Read(pLoadStream, &version, sizeof(BYTE), &cbRead); + if ((cbRead != sizeof(BYTE)) || (version != 0x01)) return E_FAIL; - if (cbRead!=1) - return E_FAIL; + /* Charset */ + IStream_Read(pLoadStream, &this->description.sCharset, sizeof(WORD), &cbRead); + if (cbRead != sizeof(WORD)) return E_FAIL; - this->description.fItalic = (bAttributes & FONTPERSIST_ITALIC) != 0; - this->description.fStrikethrough = (bAttributes & FONTPERSIST_STRIKETHROUGH) != 0; - this->description.fUnderline = (bAttributes & FONTPERSIST_UNDERLINE) != 0; + /* Attributes */ + IStream_Read(pLoadStream, &attributes, sizeof(BYTE), &cbRead); + if (cbRead != sizeof(BYTE)) return E_FAIL; - /* - * Weight - */ - IStream_Read(pLoadStream, &this->description.sWeight, 2, &cbRead); + this->description.fItalic = (attributes & FONTPERSIST_ITALIC) != 0; + this->description.fStrikethrough = (attributes & FONTPERSIST_STRIKETHROUGH) != 0; + this->description.fUnderline = (attributes & FONTPERSIST_UNDERLINE) != 0; - if (cbRead!=2) - return E_FAIL; + /* Weight */ + IStream_Read(pLoadStream, &this->description.sWeight, sizeof(WORD), &cbRead); + if (cbRead != sizeof(WORD)) return E_FAIL; - /* - * Size - */ - IStream_Read(pLoadStream, &this->description.cySize.s.Lo, 4, &cbRead); - - if (cbRead!=4) - return E_FAIL; + /* Size */ + IStream_Read(pLoadStream, &this->description.cySize.s.Lo, sizeof(DWORD), &cbRead); + if (cbRead != sizeof(DWORD)) return E_FAIL; this->description.cySize.s.Hi = 0; - /* - * FontName - */ - IStream_Read(pLoadStream, &bStringSize, 1, &cbRead); - - if (cbRead!=1) - return E_FAIL; + /* Name */ + IStream_Read(pLoadStream, &string_size, sizeof(BYTE), &cbRead); + if (cbRead != sizeof(BYTE)) return E_FAIL; - IStream_Read(pLoadStream, readBuffer, bStringSize, &cbRead); - - if (cbRead!=bStringSize) - return E_FAIL; + IStream_Read(pLoadStream, readBuffer, string_size, &cbRead); + if (cbRead != string_size) return E_FAIL; HeapFree(GetProcessHeap(), 0, this->description.lpstrName); - len = MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, NULL, 0 ); + len = MultiByteToWideChar( CP_ACP, 0, readBuffer, string_size, NULL, 0 ); this->description.lpstrName = HeapAlloc( GetProcessHeap(), 0, (len+1) * sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, this->description.lpstrName, len ); + MultiByteToWideChar( CP_ACP, 0, readBuffer, string_size, this->description.lpstrName, len ); this->description.lpstrName[len] = 0; /* Ensure use of this font causes a new one to be created */ @@ -1718,91 +1681,66 @@ static HRESULT WINAPI OLEFontImpl_Save( IStream* pOutStream, BOOL fClearDirty) { + OLEFontImpl *this = impl_from_IPersistStream(iface); + BYTE attributes, string_size; + const BYTE version = 0x01; char* writeBuffer = NULL; - ULONG cbWritten; - BYTE bVersion = 0x01; - BYTE bAttributes; - BYTE bStringSize; + ULONG written; - OLEFontImpl *this = impl_from_IPersistStream(iface); + TRACE("(%p)->(%p %d)\n", this, pOutStream, fClearDirty); - /* - * Read the version byte - */ - IStream_Write(pOutStream, &bVersion, 1, &cbWritten); + /* Version */ + IStream_Write(pOutStream, &version, sizeof(BYTE), &written); + if (written != sizeof(BYTE)) return E_FAIL; - if (cbWritten!=1) - return E_FAIL; + /* Charset */ + IStream_Write(pOutStream, &this->description.sCharset, sizeof(WORD), &written); + if (written != sizeof(WORD)) return E_FAIL; - /* - * Charset - */ - IStream_Write(pOutStream, &this->description.sCharset, 2, &cbWritten); - - if (cbWritten!=2) - return E_FAIL; - - /* - * Attributes - */ - bAttributes = 0; + /* Attributes */ + attributes = 0; if (this->description.fItalic) - bAttributes |= FONTPERSIST_ITALIC; + attributes |= FONTPERSIST_ITALIC; if (this->description.fStrikethrough) - bAttributes |= FONTPERSIST_STRIKETHROUGH; + attributes |= FONTPERSIST_STRIKETHROUGH; if (this->description.fUnderline) - bAttributes |= FONTPERSIST_UNDERLINE; + attributes |= FONTPERSIST_UNDERLINE; - IStream_Write(pOutStream, &bAttributes, 1, &cbWritten); + IStream_Write(pOutStream, &attributes, sizeof(BYTE), &written); + if (written != sizeof(BYTE)) return E_FAIL; - if (cbWritten!=1) - return E_FAIL; + /* Weight */ + IStream_Write(pOutStream, &this->description.sWeight, sizeof(WORD), &written); + if (written != sizeof(WORD)) return E_FAIL; - /* - * Weight - */ - IStream_Write(pOutStream, &this->description.sWeight, 2, &cbWritten); - - if (cbWritten!=2) - return E_FAIL; - - /* - * Size - */ - IStream_Write(pOutStream, &this->description.cySize.s.Lo, 4, &cbWritten); + /* Size */ + IStream_Write(pOutStream, &this->description.cySize.s.Lo, sizeof(DWORD), &written); + if (written != sizeof(DWORD)) return E_FAIL; - if (cbWritten!=4) - return E_FAIL; - - /* - * FontName - */ - if (this->description.lpstrName!=0) - bStringSize = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, + /* FontName */ + if (this->description.lpstrName) + string_size = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, strlenW(this->description.lpstrName), NULL, 0, NULL, NULL ); else - bStringSize = 0; - - IStream_Write(pOutStream, &bStringSize, 1, &cbWritten); + string_size = 0; - if (cbWritten!=1) - return E_FAIL; + IStream_Write(pOutStream, &string_size, sizeof(BYTE), &written); + if (written != sizeof(BYTE)) return E_FAIL; - if (bStringSize!=0) + if (string_size) { - if (!(writeBuffer = HeapAlloc( GetProcessHeap(), 0, bStringSize ))) return E_OUTOFMEMORY; + if (!(writeBuffer = HeapAlloc( GetProcessHeap(), 0, string_size ))) return E_OUTOFMEMORY; WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, strlenW(this->description.lpstrName), - writeBuffer, bStringSize, NULL, NULL ); + writeBuffer, string_size, NULL, NULL ); - IStream_Write(pOutStream, writeBuffer, bStringSize, &cbWritten); - HeapFree(GetProcessHeap(), 0, writeBuffer); + IStream_Write(pOutStream, writeBuffer, string_size, &written); + HeapFree(GetProcessHeap(), 0, writeBuffer); - if (cbWritten!=bStringSize) - return E_FAIL; + if (written != string_size) return E_FAIL; } return S_OK;
1
0
0
0
Nikolay Sivov : oleaut32: Use strdupW to duplicate strings.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 1a7d52c907c68d205957a7eab7e0e1b9eda30b61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a7d52c907c68d205957a7eab…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 21 18:13:47 2011 +0400 oleaut32: Use strdupW to duplicate strings. --- dlls/oleaut32/olefont.c | 48 +++++++++++----------------------------------- 1 files changed, 12 insertions(+), 36 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 222e20d..be88f51 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -697,32 +697,18 @@ static HRESULT WINAPI OLEFontImpl_put_Name( IFont* iface, BSTR name) { - OLEFontImpl *this = impl_from_IFont(iface); - TRACE("(%p)->(%p)\n", this, name); + OLEFontImpl *This = impl_from_IFont(iface); + TRACE("(%p)->(%p)\n", This, name); if (!name) return CTL_E_INVALIDPROPERTYVALUE; - if (this->description.lpstrName==0) - { - this->description.lpstrName = HeapAlloc(GetProcessHeap(), - 0, - (lstrlenW(name)+1) * sizeof(WCHAR)); - } - else - { - this->description.lpstrName = HeapReAlloc(GetProcessHeap(), - 0, - this->description.lpstrName, - (lstrlenW(name)+1) * sizeof(WCHAR)); - } - - if (this->description.lpstrName==0) - return E_OUTOFMEMORY; + HeapFree(GetProcessHeap(), 0, This->description.lpstrName); + This->description.lpstrName = strdupW(name); + if (!This->description.lpstrName) return E_OUTOFMEMORY; - strcpyW(this->description.lpstrName, name); - TRACE("new name %s\n", debugstr_w(this->description.lpstrName)); - OLEFont_SendNotify(this, DISPID_FONT_NAME); + TRACE("new name %s\n", debugstr_w(This->description.lpstrName)); + OLEFont_SendNotify(This, DISPID_FONT_NAME); return S_OK; } @@ -1025,15 +1011,8 @@ static HRESULT WINAPI OLEFontImpl_Clone( return E_OUTOFMEMORY; *newObject = *this; - - /* We need to alloc new memory for the string, otherwise - * we free memory twice. - */ - newObject->description.lpstrName = HeapAlloc( - GetProcessHeap(),0, - (1+strlenW(this->description.lpstrName))*2 - ); - strcpyW(newObject->description.lpstrName, this->description.lpstrName); + /* allocate separate buffer */ + newObject->description.lpstrName = strdupW(this->description.lpstrName); /* Increment internal ref in hfont item list */ if(newObject->gdiFont) inc_int_ref(newObject->gdiFont); @@ -2246,10 +2225,7 @@ static OLEFontImpl* OLEFontImpl_Construct(const FONTDESC *fontDesc) newObject->ref = 1; newObject->description.cbSizeofstruct = sizeof(FONTDESC); - newObject->description.lpstrName = HeapAlloc(GetProcessHeap(), - 0, - (lstrlenW(fontDesc->lpstrName)+1) * sizeof(WCHAR)); - strcpyW(newObject->description.lpstrName, fontDesc->lpstrName); + newObject->description.lpstrName = strdupW(fontDesc->lpstrName); newObject->description.cySize = fontDesc->cySize; newObject->description.sWeight = fontDesc->sWeight; newObject->description.sCharset = fontDesc->sCharset; @@ -2264,8 +2240,8 @@ static OLEFontImpl* OLEFontImpl_Construct(const FONTDESC *fontDesc) newObject->pPropertyNotifyCP = NULL; newObject->pFontEventsCP = NULL; - CreateConnectionPoint((IUnknown*)newObject, &IID_IPropertyNotifySink, &newObject->pPropertyNotifyCP); - CreateConnectionPoint((IUnknown*)newObject, &IID_IFontEventsDisp, &newObject->pFontEventsCP); + CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IPropertyNotifySink, &newObject->pPropertyNotifyCP); + CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IFontEventsDisp, &newObject->pFontEventsCP); if (!newObject->pPropertyNotifyCP || !newObject->pFontEventsCP) {
1
0
0
0
Nikolay Sivov : oleaut32: FONTDESC size field value is not important for OleCreateFontIndirect.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 08f578a6c5e415a7f937d42f93a5e245907934a0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08f578a6c5e415a7f937d42f9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 21 17:53:12 2011 +0400 oleaut32: FONTDESC size field value is not important for OleCreateFontIndirect. --- dlls/oleaut32/olefont.c | 5 ----- dlls/oleaut32/tests/olefont.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index fa60da6..222e20d 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -2245,11 +2245,6 @@ static OLEFontImpl* OLEFontImpl_Construct(const FONTDESC *fontDesc) newObject->ref = 1; - /* - * Copy the description of the font in the object. - */ - assert(fontDesc->cbSizeofstruct >= sizeof(FONTDESC)); - newObject->description.cbSizeofstruct = sizeof(FONTDESC); newObject->description.lpstrName = HeapAlloc(GetProcessHeap(), 0, diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c index 65589b3..6fc1520 100644 --- a/dlls/oleaut32/tests/olefont.c +++ b/dlls/oleaut32/tests/olefont.c @@ -1104,6 +1104,42 @@ static void test_realization(void) IFont_Release(font); } +static void test_OleCreateFontIndirect(void) +{ + FONTDESC fontdesc; + IFont *font; + HRESULT hr; + + fontdesc.cbSizeofstruct = sizeof(fontdesc); + fontdesc.lpstrName = arial_font; + fontdesc.cySize.int64 = 12 * 10000; /* 12 pt */ + fontdesc.sWeight = FW_NORMAL; + fontdesc.sCharset = ANSI_CHARSET; + fontdesc.fItalic = FALSE; + fontdesc.fUnderline = FALSE; + fontdesc.fStrikethrough = FALSE; + + hr = pOleCreateFontIndirect(&fontdesc, &IID_IFont, (void**)&font); + EXPECT_HR(hr, S_OK); + IFont_Release(font); + + /* play with cbSizeofstruct value */ + fontdesc.cbSizeofstruct = sizeof(fontdesc)-1; + hr = pOleCreateFontIndirect(&fontdesc, &IID_IFont, (void**)&font); + EXPECT_HR(hr, S_OK); + IFont_Release(font); + + fontdesc.cbSizeofstruct = sizeof(fontdesc)+1; + hr = pOleCreateFontIndirect(&fontdesc, &IID_IFont, (void**)&font); + EXPECT_HR(hr, S_OK); + IFont_Release(font); + + fontdesc.cbSizeofstruct = 0; + hr = pOleCreateFontIndirect(&fontdesc, &IID_IFont, (void**)&font); + EXPECT_HR(hr, S_OK); + IFont_Release(font); +} + START_TEST(olefont) { hOleaut32 = GetModuleHandleA("oleaut32.dll"); @@ -1126,4 +1162,5 @@ START_TEST(olefont) test_returns(); test_hfont_lifetime(); test_realization(); + test_OleCreateFontIndirect(); }
1
0
0
0
Nikolay Sivov : oleaut32/tests: Clean result value checks.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 78ca68c85426f12dae2a0a319ec62cf8d5149473 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=78ca68c85426f12dae2a0a319…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 21 17:45:49 2011 +0400 oleaut32/tests: Clean result value checks. --- dlls/oleaut32/tests/olefont.c | 203 ++++++++++++++++++++--------------------- 1 files changed, 97 insertions(+), 106 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=78ca68c85426f12dae2a0…
1
0
0
0
Nikolay Sivov : oleaut32: Get rid of duplicated condition check.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: e800158ab0e0b33577c2c063f2bd145c1beb2adb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e800158ab0e0b33577c2c063f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 21 13:40:32 2011 +0400 oleaut32: Get rid of duplicated condition check. --- dlls/oleaut32/olefont.c | 171 +++++++++++++++++++++++------------------------ 1 files changed, 84 insertions(+), 87 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index c986f0e..fa60da6 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -584,88 +584,85 @@ static int CALLBACK font_enum_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, static void realize_font(OLEFontImpl *This) { - if (This->dirty) - { - LOGFONTW logFont; - INT fontHeight; - WCHAR text_face[LF_FACESIZE]; - HDC hdc = get_dc(); - HFONT old_font; - TEXTMETRICW tm; + LOGFONTW logFont; + INT fontHeight; + WCHAR text_face[LF_FACESIZE]; + HDC hdc = get_dc(); + HFONT old_font; + TEXTMETRICW tm; - text_face[0] = 0; + if (!This->dirty) return; - if(This->gdiFont) - { - old_font = SelectObject(hdc, This->gdiFont); - GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face); - SelectObject(hdc, old_font); - dec_int_ref(This->gdiFont); - This->gdiFont = 0; - } + text_face[0] = 0; - memset(&logFont, 0, sizeof(LOGFONTW)); + if(This->gdiFont) + { + old_font = SelectObject(hdc, This->gdiFont); + GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face); + SelectObject(hdc, old_font); + dec_int_ref(This->gdiFont); + This->gdiFont = 0; + } - lstrcpynW(logFont.lfFaceName, This->description.lpstrName, LF_FACESIZE); - logFont.lfCharSet = This->description.sCharset; + memset(&logFont, 0, sizeof(LOGFONTW)); - /* If the font name has been changed then enumerate all charsets - and pick one that'll result in the font specified being selected */ - if(text_face[0] && lstrcmpiW(text_face, This->description.lpstrName)) - { - enum_data data; - data.orig_cs = This->description.sCharset; - data.avail_cs = -1; - logFont.lfCharSet = DEFAULT_CHARSET; - EnumFontFamiliesExW(get_dc(), &logFont, font_enum_proc, (LPARAM)&data, 0); - if(data.avail_cs != -1) logFont.lfCharSet = data.avail_cs; - } + lstrcpynW(logFont.lfFaceName, This->description.lpstrName, LF_FACESIZE); + logFont.lfCharSet = This->description.sCharset; + /* If the font name has been changed then enumerate all charsets + and pick one that'll result in the font specified being selected */ + if(text_face[0] && lstrcmpiW(text_face, This->description.lpstrName)) + { + enum_data data; + data.orig_cs = This->description.sCharset; + data.avail_cs = -1; + logFont.lfCharSet = DEFAULT_CHARSET; + EnumFontFamiliesExW(get_dc(), &logFont, font_enum_proc, (LPARAM)&data, 0); + if(data.avail_cs != -1) logFont.lfCharSet = data.avail_cs; + } - /* - * The height of the font returned by the get_Size property is the - * height of the font in points multiplied by 10000... Using some - * simple conversions and the ratio given by the application, it can - * be converted to a height in pixels. - * - * Standard ratio is 72 / 2540, or 18 / 635 in lowest terms. - * Ratio is applied here relative to the standard. - */ - - fontHeight = MulDiv( This->description.cySize.s.Lo, This->cyLogical*635, This->cyHimetric*18 ); + /* + * The height of the font returned by the get_Size property is the + * height of the font in points multiplied by 10000... Using some + * simple conversions and the ratio given by the application, it can + * be converted to a height in pixels. + * + * Standard ratio is 72 / 2540, or 18 / 635 in lowest terms. + * Ratio is applied here relative to the standard. + */ + fontHeight = MulDiv( This->description.cySize.s.Lo, This->cyLogical*635, This->cyHimetric*18 ); - logFont.lfHeight = ((fontHeight%10000L)>5000L) ? (-fontHeight/10000L) - 1 : + logFont.lfHeight = ((fontHeight%10000L)>5000L) ? (-fontHeight/10000L) - 1 : (-fontHeight/10000L); - logFont.lfItalic = This->description.fItalic; - logFont.lfUnderline = This->description.fUnderline; - logFont.lfStrikeOut = This->description.fStrikethrough; - logFont.lfWeight = This->description.sWeight; - logFont.lfOutPrecision = OUT_CHARACTER_PRECIS; - logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - logFont.lfQuality = DEFAULT_QUALITY; - logFont.lfPitchAndFamily = DEFAULT_PITCH; - - This->gdiFont = CreateFontIndirectW(&logFont); - This->dirty = FALSE; - - add_hfontitem(This->gdiFont); - - /* Fixup the name and charset properties so that they match the - selected font */ - old_font = SelectObject(get_dc(), This->gdiFont); - GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face); - if(lstrcmpiW(text_face, This->description.lpstrName)) - { - HeapFree(GetProcessHeap(), 0, This->description.lpstrName); - This->description.lpstrName = strdupW(text_face); - } - GetTextMetricsW(hdc, &tm); - This->description.sCharset = tm.tmCharSet; - /* While we have it handy, stash the realized font height for use by get_Size() */ - This->nRealHeight = tm.tmHeight - tm.tmInternalLeading; /* corresponds to LOGFONT lfHeight */ - SelectObject(hdc, old_font); + logFont.lfItalic = This->description.fItalic; + logFont.lfUnderline = This->description.fUnderline; + logFont.lfStrikeOut = This->description.fStrikethrough; + logFont.lfWeight = This->description.sWeight; + logFont.lfOutPrecision = OUT_CHARACTER_PRECIS; + logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; + logFont.lfQuality = DEFAULT_QUALITY; + logFont.lfPitchAndFamily = DEFAULT_PITCH; + + This->gdiFont = CreateFontIndirectW(&logFont); + This->dirty = FALSE; + + add_hfontitem(This->gdiFont); + + /* Fixup the name and charset properties so that they match the + selected font */ + old_font = SelectObject(get_dc(), This->gdiFont); + GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face); + if(lstrcmpiW(text_face, This->description.lpstrName)) + { + HeapFree(GetProcessHeap(), 0, This->description.lpstrName); + This->description.lpstrName = strdupW(text_face); } + GetTextMetricsW(hdc, &tm); + This->description.sCharset = tm.tmCharSet; + /* While we have it handy, stash the realized font height for use by get_Size() */ + This->nRealHeight = tm.tmHeight - tm.tmInternalLeading; /* corresponds to LOGFONT lfHeight */ + SelectObject(hdc, old_font); } /************************************************************************ @@ -683,7 +680,7 @@ static HRESULT WINAPI OLEFontImpl_get_Name( if (pname==0) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); if (this->description.lpstrName!=0) *pname = SysAllocString(this->description.lpstrName); @@ -741,7 +738,7 @@ static HRESULT WINAPI OLEFontImpl_get_Size( if (!psize) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); /* * Convert realized font height in pixels to points descaled by current @@ -785,7 +782,7 @@ static HRESULT WINAPI OLEFontImpl_get_Bold( if (!pbold) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); *pbold = this->description.sWeight > 550; @@ -820,7 +817,7 @@ static HRESULT WINAPI OLEFontImpl_get_Italic( if (pitalic==0) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); *pitalic = this->description.fItalic; @@ -856,7 +853,7 @@ static HRESULT WINAPI OLEFontImpl_get_Underline( if (punderline==0) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); *punderline = this->description.fUnderline; @@ -892,7 +889,7 @@ static HRESULT WINAPI OLEFontImpl_get_Strikethrough( if (pstrikethrough==0) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); *pstrikethrough = this->description.fStrikethrough; @@ -928,7 +925,7 @@ static HRESULT WINAPI OLEFontImpl_get_Weight( if (pweight==0) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); *pweight = this->description.sWeight; @@ -964,7 +961,7 @@ static HRESULT WINAPI OLEFontImpl_get_Charset( if (pcharset==0) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); *pcharset = this->description.sCharset; @@ -999,7 +996,7 @@ static HRESULT WINAPI OLEFontImpl_get_hFont( if (phfont==NULL) return E_POINTER; - if(this->dirty) realize_font(this); + realize_font(this); *phfont = this->gdiFont; TRACE("Returning %p\n", *phfont);
1
0
0
0
Nikolay Sivov : oleaut32: Clean QueryInterface() method, turn impl. calls to interface calls.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: c69be3bfb9e0ea749b5e6185be380ba925c50541 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c69be3bfb9e0ea749b5e6185b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 21 12:27:53 2011 +0400 oleaut32: Clean QueryInterface() method, turn impl. calls to interface calls. --- dlls/oleaut32/olefont.c | 50 ++++++++++++++++++++++++++++------------------ 1 files changed, 30 insertions(+), 20 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 019132f..c986f0e 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -476,32 +476,42 @@ static HRESULT WINAPI OLEFontImpl_QueryInterface( *ppvObject = 0; - if (IsEqualGUID(&IID_IUnknown, riid)) - *ppvObject = this; - if (IsEqualGUID(&IID_IFont, riid)) + if (IsEqualGUID(&IID_IUnknown, riid) || + IsEqualGUID(&IID_IFont, riid)) + { *ppvObject = this; - if (IsEqualGUID(&IID_IDispatch, riid)) - *ppvObject = &this->IDispatch_iface; - if (IsEqualGUID(&IID_IFontDisp, riid)) + } + else if (IsEqualGUID(&IID_IDispatch, riid) || + IsEqualGUID(&IID_IFontDisp, riid)) + { *ppvObject = &this->IDispatch_iface; - if (IsEqualIID(&IID_IPersist, riid) || IsEqualGUID(&IID_IPersistStream, riid)) + } + else if (IsEqualGUID(&IID_IPersist, riid) || + IsEqualGUID(&IID_IPersistStream, riid)) + { *ppvObject = &this->IPersistStream_iface; - if (IsEqualGUID(&IID_IConnectionPointContainer, riid)) + } + else if (IsEqualGUID(&IID_IConnectionPointContainer, riid)) + { *ppvObject = &this->IConnectionPointContainer_iface; - if (IsEqualGUID(&IID_IPersistPropertyBag, riid)) + } + else if (IsEqualGUID(&IID_IPersistPropertyBag, riid)) + { *ppvObject = &this->IPersistPropertyBag_iface; - if (IsEqualGUID(&IID_IPersistStreamInit, riid)) + } + else if (IsEqualGUID(&IID_IPersistStreamInit, riid)) + { *ppvObject = &this->IPersistStreamInit_iface; + } - /* - * Check that we obtained an interface. - */ - if ((*ppvObject)==0) + if (!*ppvObject) { - FIXME("() : asking for unsupported interface %s\n",debugstr_guid(riid)); + FIXME("() : asking for unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } - OLEFontImpl_AddRef(&this->IFont_iface); + + IFont_AddRef(iface); + return S_OK; } @@ -1124,7 +1134,7 @@ static HRESULT WINAPI OLEFontImpl_QueryTextMetrics( HFONT hOldFont, hNewFont; hdcRef = GetDC(0); - OLEFontImpl_get_hFont(iface, &hNewFont); + IFont_get_hFont(iface, &hNewFont); hOldFont = SelectObject(hdcRef, hNewFont); GetTextMetricsW(hdcRef, ptm); SelectObject(hdcRef, hOldFont); @@ -1304,7 +1314,7 @@ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames( if (cNames == 0) return E_INVALIDARG; - hres = OLEFontImpl_GetTypeInfo(iface, 0, lcid, &pTInfo); + hres = IDispatch_GetTypeInfo(iface, 0, lcid, &pTInfo); if (FAILED(hres)) { ERR("GetTypeInfo failed.\n"); @@ -1484,7 +1494,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( case DISPID_FONT_SIZE: if (wFlags & DISPATCH_PROPERTYGET) { V_VT(pVarResult) = VT_CY; - return OLEFontImpl_get_Size(&this->IFont_iface, &V_CY(pVarResult)); + return IFont_get_Size(&this->IFont_iface, &V_CY(pVarResult)); } else { VARIANTARG vararg; @@ -1502,7 +1512,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( case DISPID_FONT_WEIGHT: if (wFlags & DISPATCH_PROPERTYGET) { V_VT(pVarResult) = VT_I2; - return OLEFontImpl_get_Weight(&this->IFont_iface, &V_I2(pVarResult)); + return IFont_get_Weight(&this->IFont_iface, &V_I2(pVarResult)); } else { VARIANTARG vararg;
1
0
0
0
Nikolay Sivov : oleaut32: Remove some useless comments and initializers.
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 92054ef01ca0f2b74427473ce1b6ccf253d7202c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=92054ef01ca0f2b74427473ce…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 21 12:16:28 2011 +0400 oleaut32: Remove some useless comments and initializers. --- dlls/oleaut32/olefont.c | 221 +++++++---------------------------------------- 1 files changed, 30 insertions(+), 191 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=92054ef01ca0f2b744274…
1
0
0
0
Huw Davies : gdi32: Change the object-level brush function to accept a stand-alone dib and a separate clip region .
by Alexandre Julliard
22 Aug '11
22 Aug '11
Module: wine Branch: master Commit: 925fa108657239ae1672a12299432f696723a072 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=925fa108657239ae1672a1229…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Aug 19 16:26:20 2011 +0100 gdi32: Change the object-level brush function to accept a stand-alone dib and a separate clip region. --- dlls/gdi32/dibdrv/dibdrv.h | 1 + dlls/gdi32/dibdrv/graphics.c | 6 +++--- dlls/gdi32/dibdrv/objects.c | 40 +++++++++++++++++++++++++++++----------- dlls/gdi32/gdi_private.h | 2 +- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h index 760c02e..6727a6b 100644 --- a/dlls/gdi32/dibdrv/dibdrv.h +++ b/dlls/gdi32/dibdrv/dibdrv.h @@ -75,6 +75,7 @@ extern void free_pattern_brush(dibdrv_physdev *pdev) DECLSPEC_HIDDEN; extern void copy_dib_color_info(dib_info *dst, const dib_info *src) DECLSPEC_HIDDEN; extern BOOL convert_dib(dib_info *dst, const dib_info *src) DECLSPEC_HIDDEN; extern DWORD get_fg_color(dibdrv_physdev *pdev, COLORREF color) DECLSPEC_HIDDEN; +extern BOOL brush_rects( dibdrv_physdev *pdev, int num, const RECT *rects ) DECLSPEC_HIDDEN; static inline BOOL defer_pen(dibdrv_physdev *pdev) { diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c index b2e9f2c..f8b3f8a 100644 --- a/dlls/gdi32/dibdrv/graphics.c +++ b/dlls/gdi32/dibdrv/graphics.c @@ -107,7 +107,7 @@ BOOL dibdrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) update_brush_rop( pdev, rop2 ); - done = pdev->brush_rects( pdev, 1, &dst->visrect ); + done = brush_rects( pdev, 1, &dst->visrect ); update_brush_rop( pdev, GetROP2(dev->hdc) ); @@ -139,7 +139,7 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn ) { rect = get_device_rect( dev->hdc, region->rects[i].left, region->rects[i].top, region->rects[i].right, region->rects[i].bottom, FALSE ); - pdev->brush_rects( pdev, 1, &rect ); + brush_rects( pdev, 1, &rect ); } release_wine_region( rgn ); @@ -236,7 +236,7 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) rect.right -= 1; rect.bottom -= 1; - pdev->brush_rects(pdev, 1, &rect); + brush_rects(pdev, 1, &rect); return TRUE; } diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index e0e37f7..8575bb4 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -1059,10 +1059,16 @@ COLORREF dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color ) * Fill a number of rectangles with the solid brush * FIXME: Should we insist l < r && t < b? Currently we assume this. */ -static BOOL solid_brush(dibdrv_physdev *pdev, int num, RECT *rects) +static BOOL solid_brush(dibdrv_physdev *pdev, dib_info *dib, int num, const RECT *rects, HRGN region) { int i, j; - const WINEREGION *clip = get_wine_region(pdev->clip); + const WINEREGION *clip = get_wine_region( region ); + + if (!clip) + { + dib->funcs->solid_rects( dib, num, rects, pdev->brush_and, pdev->brush_xor ); + return TRUE; + } for(i = 0; i < num; i++) { @@ -1074,7 +1080,7 @@ static BOOL solid_brush(dibdrv_physdev *pdev, int num, RECT *rects) if(clip->rects[j].top <= rect.top && clip->rects[j].bottom >= rect.bottom && clip->rects[j].left <= rect.left && clip->rects[j].right >= rect.right) { - pdev->dib.funcs->solid_rects(&pdev->dib, 1, &rect, pdev->brush_and, pdev->brush_xor); + dib->funcs->solid_rects( dib, 1, &rect, pdev->brush_and, pdev->brush_xor ); break; } @@ -1088,11 +1094,11 @@ static BOOL solid_brush(dibdrv_physdev *pdev, int num, RECT *rects) rect.right = min(rect.right, clip->rects[j].right); rect.bottom = min(rect.bottom, clip->rects[j].bottom); - pdev->dib.funcs->solid_rects(&pdev->dib, 1, &rect, pdev->brush_and, pdev->brush_xor); + dib->funcs->solid_rects( dib, 1, &rect, pdev->brush_and, pdev->brush_xor ); } } } - release_wine_region(pdev->clip); + release_wine_region( region ); return TRUE; } @@ -1205,7 +1211,7 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev) * Fill a number of rectangles with the pattern brush * FIXME: Should we insist l < r && t < b? Currently we assume this. */ -static BOOL pattern_brush(dibdrv_physdev *pdev, int num, RECT *rects) +static BOOL pattern_brush(dibdrv_physdev *pdev, dib_info *dib, int num, const RECT *rects, HRGN region) { int i, j; const WINEREGION *clip; @@ -1233,7 +1239,14 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, int num, RECT *rects) GetBrushOrgEx(pdev->dev.hdc, &origin); - clip = get_wine_region(pdev->clip); + clip = get_wine_region( region ); + + if (!clip) + { + dib->funcs->pattern_rects( dib, num, rects, &origin, &pdev->brush_dib, pdev->brush_and_bits, pdev->brush_xor_bits ); + return TRUE; + } + for(i = 0; i < num; i++) { for(j = 0; j < clip->numRects; j++) @@ -1244,7 +1257,7 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, int num, RECT *rects) if(clip->rects[j].top <= rect.top && clip->rects[j].bottom >= rect.bottom && clip->rects[j].left <= rect.left && clip->rects[j].right >= rect.right) { - pdev->dib.funcs->pattern_rects(&pdev->dib, 1, &rect, &origin, &pdev->brush_dib, pdev->brush_and_bits, pdev->brush_xor_bits); + dib->funcs->pattern_rects( dib, 1, &rect, &origin, &pdev->brush_dib, pdev->brush_and_bits, pdev->brush_xor_bits ); break; } @@ -1258,15 +1271,15 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, int num, RECT *rects) rect.right = min(rect.right, clip->rects[j].right); rect.bottom = min(rect.bottom, clip->rects[j].bottom); - pdev->dib.funcs->pattern_rects(&pdev->dib, 1, &rect, &origin, &pdev->brush_dib, pdev->brush_and_bits, pdev->brush_xor_bits); + dib->funcs->pattern_rects( dib, 1, &rect, &origin, &pdev->brush_dib, pdev->brush_and_bits, pdev->brush_xor_bits ); } } } - release_wine_region(pdev->clip); + release_wine_region( region ); return TRUE; } -static BOOL null_brush(dibdrv_physdev *pdev, int num, RECT *rects) +static BOOL null_brush(dibdrv_physdev *pdev, dib_info *dib, int num, const RECT *rects, HRGN region) { return TRUE; } @@ -1392,3 +1405,8 @@ COLORREF dibdrv_SetDCBrushColor( PHYSDEV dev, COLORREF color ) return next->funcs->pSetDCBrushColor( next, color ); } + +BOOL brush_rects(dibdrv_physdev *pdev, int num, const RECT *rects) +{ + return pdev->brush_rects( pdev, &pdev->dib, num, rects, pdev->clip ); +} diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 40271af..2189040 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -146,7 +146,7 @@ typedef struct dibdrv_physdev DWORD brush_color, brush_and, brush_xor; dib_info brush_dib; void *brush_and_bits, *brush_xor_bits; - BOOL (* brush_rects)(struct dibdrv_physdev *pdev, int num, RECT *rects); + BOOL (* brush_rects)(struct dibdrv_physdev *pdev, dib_info *dib, int num, const RECT *rects, HRGN clip); /* background */ DWORD bkgnd_color, bkgnd_and, bkgnd_xor;
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
77
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
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200