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
July 2015
----- 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
567 discussions
Start a n
N
ew thread
Thomas Faber : shell32/tests: Destroy shell view windows.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: eff884f19b2ace1d475bdaa5fcc519f68d3b7c7f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eff884f19b2ace1d475bdaa5f…
Author: Thomas Faber <thomas.faber(a)reactos.org> Date: Thu Jul 2 06:25:46 2015 -0400 shell32/tests: Destroy shell view windows. --- dlls/shell32/tests/shlview.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index 1cfffaa..2134a49 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -676,6 +676,10 @@ if (0) ok(hr == S_OK, "got (0x%08x)\n", hr); IDropTarget_Release(dt); + hr = IShellView_DestroyViewWindow(view); + ok(hr == S_OK, "got (0x%08x)\n", hr); + ok(!IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view); + IShellView_Release(view); IShellFolder_Release(desktop); } @@ -835,6 +839,10 @@ if (0) win_skip("IFolderView2 is not supported.\n"); if (fv2) IFolderView2_Release(fv2); + hr = IShellView_DestroyViewWindow(view); + ok(hr == S_OK, "got (0x%08x)\n", hr); + ok(!IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view); + IShellBrowser_Release(browser); IFolderView_Release(fv); IShellView_Release(view);
1
0
0
0
Thomas Faber : shell32/tests: Fix an ok() print.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: 71f1c90628376dc135d388103434c5d3cff5ea60 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=71f1c90628376dc135d388103…
Author: Thomas Faber <thomas.faber(a)reactos.org> Date: Thu Jul 2 06:25:25 2015 -0400 shell32/tests: Fix an ok() print. --- dlls/shell32/tests/shlview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index eafaec5..1cfffaa 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -667,7 +667,7 @@ if (0) hwnd2 = (HWND)0xdeadbeef; hr = IShellView_CreateViewWindow(view, NULL, &settings, &test_shellbrowser, &r, &hwnd2); ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr); - ok(hwnd2 == NULL, "got %p\n", hwnd_view); + ok(hwnd2 == NULL, "got %p\n", hwnd2); /* ::DragLeave without drag operation */ hr = IShellView_QueryInterface(view, &IID_IDropTarget, (void**)&dt);
1
0
0
0
Olivier F. R. Dierick : psapi/tests: Add test for EnumProcessModules with NULL pointer.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: 9effcc98f9c3259b615685088588b04d14589fe9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9effcc98f9c3259b615685088…
Author: Olivier F. R. Dierick <o.dierick(a)piezo-forte.be> Date: Thu Jul 2 04:41:05 2015 +0200 psapi/tests: Add test for EnumProcessModules with NULL pointer. --- dlls/psapi/tests/psapi_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 890b4ac..cebfc5f 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -136,6 +136,11 @@ static void test_EnumProcessModules(void) ok(ret == 1, "failed with %d\n", GetLastError()); SetLastError(0xdeadbeef); + ret = pEnumProcessModules(hpQV, NULL, sizeof(HMODULE), &cbNeeded); + ok(!ret, "succeeded\n"); + ok(GetLastError() == ERROR_NOACCESS, "expected error=ERROR_NOACCESS but got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); ret = pEnumProcessModules(hpQV, &hMod, sizeof(HMODULE), &cbNeeded); if(ret != 1) return;
1
0
0
0
Olivier F. R. Dierick : kernel32: Fail gracefully in K32EnumProcessModules with NULL pointer.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: c3f95eddc1bf73b0c5dc95fdfde2b0f8a6d292a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3f95eddc1bf73b0c5dc95fdf…
Author: Olivier F. R. Dierick <o.dierick(a)piezo-forte.be> Date: Thu Jul 2 04:23:22 2015 +0200 kernel32: Fail gracefully in K32EnumProcessModules with NULL pointer. --- 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 f495e81..dac66c1 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -1226,7 +1226,7 @@ BOOL WINAPI K32EnumProcessModules(HANDLE process, HMODULE *lphModule, if (!init_module_iterator(&iter, process)) return FALSE; - if (!needed) + if ((cb && !lphModule) || !needed) { SetLastError(ERROR_NOACCESS); return FALSE;
1
0
0
0
Huw Davies : dwrite/tests: Add tests for GetGdiCompatibleMetrics.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: bbf5b249ca882df07b326b50027d27baa5b586c8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bbf5b249ca882df07b326b500…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Jul 3 15:53:07 2015 +0100 dwrite/tests: Add tests for GetGdiCompatibleMetrics. --- dlls/dwrite/tests/font.c | 225 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 221 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 111762c..d3ac83c 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -19,9 +19,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <math.h> + #define COBJMACROS #include "windows.h" +#include "winternl.h" #include "dwrite_2.h" #include "initguid.h" #include "d2d1.h" @@ -33,6 +36,7 @@ ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24)) #define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p') +#define MS_VDMX_TAG MS_MAKE_TAG('V','D','M','X') #define EXPECT_HR(hr,hr_exp) \ ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) @@ -87,6 +91,7 @@ static inline BOOL heap_free(void *mem) static const WCHAR test_fontfile[] = {'w','i','n','e','_','t','e','s','t','_','f','o','n','t','.','t','t','f',0}; static const WCHAR tahomaW[] = {'T','a','h','o','m','a',0}; +static const WCHAR arialW[] = {'A','r','i','a','l',0}; static const WCHAR tahomaUppercaseW[] = {'T','A','H','O','M','A',0}; static const WCHAR tahomaStrangecaseW[] = {'t','A','h','O','m','A',0}; static const WCHAR blahW[] = {'B','l','a','h','!',0}; @@ -2255,11 +2260,11 @@ static void test_GetFontFromFontFace(void) DELETE_FONTFILE(path); } -static IDWriteFont *get_tahoma_instance(IDWriteFactory *factory, DWRITE_FONT_STYLE style) +static IDWriteFont *get_font(IDWriteFactory *factory, const WCHAR *name, DWRITE_FONT_STYLE style) { IDWriteFontCollection *collection; IDWriteFontFamily *family; - IDWriteFont *font; + IDWriteFont *font = NULL; UINT32 index; BOOL exists; HRESULT hr; @@ -2269,9 +2274,9 @@ static IDWriteFont *get_tahoma_instance(IDWriteFactory *factory, DWRITE_FONT_STY index = ~0; exists = FALSE; - hr = IDWriteFontCollection_FindFamilyName(collection, tahomaW, &index, &exists); + hr = IDWriteFontCollection_FindFamilyName(collection, name, &index, &exists); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(exists, "got %d\n", exists); + if (!exists) goto not_found; hr = IDWriteFontCollection_GetFontFamily(collection, index, &family); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -2281,10 +2286,18 @@ static IDWriteFont *get_tahoma_instance(IDWriteFactory *factory, DWRITE_FONT_STY ok(hr == S_OK, "got 0x%08x\n", hr); IDWriteFontFamily_Release(family); +not_found: IDWriteFontCollection_Release(collection); return font; } +static IDWriteFont *get_tahoma_instance(IDWriteFactory *factory, DWRITE_FONT_STYLE style) +{ + IDWriteFont *font = get_font(factory, tahomaW, style); + ok(font != NULL, "failed to get Tahoma\n"); + return font; +} + static void test_GetFirstMatchingFont(void) { DWRITE_FONT_SIMULATIONS simulations; @@ -3418,6 +3431,209 @@ static void test_CreateGlyphRunAnalysis(void) IDWriteFactory_Release(factory); } +#define round(x) ((int)floor((x) + 0.5)) + +struct VDMX_Header +{ + WORD version; + WORD numRecs; + WORD numRatios; +}; + +struct VDMX_Ratio +{ + BYTE bCharSet; + BYTE xRatio; + BYTE yStartRatio; + BYTE yEndRatio; +}; + +struct VDMX_group +{ + WORD recs; + BYTE startsz; + BYTE endsz; +}; + +struct VDMX_vTable +{ + WORD yPelHeight; + SHORT yMax; + SHORT yMin; +}; + +#ifdef WORDS_BIGENDIAN +#define GET_BE_WORD(x) (x) +#else +#define GET_BE_WORD(x) RtlUshortByteSwap(x) +#endif + +static const struct VDMX_group *find_vdmx_group(const struct VDMX_Header *hdr) +{ + WORD num_ratios, i, group_offset = 0; + struct VDMX_Ratio *ratios = (struct VDMX_Ratio*)(hdr + 1); + BYTE dev_x_ratio = 1, dev_y_ratio = 1; + + num_ratios = GET_BE_WORD(hdr->numRatios); + + for (i = 0; i < num_ratios; i++) + { + if (!ratios[i].bCharSet) continue; + + if ((ratios[i].xRatio == 0 && ratios[i].yStartRatio == 0 && + ratios[i].yEndRatio == 0) || + (ratios[i].xRatio == dev_x_ratio && ratios[i].yStartRatio <= dev_y_ratio && + ratios[i].yEndRatio >= dev_y_ratio)) + { + group_offset = GET_BE_WORD(*((WORD *)(ratios + num_ratios) + i)); + break; + } + } + if (group_offset) + return (const struct VDMX_group *)((BYTE *)hdr + group_offset); + return NULL; +} + +static BOOL get_vdmx_size(const struct VDMX_group *group, int emsize, int *a, int *d) +{ + WORD recs, i; + const struct VDMX_vTable *tables; + + if (!group) return FALSE; + + recs = GET_BE_WORD(group->recs); + if (emsize < group->startsz || emsize >= group->endsz) return FALSE; + + tables = (const struct VDMX_vTable *)(group + 1); + for (i = 0; i < recs; i++) + { + WORD ppem = GET_BE_WORD(tables[i].yPelHeight); + if (ppem > emsize) + { + /* FIXME: Supposed to interpolate */ + trace("FIXME interpolate %d\n", emsize); + return FALSE; + } + + if (ppem == emsize) + { + *a = (SHORT)GET_BE_WORD(tables[i].yMax); + *d = -(SHORT)GET_BE_WORD(tables[i].yMin); + return TRUE; + } + } + return FALSE; +} + +static void test_GetGdiCompatibleMetrics_face(IDWriteFontFace *face) +{ + HRESULT hr; + DWRITE_FONT_METRICS design_metrics, comp_metrics; + FLOAT emsize, scale; + int ascent, descent, expect; + const struct VDMX_Header *vdmx; + UINT32 vdmx_len; + void *vdmx_ctx; + BOOL exists; + const struct VDMX_group *vdmx_group = NULL; + + IDWriteFontFace_GetMetrics(face, &design_metrics); + + hr = IDWriteFontFace_TryGetFontTable(face, MS_VDMX_TAG, (const void **)&vdmx, + &vdmx_len, &vdmx_ctx, &exists); + if (hr != S_OK || !exists) + vdmx = NULL; + else + vdmx_group = find_vdmx_group(vdmx); + + for (emsize = 5; emsize <= design_metrics.designUnitsPerEm; emsize++) + { + scale = emsize / design_metrics.designUnitsPerEm; + hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, emsize, 1.0, NULL, &comp_metrics); +todo_wine + ok(hr == S_OK, "got %08x\n", hr); + if (hr != S_OK) return; + + if (!get_vdmx_size(vdmx_group, emsize, &ascent, &descent)) + { + ascent = round(design_metrics.ascent * scale); + descent = round(design_metrics.descent * scale); + } + + ok(comp_metrics.designUnitsPerEm == design_metrics.designUnitsPerEm, + "%.2f: emsize: got %d expect %d\n", + emsize, comp_metrics.designUnitsPerEm, design_metrics.designUnitsPerEm); + + ok(comp_metrics.ascent == round(ascent / scale), "%.2f a: got %d expect %d\n", + emsize, comp_metrics.ascent, round(ascent / scale)); + + ok(comp_metrics.descent == round(descent / scale), "%.2f d: got %d expect %d\n", + emsize, comp_metrics.descent, round(descent / scale)); + + expect = round(round(design_metrics.lineGap * scale) / scale); + ok(comp_metrics.lineGap == expect, "%.2f lg: got %d expect %d\n", + emsize, comp_metrics.lineGap, expect); + + expect = round(round(design_metrics.capHeight * scale) / scale); + ok(comp_metrics.capHeight == expect, "%.2f capH: got %d expect %d\n", + emsize, comp_metrics.capHeight, expect); + + expect = round(round(design_metrics.xHeight * scale) / scale); + ok(comp_metrics.xHeight == expect, "%.2f xH: got %d expect %d\n", + emsize, comp_metrics.xHeight, expect); + + expect = round(round(design_metrics.underlinePosition * scale) / scale); + ok(comp_metrics.underlinePosition == expect, "%.2f ulP: got %d expect %d\n", + emsize, comp_metrics.underlinePosition, expect); + + expect = round(round(design_metrics.underlineThickness * scale) / scale); + ok(comp_metrics.underlineThickness == expect, "%.2f ulTh: got %d expect %d\n", + emsize, comp_metrics.underlineThickness, expect); + + expect = round(round(design_metrics.strikethroughPosition * scale) / scale); + ok(comp_metrics.strikethroughPosition == expect, "%.2f stP: got %d expect %d\n", + emsize, comp_metrics.strikethroughPosition, expect); + + expect = round(round(design_metrics.strikethroughThickness * scale) / scale); + ok(comp_metrics.strikethroughThickness == expect, "%.2f stTh: got %d expect %d\n", + emsize, comp_metrics.strikethroughThickness, expect); + } + + if (vdmx) IDWriteFontFace_ReleaseFontTable(face, vdmx_ctx); +} + +static void test_GetGdiCompatibleMetrics(void) +{ + IDWriteFactory *factory; + IDWriteFont *font; + IDWriteFontFace *fontface; + HRESULT hr; + + factory = create_factory(); + + font = get_font(factory, tahomaW, DWRITE_FONT_STYLE_NORMAL); + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFont_Release(font); + test_GetGdiCompatibleMetrics_face(fontface); + IDWriteFontFace_Release(fontface); + + font = get_font(factory, arialW, DWRITE_FONT_STYLE_NORMAL); + if (!font) + skip("Skipping tests with Arial\n"); + else + { + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFont_Release(font); + + test_GetGdiCompatibleMetrics_face(fontface); + IDWriteFontFace_Release(fontface); + } + + IDWriteFactory_Release(factory); +} + START_TEST(font) { IDWriteFactory *factory; @@ -3461,6 +3677,7 @@ START_TEST(font) test_GetKerningPairAdjustments(); test_CreateRenderingParams(); test_CreateGlyphRunAnalysis(); + test_GetGdiCompatibleMetrics(); IDWriteFactory_Release(factory); }
1
0
0
0
Dmitry Timoshkov : ole32: Accept STG_E_UNIMPLEMENTEDFUNCTION when ILockBytes implementation doesn' t support locking.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: 1f17334fc298d40459aca511702525d2f15d84db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f17334fc298d40459aca5117…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Jul 3 15:27:22 2015 +0800 ole32: Accept STG_E_UNIMPLEMENTEDFUNCTION when ILockBytes implementation doesn't support locking. Some custom implementations return it instead of STG_E_INVALIDFUNCTION. --- dlls/ole32/storage32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 220e17e..aa53758 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -5015,7 +5015,7 @@ static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags) hr = StorageImpl_LockRegionSync(This, offset, cb, LOCK_ONLYONCE); /* If the ILockBytes doesn't support locking that's ok. */ - if (hr == STG_E_INVALIDFUNCTION) return S_OK; + if (hr == STG_E_INVALIDFUNCTION || hr == STG_E_UNIMPLEMENTEDFUNCTION) return S_OK; else if (FAILED(hr)) return hr; hr = S_OK;
1
0
0
0
Nikolay Sivov : gdiplus: Remove always true condition (Coverity).
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: 07f8493895d7567b70d84bd1a176c5fb6f332d16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=07f8493895d7567b70d84bd1a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Jul 6 09:09:34 2015 +0300 gdiplus: Remove always true condition (Coverity). --- dlls/gdiplus/graphics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 92bc194..1b7d8c4 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2168,8 +2168,8 @@ static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, GpMatrix xform = *matrix; GdipTransformMatrixPoints(&xform, pt, 3); } - if (graphics) - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); + + GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X));
1
0
0
0
Nikolay Sivov : shell32: Handle string-to-guid conversion errors (Coverity ).
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: 69733d65e82035a4375042e283bf9720f833ca69 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=69733d65e82035a4375042e28…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Jul 6 09:09:06 2015 +0300 shell32: Handle string-to-guid conversion errors (Coverity). --- dlls/shell32/shellpath.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 42f34a2..1a4528f 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -5334,7 +5334,11 @@ static HRESULT WINAPI knownfolder_GetFolderDefinition( hr = HRESULT_FROM_WIN32(RegGetValueW(HKEY_LOCAL_MACHINE, knownfolder->registryPath, szParentFolder, RRF_RT_REG_SZ, NULL, parentGuid, &dwSize)); if(SUCCEEDED(hr)) - IIDFromString(parentGuid, &pKFD->fidParent); + { + hr = IIDFromString(parentGuid, &pKFD->fidParent); + if(FAILED(hr)) + return hr; + } get_known_folder_dword(knownfolder->registryPath, szAttributes, &pKFD->dwAttributes);
1
0
0
0
Nikolay Sivov : dwrite/tests: Test that pair kerning affects shaping.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: b49f9f609a9882372e2876ac5647a9452bf899d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b49f9f609a9882372e2876ac5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Jul 6 09:06:38 2015 +0300 dwrite/tests: Test that pair kerning affects shaping. --- dlls/dwrite/tests/layout.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 6e55c60..232f127 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -1839,13 +1839,15 @@ if (0) /* crashes on native */ static void test_SetPairKerning(void) { - static const WCHAR strW[] = {'a','b','c','d',0}; + static const WCHAR strW[] = {'a','e',0x0300,'d',0}; /* accent grave */ + DWRITE_CLUSTER_METRICS clusters[4]; IDWriteTextLayout1 *layout1; IDWriteTextFormat *format; IDWriteTextLayout *layout; DWRITE_TEXT_RANGE range; IDWriteFactory *factory; BOOL kerning; + UINT32 count; HRESULT hr; factory = create_factory(); @@ -1881,9 +1883,22 @@ if (0) { /* crashes on native */ hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &kerning, &range); ok(hr == S_OK, "got 0x%08x\n", hr); ok(!kerning, "got %d\n", kerning); + ok(range.length == ~0u, "got %u\n", range.length); + count = 0; + hr = IDWriteTextLayout1_GetClusterMetrics(layout1, clusters, 4, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); +todo_wine + ok(count == 3, "got %u\n", count); +if (count == 3) { + ok(clusters[0].length == 1, "got %u\n", clusters[0].length); + ok(clusters[1].length == 2, "got %u\n", clusters[1].length); + ok(clusters[2].length == 1, "got %u\n", clusters[2].length); +} + /* pair kerning flag participates in itemization - combining characters + breaks */ range.startPosition = 0; - range.length = 1; + range.length = 2; hr = IDWriteTextLayout1_SetPairKerning(layout1, 2, range); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1892,6 +1907,15 @@ if (0) { /* crashes on native */ ok(hr == S_OK, "got 0x%08x\n", hr); ok(kerning == TRUE, "got %d\n", kerning); + count = 0; + hr = IDWriteTextLayout1_GetClusterMetrics(layout1, clusters, 4, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 4, "got %u\n", count); + ok(clusters[0].length == 1, "got %u\n", clusters[0].length); + ok(clusters[1].length == 1, "got %u\n", clusters[1].length); + ok(clusters[2].length == 1, "got %u\n", clusters[2].length); + ok(clusters[3].length == 1, "got %u\n", clusters[3].length); + IDWriteTextLayout1_Release(layout1); IDWriteFactory_Release(factory); }
1
0
0
0
Nikolay Sivov : dwrite: Implement paragraph alignment.
by Alexandre Julliard
06 Jul '15
06 Jul '15
Module: wine Branch: master Commit: 862ac80a0dc2a04aa2e1ff74d387a437dfe4b199 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=862ac80a0dc2a04aa2e1ff74d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Jul 6 09:06:08 2015 +0300 dwrite: Implement paragraph alignment. --- dlls/dwrite/layout.c | 83 +++++++++++++++++++++++++++++++++++----- dlls/dwrite/tests/layout.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 168 insertions(+), 10 deletions(-) diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 18462b0..1fb49c1 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -342,6 +342,16 @@ static inline HRESULT format_set_textalignment(struct dwrite_textformat_data *fo return S_OK; } +static inline HRESULT format_set_paralignment(struct dwrite_textformat_data *format, + DWRITE_PARAGRAPH_ALIGNMENT alignment, BOOL *changed) +{ + if ((UINT32)alignment > DWRITE_PARAGRAPH_ALIGNMENT_CENTER) + return E_INVALIDARG; + if (changed) *changed = format->paralign != alignment; + format->paralign = alignment; + return S_OK; +} + static HRESULT get_fontfallback_from_format(const struct dwrite_textformat_data *format, IDWriteFontFallback **fallback) { *fallback = format->fallback; @@ -1182,6 +1192,50 @@ static void layout_apply_text_alignment(struct dwrite_textlayout *layout) } } +static void layout_apply_par_alignment(struct dwrite_textlayout *layout) +{ + struct layout_effective_inline *inrun; + struct layout_effective_run *erun; + FLOAT origin_y = 0.0; + UINT32 line; + + /* alignment mode defines origin, after that all run origins are updated + the same way */ + + switch (layout->format.paralign) + { + case DWRITE_PARAGRAPH_ALIGNMENT_NEAR: + origin_y = 0.0; + break; + case DWRITE_PARAGRAPH_ALIGNMENT_FAR: + origin_y = layout->metrics.layoutHeight - layout->metrics.height; + break; + case DWRITE_PARAGRAPH_ALIGNMENT_CENTER: + origin_y = (layout->metrics.layoutHeight - layout->metrics.height) / 2.0; + break; + default: + ; + } + + layout->metrics.top = origin_y; + + erun = layout_get_next_erun(layout, NULL); + inrun = layout_get_next_inline_run(layout, NULL); + for (line = 0; line < layout->metrics.lineCount; line++) { + origin_y += layout->lines[line].baseline; + + while (erun && erun->line == line) { + erun->origin_y = origin_y; + erun = layout_get_next_erun(layout, erun); + } + + while (inrun && inrun->line == line) { + inrun->origin_y = origin_y; + inrun = layout_get_next_inline_run(layout, inrun); + } + } +} + static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout) { struct layout_effective_inline *inrun; @@ -1354,6 +1408,10 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout) if (layout->format.textalignment != DWRITE_TEXT_ALIGNMENT_LEADING) layout_apply_text_alignment(layout); + /* initial paragraph alignment is always near */ + if (layout->format.paralign != DWRITE_PARAGRAPH_ALIGNMENT_NEAR) + layout_apply_par_alignment(layout); + layout->metrics.heightIncludingTrailingWhitespace = layout->metrics.height; /* FIXME: not true for vertical text */ layout->recompute &= ~RECOMPUTE_EFFECTIVE_RUNS; @@ -2072,7 +2130,6 @@ static HRESULT WINAPI dwritetextlayout_SetTextAlignment(IDWriteTextLayout2 *ifac static HRESULT WINAPI dwritetextlayout_SetParagraphAlignment(IDWriteTextLayout2 *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)->(%d)\n", This, alignment); return IDWriteTextFormat1_SetParagraphAlignment(&This->IDWriteTextFormat1_iface, alignment); } @@ -3100,8 +3157,20 @@ static HRESULT WINAPI dwritetextformat1_layout_SetTextAlignment(IDWriteTextForma static HRESULT WINAPI dwritetextformat1_layout_SetParagraphAlignment(IDWriteTextFormat1 *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment) { struct dwrite_textlayout *This = impl_layout_form_IDWriteTextFormat1(iface); - FIXME("(%p)->(%d): stub\n", This, alignment); - return E_NOTIMPL; + BOOL changed; + HRESULT hr; + + TRACE("(%p)->(%d)\n", This, alignment); + + hr = format_set_paralignment(&This->format, alignment, &changed); + if (FAILED(hr)) + return hr; + + /* if layout is not ready there's nothing to align */ + if (changed && !(This->recompute & RECOMPUTE_EFFECTIVE_RUNS)) + layout_apply_par_alignment(This); + + return S_OK; } static HRESULT WINAPI dwritetextformat1_layout_SetWordWrapping(IDWriteTextFormat1 *iface, DWRITE_WORD_WRAPPING wrapping) @@ -3974,14 +4043,8 @@ static HRESULT WINAPI dwritetextformat_SetTextAlignment(IDWriteTextFormat1 *ifac static HRESULT WINAPI dwritetextformat_SetParagraphAlignment(IDWriteTextFormat1 *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); - TRACE("(%p)->(%d)\n", This, alignment); - - if ((UINT32)alignment > DWRITE_PARAGRAPH_ALIGNMENT_CENTER) - return E_INVALIDARG; - - This->format.paralign = alignment; - return S_OK; + return format_set_paralignment(&This->format, alignment, NULL); } static HRESULT WINAPI dwritetextformat_SetWordWrapping(IDWriteTextFormat1 *iface, DWRITE_WORD_WRAPPING wrapping) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 8e8651a..6e55c60 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -2972,6 +2972,100 @@ static void test_SetTextAlignment(void) IDWriteFactory_Release(factory); } +static void test_SetParagraphAlignment(void) +{ + static const WCHAR strW[] = {'a',0}; + DWRITE_TEXT_METRICS metrics; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + IDWriteFactory *factory; + DWRITE_PARAGRAPH_ALIGNMENT v; + DWRITE_LINE_METRICS lines[1]; + UINT32 count; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 12.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + v = IDWriteTextFormat_GetParagraphAlignment(format); + ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 1, format, 500.0, 100.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + v = IDWriteTextLayout_GetParagraphAlignment(layout); + ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v); + + hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR); + ok(hr == S_OK, "got 0x%08x\n", hr); + + v = IDWriteTextFormat_GetParagraphAlignment(format); + ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v); + + v = IDWriteTextLayout_GetParagraphAlignment(layout); + ok(v == DWRITE_PARAGRAPH_ALIGNMENT_FAR, "got %d\n", v); + + hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_CENTER); + ok(hr == S_OK, "got 0x%08x\n", hr); + + v = IDWriteTextLayout_GetParagraphAlignment(layout); + ok(v == DWRITE_PARAGRAPH_ALIGNMENT_CENTER, "got %d\n", v); + + count = 0; + hr = IDWriteTextLayout_GetLineMetrics(layout, lines, 1, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + + /* maxheight is 100, near alignment */ + hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_NEAR); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ok(metrics.top == 0.0, "got %.2f\n", metrics.top); + ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height); + ok(metrics.layoutHeight == 100.0, "got %.2f\n", metrics.layoutHeight); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + + /* maxwidth is 100, far alignment */ + hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ok(metrics.top == metrics.layoutHeight - metrics.height, "got %.2f\n", metrics.top); + ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height); + ok(metrics.layoutHeight == 100.0, "got %.2f\n", metrics.layoutHeight); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + IDWriteTextLayout_Release(layout); + + /* initially created with centered alignment */ + hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_CENTER); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 1, format, 500.0, 100.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_GetMetrics(layout, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ok(metrics.top == (metrics.layoutHeight - lines[0].height) / 2, "got %.2f\n", metrics.top); + ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height); + ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); + IDWriteTextLayout_Release(layout); + + IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); +} + START_TEST(layout) { static const WCHAR ctrlstrW[] = {0x202a,0}; @@ -3013,6 +3107,7 @@ START_TEST(layout) test_SetDrawingEffect(); test_GetLineMetrics(); test_SetTextAlignment(); + test_SetParagraphAlignment(); IDWriteFactory_Release(factory); }
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
57
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
Results per page:
10
25
50
100
200