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
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
May 2015
----- 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
2 participants
428 discussions
Start a n
N
ew thread
Piotr Caban : wininet/tests: Test if content is read from cache in INTERNET_FLAG_FROM_CACHE tests.
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: 5306ce9d4a2cb7530ffce42c90999bc6fec3a246 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5306ce9d4a2cb7530ffce42c9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu May 28 14:20:05 2015 +0200 wininet/tests: Test if content is read from cache in INTERNET_FLAG_FROM_CACHE tests. --- dlls/wininet/tests/http.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 3b2f9a5..bd4ca54 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -1432,7 +1432,9 @@ static void test_http_cache(void) BYTE buf[100]; HANDLE file; BOOL ret; + FILETIME filetime_zero = {0}; + static const char cached_content[] = "data read from cache"; static const char *types[] = { "*", "", NULL }; session = InternetOpenA("Wine Regression Test", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); @@ -1492,9 +1494,13 @@ static void test_http_cache(void) ok(InternetCloseHandle(request), "Close request handle failed\n"); - file = CreateFileA(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); + file = CreateFileA(file_name, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); ok(file != INVALID_HANDLE_VALUE, "Could not create file: %u\n", GetLastError()); + ret = WriteFile(file, cached_content, sizeof(cached_content), &size, NULL); + ok(ret && size, "WriteFile failed: %d, %d\n", ret, size); + ret = CommitUrlCacheEntryA(url, file_name, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, NULL, 0); + ok(ret, "CommitUrlCacheEntry failed: %d\n", GetLastError()); CloseHandle(file); /* Send the same request, requiring it to be retrieved from the cache */ @@ -1507,7 +1513,17 @@ static void test_http_cache(void) ret = InternetReadFile(request, buf, sizeof(buf), &size); ok(ret, "InternetReadFile failed: %u\n", GetLastError()); ok(size == 100, "size = %u\n", size); + buf[99] = 0; + todo_wine ok(!strcmp((char*)buf, cached_content), "incorrect page data: %s\n", (char*)buf); + + ok(InternetCloseHandle(request), "Close request handle failed\n"); + DeleteUrlCacheEntryA(url); + request = HttpOpenRequestA(connect, "GET", "/tests/hello.html", NULL, NULL, NULL, INTERNET_FLAG_FROM_CACHE, 0); + ret = HttpSendRequestA(request, NULL, 0, NULL, 0); + todo_wine ok(!ret, "HttpSendRequest succeeded\n"); + if(!ret) + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() = %d\n", GetLastError()); ok(InternetCloseHandle(request), "Close request handle failed\n"); request = HttpOpenRequestA(connect, NULL, "/", NULL, NULL, types, INTERNET_FLAG_NO_CACHE_WRITE, 0);
1
0
0
0
Nikolay Sivov : riched20: A bit more tests for GetChar(), improve tracing.
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: 6a335ca5daa0d2822910f84c46110ee0a8caca44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a335ca5daa0d2822910f84c4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 27 10:10:24 2015 +0300 riched20: A bit more tests for GetChar(), improve tracing. --- dlls/riched20/richole.c | 8 ++++++-- dlls/riched20/tests/richole.c | 24 ++++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index e25f2ea..63926e2 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -1468,9 +1468,11 @@ static HRESULT WINAPI ITextRange_fnGetChar(ITextRange *me, LONG *pch) ITextRangeImpl *This = impl_from_ITextRange(me); ME_Cursor cursor; + TRACE("(%p)->(%p)\n", This, pch); + if (!This->reOle) return CO_E_RELEASED; - TRACE("%p\n", pch); + if (!pch) return E_INVALIDARG; @@ -3934,9 +3936,11 @@ static HRESULT WINAPI ITextSelection_fnGetChar(ITextSelection *me, LONG *pch) ITextSelectionImpl *This = impl_from_ITextSelection(me); ME_Cursor *start = NULL, *end = NULL; + TRACE("(%p)->(%p)\n", This, pch); + if (!This->reOle) return CO_E_RELEASED; - TRACE("%p\n", pch); + if (!pch) return E_INVALIDARG; diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 33a433a..3e41ede 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -683,7 +683,7 @@ static void test_ITextRange_GetChar(void) ITextDocument *txtDoc = NULL; ITextRange *txtRge = NULL; HRESULT hres; - LONG pch = 0xdeadbeef; + LONG pch; int first, lim; static const CHAR test_text1[] = "TestSomeText"; @@ -742,8 +742,16 @@ static void test_ITextRange_GetChar(void) ok(hres == S_OK, "got 0x%08x\n", hres); hres = ITextRange_GetChar(txtRge, NULL); ok(hres == E_INVALIDARG, "ITextRange_GetChar\n"); - ITextRange_Release(txtRge); + release_interfaces(&w, &reOle, &txtDoc, NULL); + + hres = ITextRange_GetChar(txtRge, NULL); + ok(hres == CO_E_RELEASED, "got 0x%08x\n", hres); + + hres = ITextRange_GetChar(txtRge, &pch); + ok(hres == CO_E_RELEASED, "got 0x%08x\n", hres); + + ITextRange_Release(txtRge); } static void test_ITextSelection_GetChar(void) @@ -753,7 +761,7 @@ static void test_ITextSelection_GetChar(void) ITextDocument *txtDoc = NULL; ITextSelection *txtSel = NULL; HRESULT hres; - LONG pch = 0xdeadbeef; + LONG pch; int first, lim; static const CHAR test_text1[] = "TestSomeText"; @@ -791,7 +799,15 @@ static void test_ITextSelection_GetChar(void) hres = ITextSelection_GetChar(txtSel, NULL); ok(hres == E_INVALIDARG, "ITextSelection_GetChar\n"); - release_interfaces(&w, &reOle, &txtDoc, &txtSel); + release_interfaces(&w, &reOle, &txtDoc, NULL); + + hres = ITextSelection_GetChar(txtSel, NULL); + ok(hres == CO_E_RELEASED, "got 0x%08x\n", hres); + + hres = ITextSelection_GetChar(txtSel, &pch); + ok(hres == CO_E_RELEASED, "got 0x%08x\n", hres); + + ITextSelection_Release(txtSel); } static void test_ITextRange_GetStart_GetEnd(void)
1
0
0
0
Nikolay Sivov : riched20: Implement Select().
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: cb095a82a25b3b296227de5c3e3de588d801d1ec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb095a82a25b3b296227de5c3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 27 02:36:49 2015 +0300 riched20: Implement Select(). --- dlls/riched20/richole.c | 14 ++++++++++---- dlls/riched20/tests/richole.c | 45 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index db002a9..e25f2ea 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -1825,11 +1825,14 @@ static HRESULT WINAPI ITextRange_fnIsEqual(ITextRange *me, ITextRange *range, LO static HRESULT WINAPI ITextRange_fnSelect(ITextRange *me) { ITextRangeImpl *This = impl_from_ITextRange(me); + + TRACE("(%p)\n", This); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); - return E_NOTIMPL; + ME_SetSelection(This->reOle->editor, This->start, This->end); + return S_OK; } static HRESULT WINAPI ITextRange_fnStartOf(ITextRange *me, LONG Unit, LONG Extend, @@ -4240,11 +4243,14 @@ static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *r static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + TRACE("(%p)\n", This); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); - return E_NOTIMPL; + /* nothing to do */ + return S_OK; } static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG Unit, LONG Extend, diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index f4bf6f9..33a433a 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -2746,6 +2746,50 @@ static void test_ITextRange_IsEqual(void) ITextSelection_Release(selection); } +static void test_Select(void) +{ + static const CHAR test_text1[] = "TestSomeText"; + IRichEditOle *reOle = NULL; + ITextDocument *doc = NULL; + ITextSelection *selection; + ITextRange *range; + LONG value; + HRESULT hr; + HWND hwnd; + + create_interfaces(&hwnd, &reOle, &doc, &selection); + SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)test_text1); + SendMessageA(hwnd, EM_SETSEL, 1, 2); + + hr = ITextDocument_Range(doc, 0, 4, &range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextRange_Select(range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + value = 1; + hr = ITextSelection_GetStart(selection, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == 0, "got %d\n", value); + + hr = ITextRange_Select(range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextSelection_Select(selection); + ok(hr == S_OK, "got 0x%08x\n", hr); + + release_interfaces(&hwnd, &reOle, &doc, NULL); + + hr = ITextRange_Select(range); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + hr = ITextSelection_Select(selection); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + ITextRange_Release(range); + ITextSelection_Release(selection); +} + START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in @@ -2775,4 +2819,5 @@ START_TEST(richole) test_SetText(); test_InRange(); test_ITextRange_IsEqual(); + test_Select(); }
1
0
0
0
Nikolay Sivov : riched20: Implement IsEqual() for ranges.
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: 6ccfde327aa9f985e7450af233c2978a0fc4b0ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ccfde327aa9f985e7450af23…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 27 02:24:01 2015 +0300 riched20: Implement IsEqual() for ranges. --- dlls/riched20/richole.c | 51 ++++++++++++++++--- dlls/riched20/tests/richole.c | 116 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 6 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index cbd3060..db002a9 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -1790,14 +1790,36 @@ static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, L return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnIsEqual(ITextRange *me, ITextRange *pRange, LONG *pb) +static HRESULT textrange_isequal(LONG start, LONG end, ITextRange *range, LONG *ret) +{ + LONG from, to, v; + + if (!ret) + ret = &v; + + ITextRange_GetStart(range, &from); + ITextRange_GetEnd(range, &to); + + *ret = (start == from && end == to) ? tomTrue : tomFalse; + return *ret == tomTrue ? S_OK : S_FALSE; +} + +static HRESULT WINAPI ITextRange_fnIsEqual(ITextRange *me, ITextRange *range, LONG *ret) { ITextRangeImpl *This = impl_from_ITextRange(me); + + TRACE("(%p)->(%p %p)\n", This, range, ret); + + if (ret) + *ret = tomFalse; + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); - return E_NOTIMPL; + if (!range) + return S_FALSE; + + return textrange_isequal(This->start, This->end, range, ret); } static HRESULT WINAPI ITextRange_fnSelect(ITextRange *me) @@ -4188,14 +4210,31 @@ static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *p return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *pRange, LONG *pb) +static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *range, LONG *ret) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + ITextSelection *selection = NULL; + LONG start, end; + + TRACE("(%p)->(%p %p)\n", This, range, ret); + + if (ret) + *ret = tomFalse; + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); - return E_NOTIMPL; + if (!range) + return S_FALSE; + + ITextRange_QueryInterface(range, &IID_ITextSelection, (void**)&selection); + if (!selection) + return S_FALSE; + ITextSelection_Release(selection); + + ITextSelection_GetStart(me, &start); + ITextSelection_GetEnd(me, &end); + return textrange_isequal(start, end, range, ret); } static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 359a8cb..f4bf6f9 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -2631,6 +2631,121 @@ static void test_InRange(void) ITextSelection_Release(selection); } +static void test_ITextRange_IsEqual(void) +{ + static const CHAR test_text1[] = "TestSomeText"; + ITextRange *range, *range2, *range3; + IRichEditOle *reOle = NULL; + ITextDocument *doc = NULL; + ITextSelection *selection; + LONG value; + HRESULT hr; + HWND hwnd; + + create_interfaces(&hwnd, &reOle, &doc, &selection); + SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)test_text1); + SendMessageA(hwnd, EM_SETSEL, 1, 2); + + hr = ITextDocument_Range(doc, 0, 4, &range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextDocument_Range(doc, 0, 4, &range2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* matches selection */ + hr = ITextDocument_Range(doc, 1, 2, &range3); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextRange_IsEqual(range, NULL, NULL); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextRange_IsEqual(range, NULL, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextRange_IsEqual(range, range2, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + value = tomFalse; + hr = ITextRange_IsEqual(range, range2, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == tomTrue, "got %d\n", value); + + value = tomTrue; + hr = ITextRange_IsEqual(range, range3, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + /* selection */ + hr = ITextSelection_IsEqual(selection, NULL, NULL); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_IsEqual(selection, NULL, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextSelection_IsEqual(selection, range2, NULL); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_IsEqual(selection, range2, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + value = tomTrue; + hr = ITextSelection_IsEqual(selection, range3, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + /* seems to work on ITextSelection ranges only */ + value = tomFalse; + hr = ITextSelection_IsEqual(selection, (ITextRange*)selection, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == tomTrue, "got %d\n", value); + + release_interfaces(&hwnd, &reOle, &doc, NULL); + + hr = ITextRange_IsEqual(range, NULL, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextRange_IsEqual(range, NULL, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextRange_IsEqual(range, range2, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextRange_IsEqual(range, range2, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + /* selection */ + hr = ITextSelection_IsEqual(selection, NULL, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_IsEqual(selection, NULL, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextSelection_IsEqual(selection, range2, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_IsEqual(selection, range2, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + ITextRange_Release(range); + ITextRange_Release(range2); + ITextRange_Release(range3); + ITextSelection_Release(selection); +} + START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in @@ -2659,4 +2774,5 @@ START_TEST(richole) test_Delete(); test_SetText(); test_InRange(); + test_ITextRange_IsEqual(); }
1
0
0
0
Nikolay Sivov : riched20: Implement InRange().
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: cebee9bd71fefdb2e54d21a01b7ffb1bf5e3cf5a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cebee9bd71fefdb2e54d21a01…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 27 02:16:26 2015 +0300 riched20: Implement InRange(). --- dlls/riched20/richole.c | 51 ++++++++++++++++--- dlls/riched20/tests/richole.c | 111 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 6 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 4d4ca89..cbd3060 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -1748,14 +1748,36 @@ static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG cpActive, LONG return E_NOTIMPL; } -static HRESULT WINAPI ITextRange_fnInRange(ITextRange *me, ITextRange *pRange, LONG *pb) +static HRESULT textrange_inrange(LONG start, LONG end, ITextRange *range, LONG *ret) +{ + LONG from, to, v; + + if (!ret) + ret = &v; + + ITextRange_GetStart(range, &from); + ITextRange_GetEnd(range, &to); + + *ret = (start >= from && end <= to) ? tomTrue : tomFalse; + return *ret == tomTrue ? S_OK : S_FALSE; +} + +static HRESULT WINAPI ITextRange_fnInRange(ITextRange *me, ITextRange *range, LONG *ret) { ITextRangeImpl *This = impl_from_ITextRange(me); + + TRACE("(%p)->(%p %p)\n", This, range, ret); + + if (ret) + *ret = tomFalse; + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented %p\n", This); - return E_NOTIMPL; + if (!range) + return S_FALSE; + + return textrange_inrange(This->start, This->end, range, ret); } static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, LONG *pb) @@ -4129,14 +4151,31 @@ static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG cpActiv return E_NOTIMPL; } -static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *pRange, LONG *pb) +static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *range, LONG *ret) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + ITextSelection *selection = NULL; + LONG start, end; + + TRACE("(%p)->(%p %p)\n", This, range, ret); + + if (ret) + *ret = tomFalse; + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); - return E_NOTIMPL; + if (!range) + return S_FALSE; + + ITextRange_QueryInterface(range, &IID_ITextSelection, (void**)&selection); + if (!selection) + return S_FALSE; + ITextSelection_Release(selection); + + ITextSelection_GetStart(me, &start); + ITextSelection_GetEnd(me, &end); + return textrange_inrange(start, end, range, ret); } static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *pRange, LONG *pb) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 0e08758..359a8cb 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -2521,6 +2521,116 @@ static void test_SetText(void) ITextRange_Release(range); } +static void test_InRange(void) +{ + static const CHAR test_text1[] = "TestSomeText"; + ITextRange *range, *range2, *range3; + IRichEditOle *reOle = NULL; + ITextDocument *doc = NULL; + ITextSelection *selection; + LONG value; + HRESULT hr; + HWND hwnd; + + create_interfaces(&hwnd, &reOle, &doc, &selection); + SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)test_text1); + SendMessageA(hwnd, EM_SETSEL, 1, 2); + + hr = ITextDocument_Range(doc, 0, 4, &range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextDocument_Range(doc, 0, 4, &range2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* matches selection */ + hr = ITextDocument_Range(doc, 1, 2, &range3); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextRange_InRange(range, NULL, NULL); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextRange_InRange(range, NULL, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextRange_InRange(range, range2, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + value = tomFalse; + hr = ITextRange_InRange(range, range2, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == tomTrue, "got %d\n", value); + + /* selection */ + hr = ITextSelection_InRange(selection, NULL, NULL); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_InRange(selection, NULL, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextSelection_InRange(selection, range2, NULL); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_InRange(selection, range2, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + value = tomTrue; + hr = ITextSelection_InRange(selection, range3, &value); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + /* seems to work on ITextSelection ranges only */ + value = tomFalse; + hr = ITextSelection_InRange(selection, (ITextRange*)selection, &value); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(value == tomTrue, "got %d\n", value); + + release_interfaces(&hwnd, &reOle, &doc, NULL); + + hr = ITextRange_InRange(range, NULL, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextRange_InRange(range, NULL, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextRange_InRange(range, range2, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextRange_InRange(range, range2, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + /* selection */ + hr = ITextSelection_InRange(selection, NULL, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_InRange(selection, NULL, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + hr = ITextSelection_InRange(selection, range2, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + value = tomTrue; + hr = ITextSelection_InRange(selection, range2, &value); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + ok(value == tomFalse, "got %d\n", value); + + ITextRange_Release(range); + ITextRange_Release(range2); + ITextRange_Release(range3); + ITextSelection_Release(selection); +} + START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in @@ -2548,4 +2658,5 @@ START_TEST(richole) test_ITextFont(); test_Delete(); test_SetText(); + test_InRange(); }
1
0
0
0
Nikolay Sivov : riched20: Implement GetPara() for selection range.
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: c1ce95dc961a16b8640151e856b92dbb36a52c28 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c1ce95dc961a16b8640151e85…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 27 01:42:04 2015 +0300 riched20: Implement GetPara() for selection range. --- dlls/riched20/richole.c | 9 +++++++-- dlls/riched20/tests/richole.c | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 14c4c8e..4d4ca89 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -4031,11 +4031,16 @@ static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *pF static HRESULT WINAPI ITextSelection_fnGetPara(ITextSelection *me, ITextPara **para) { ITextSelectionImpl *This = impl_from_ITextSelection(me); + + TRACE("(%p)->(%p)\n", This, para); + if (!This->reOle) return CO_E_RELEASED; - FIXME("not implemented\n"); - return E_NOTIMPL; + if (!para) + return E_INVALIDARG; + + return create_textpara((ITextRange*)me, para); } static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *pPara) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 7d90a98..0e08758 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -1650,12 +1650,13 @@ static void test_GetPara(void) static const CHAR test_text1[] = "TestSomeText"; IRichEditOle *reOle = NULL; ITextDocument *doc = NULL; + ITextSelection *selection; ITextRange *range = NULL; ITextPara *para, *para2; HRESULT hr; HWND hwnd; - create_interfaces(&hwnd, &reOle, &doc, NULL); + create_interfaces(&hwnd, &reOle, &doc, &selection); SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)test_text1); EXPECT_REF(reOle, 3); @@ -1691,8 +1692,41 @@ static void test_GetPara(void) ITextPara_Release(para); ITextPara_Release(para2); - ITextRange_Release(range); + + EXPECT_REF(reOle, 3); + EXPECT_REF(doc, 3); + EXPECT_REF(selection, 2); + + hr = ITextSelection_GetPara(selection, ¶); + ok(hr == S_OK, "got 0x%08x\n", hr); + + EXPECT_REF(reOle, 3); + EXPECT_REF(doc, 3); + EXPECT_REF(selection, 3); + EXPECT_REF(para, 1); + + hr = ITextSelection_GetPara(selection, ¶2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(para != para2, "got %p, %p\n", para, para2); + + ITextPara_Release(para); + ITextPara_Release(para2); release_interfaces(&hwnd, &reOle, &doc, NULL); + + hr = ITextRange_GetPara(range, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + hr = ITextRange_GetPara(range, ¶); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + hr = ITextSelection_GetPara(selection, NULL); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + hr = ITextSelection_GetPara(selection, ¶); + ok(hr == CO_E_RELEASED, "got 0x%08x\n", hr); + + ITextSelection_Release(selection); + ITextRange_Release(range); } static void test_dispatch(void)
1
0
0
0
André Hentschel : winedump: Add more image debug types.
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: 29c47defe62fb2b47efa964d1b8486b4f6f19544 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=29c47defe62fb2b47efa964d1…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed May 27 22:33:30 2015 +0200 winedump: Add more image debug types. --- include/winnt.h | 4 ++++ tools/winedump/pe.c | 19 +++++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/winnt.h b/include/winnt.h index 73d4d36..7a08810 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -3531,6 +3531,10 @@ typedef struct _IMAGE_DEBUG_DIRECTORY { #define IMAGE_DEBUG_TYPE_BORLAND 9 #define IMAGE_DEBUG_TYPE_RESERVED10 10 #define IMAGE_DEBUG_TYPE_CLSID 11 +#define IMAGE_DEBUG_TYPE_VC_FEATURE 12 +#define IMAGE_DEBUG_TYPE_POGO 13 +#define IMAGE_DEBUG_TYPE_ILTCG 14 +#define IMAGE_DEBUG_TYPE_MPX 15 typedef enum ReplacesCorHdrNumericDefines { diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 51ceba4..dbe5d8f 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -1331,6 +1331,10 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx) case IMAGE_DEBUG_TYPE_BORLAND: str = "BORLAND"; break; case IMAGE_DEBUG_TYPE_RESERVED10: str = "RESERVED10"; break; case IMAGE_DEBUG_TYPE_CLSID: str = "CLSID"; break; + case IMAGE_DEBUG_TYPE_VC_FEATURE: str = "VC_FEATURE"; break; + case IMAGE_DEBUG_TYPE_POGO: str = "POGO"; break; + case IMAGE_DEBUG_TYPE_ILTCG: str = "ILTCG"; break; + case IMAGE_DEBUG_TYPE_MPX: str = "MPX"; break; } printf(" Type: %u (%s)\n", idd->Type, str); printf(" SizeOfData: %u\n", idd->SizeOfData); @@ -1363,20 +1367,7 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx) printf(" Data: %s\n", misc->Data); } break; - case IMAGE_DEBUG_TYPE_EXCEPTION: - break; - case IMAGE_DEBUG_TYPE_FIXUP: - break; - case IMAGE_DEBUG_TYPE_OMAP_TO_SRC: - break; - case IMAGE_DEBUG_TYPE_OMAP_FROM_SRC: - break; - case IMAGE_DEBUG_TYPE_BORLAND: - break; - case IMAGE_DEBUG_TYPE_RESERVED10: - break; - case IMAGE_DEBUG_TYPE_CLSID: - break; + default: break; } printf("\n"); }
1
0
0
0
André Hentschel : include: Add more ARM64 CV constants.
by Alexandre Julliard
28 May '15
28 May '15
Module: wine Branch: master Commit: 8e0164bd2681f97af0fe5989b5f46ed657041f9a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e0164bd2681f97af0fe5989b…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed May 27 22:33:19 2015 +0200 include: Add more ARM64 CV constants. --- dlls/dbghelp/cpu_arm64.c | 24 +++++++++++++----------- dlls/ntdll/signal_arm64.c | 20 +++++++++++++++----- include/cvconst.h | 26 +++++++++++++++++++------- include/winnt.h | 6 +++--- programs/winedbg/be_arm64.c | 19 +++++++++---------- programs/winedbg/gdbproxy.c | 4 ++-- 6 files changed, 61 insertions(+), 38 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8e0164bd2681f97af0fe5…
1
0
0
0
Jeremy Newman : use winehq.org for official tarball downloads
by Jeremy Newman
27 May '15
27 May '15
Module: website Branch: master Commit: 2b77af289b83adad50895e9f05d5c1bc97ad1123 URL:
http://source.winehq.org/git/website.git/?a=commit;h=2b77af289b83adad50895e…
Author: Jeremy Newman <jnewman(a)codeweavers.com> Date: Wed May 27 13:58:02 2015 -0500 use
winehq.org
for official tarball downloads --- templates/de/download.template | 2 +- templates/en/download.template | 2 +- templates/fr/download.template | 2 +- templates/he/download.template | 2 +- templates/pl/download.template | 2 +- templates/pt/download.template | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/de/download.template b/templates/de/download.template index 4fc8982..69be404 100644 --- a/templates/de/download.template +++ b/templates/de/download.template @@ -140,7 +140,7 @@ für das Hosten der Wine-Webseite erbeten hat.</p> </tr> <tr bgcolor="#ffffff"> - <td> <a href="
http://sourceforge.net/projects/wine/files/Source/
" target="_blank">
sourceforge.net
</a></td> + <td> <a href="
http://ftp.winehq.org/pub/wine/source/
" target="_blank">
winehq.org
</a></td> <td> Unsere offizielle Website für freigegebenen Quellcode. </td> </tr> diff --git a/templates/en/download.template b/templates/en/download.template index b759b4f..587415f 100644 --- a/templates/en/download.template +++ b/templates/en/download.template @@ -135,7 +135,7 @@ requested in exchange for hosting the Wine web site.</p> </tr> <tr bgcolor="#ffffff"> - <td> <a href="
http://sourceforge.net/projects/wine/files/Source/
" target="_blank">
sourceforge.net
</a></td> + <td> <a href="
http://ftp.winehq.org/pub/wine/source/
" target="_blank">
winehq.org
</a></td> <td> Our official source release site. </td> </tr> diff --git a/templates/fr/download.template b/templates/fr/download.template index 6232d01..4ffaad9 100644 --- a/templates/fr/download.template +++ b/templates/fr/download.template @@ -146,7 +146,7 @@ href="
http://wiki.winehq.org/ThirdPartyApplications
">applications tierces</a>.</ </tr> <tr bgcolor="#ffffff"> - <td> <a href="
http://sourceforge.net/projects/wine/files/Source/
" target="_blank">
sourceforge.net
</a></td> + <td> <a href="
http://ftp.winehq.org/pub/wine/source/
" target="_blank">
winehq.org
</a></td> <td> Site officiel de téléchargement. </td> </tr> diff --git a/templates/he/download.template b/templates/he/download.template index 0fd5dfe..61efa19 100644 --- a/templates/he/download.template +++ b/templates/he/download.template @@ -133,7 +133,7 @@ </tr> <tr bgcolor="#ffffff"> - <td> <a href="
http://sourceforge.net/projects/wine/files/Source/
" target="_blank">
sourceforge.net
</a></td> + <td> <a href="
http://ftp.winehq.org/pub/wine/source/
" target="_blank">
winehq.org
</a></td> <td> אתר הפצת קוד המקור הרשמי שלנו. </td> </tr> diff --git a/templates/pl/download.template b/templates/pl/download.template index 4037a71..1f3baa6 100644 --- a/templates/pl/download.template +++ b/templates/pl/download.template @@ -139,7 +139,7 @@ stronę wiki</a> w poszukiwaniu aplikacji osób trzecich.</p> </tr> <tr bgcolor="#ffffff"> - <td> <a href="
http://sourceforge.net/projects/wine/files/Source/
" target="_blank">
sourceforge.net
</a></td> + <td> <a href="
http://ftp.winehq.org/pub/wine/source/
" target="_blank">
winehq.org
</a></td> <td> Nasza oficjalna strona źródeł. </td> </tr> diff --git a/templates/pt/download.template b/templates/pt/download.template index 43c4934..063beae 100644 --- a/templates/pt/download.template +++ b/templates/pt/download.template @@ -130,7 +130,7 @@ de terceiros. </tr> <tr bgcolor="#ffffff"> - <td> <a href="
http://sourceforge.net/projects/wine/files/Source/
" target="_blank">
sourceforge.net
</a></td> + <td> <a href="
http://ftp.winehq.org/pub/wine/source/
" target="_blank">
winehq.org
</a></td> <td> Nosso sítio oficial para lançamentos. </td> </tr>
1
0
0
0
Nikolay Sivov : dwrite/tests: Some tests for control characters handling.
by Alexandre Julliard
27 May '15
27 May '15
Module: wine Branch: master Commit: 39d71c52ef7839fe7daad97b009d029b71f691ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=39d71c52ef7839fe7daad97b0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 27 12:53:32 2015 +0300 dwrite/tests: Some tests for control characters handling. --- dlls/dwrite/tests/analyzer.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ dlls/dwrite/tests/layout.c | 44 ++++++++++++++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/dlls/dwrite/tests/analyzer.c b/dlls/dwrite/tests/analyzer.c index 43c2a66..ffa4aed 100644 --- a/dlls/dwrite/tests/analyzer.c +++ b/dlls/dwrite/tests/analyzer.c @@ -1192,15 +1192,18 @@ static void test_GetGlyphs(void) { static const WCHAR test1W[] = {'<','B',' ','C',0}; static const WCHAR test2W[] = {'<','B','\t','C',0}; + static const WCHAR test3W[] = {0x202a,0x202c,0}; DWRITE_SHAPING_GLYPH_PROPERTIES shapingprops[20]; DWRITE_SHAPING_TEXT_PROPERTIES props[20]; UINT32 maxglyphcount, actual_count; IDWriteTextAnalyzer *analyzer; IDWriteFontFace *fontface; DWRITE_SCRIPT_ANALYSIS sa; + DWRITE_GLYPH_OFFSET offsets[10]; UINT16 clustermap[10]; UINT16 glyphs1[10]; UINT16 glyphs2[10]; + FLOAT advances[10]; HRESULT hr; hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); @@ -1262,6 +1265,55 @@ if (0) { ok(actual_count == 4, "got %d\n", actual_count); ok(glyphs1[0] != glyphs2[0], "got %d\n", glyphs1[0]); + /* embedded control codes, with unknown script id 0 */ + actual_count = 0; + hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test3W, lstrlenW(test3W), fontface, FALSE, TRUE, &sa, NULL, + NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(actual_count == 2, "got %d\n", actual_count); + ok(glyphs1[0] == 0, "got %d\n", glyphs1[0]); + ok(glyphs1[1] == 0, "got %d\n", glyphs1[1]); + ok(shapingprops[0].isClusterStart == 1, "got %d\n", shapingprops[0].isClusterStart); + ok(shapingprops[0].isZeroWidthSpace == 0, "got %d\n", shapingprops[0].isZeroWidthSpace); + ok(shapingprops[1].isClusterStart == 1, "got %d\n", shapingprops[1].isClusterStart); + ok(shapingprops[1].isZeroWidthSpace == 0, "got %d\n", shapingprops[1].isZeroWidthSpace); + ok(clustermap[0] == 0, "got %d\n", clustermap[0]); + ok(clustermap[1] == 1, "got %d\n", clustermap[1]); + + memset(advances, 0, sizeof(advances)); + hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap, props, lstrlenW(test3W), + glyphs1, shapingprops, actual_count, fontface, 10.0, FALSE, FALSE, &sa, NULL, NULL, + NULL, 0, advances, offsets); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(advances[0] == 10.0, "got %.2f\n", advances[0]); + ok(advances[1] == 10.0, "got %.2f\n", advances[1]); + + /* embedded control codes with proper script */ + sa.script = 0; + get_script_analysis(test3W, &sa); + ok(sa.script != 0, "got %d\n", sa.script); + actual_count = 0; + hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test3W, lstrlenW(test3W), fontface, FALSE, FALSE, &sa, NULL, + NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(actual_count == 2, "got %d\n", actual_count); + ok(glyphs1[0] == 0, "got %d\n", glyphs1[0]); + ok(glyphs1[1] == 0, "got %d\n", glyphs1[1]); + ok(shapingprops[0].isClusterStart == 1, "got %d\n", shapingprops[0].isClusterStart); + ok(shapingprops[0].isZeroWidthSpace == 0, "got %d\n", shapingprops[0].isZeroWidthSpace); + ok(shapingprops[1].isClusterStart == 1, "got %d\n", shapingprops[1].isClusterStart); + ok(shapingprops[1].isZeroWidthSpace == 0, "got %d\n", shapingprops[1].isZeroWidthSpace); + ok(clustermap[0] == 0, "got %d\n", clustermap[0]); + ok(clustermap[1] == 1, "got %d\n", clustermap[1]); + + memset(advances, 0, sizeof(advances)); + hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap, props, lstrlenW(test3W), + glyphs1, shapingprops, actual_count, fontface, 10.0, FALSE, FALSE, &sa, NULL, NULL, + NULL, 0, advances, offsets); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(advances[0] == 10.0, "got %.2f\n", advances[0]); + ok(advances[1] == 10.0, "got %.2f\n", advances[1]); + IDWriteTextAnalyzer_Release(analyzer); IDWriteFontFace_Release(fontface); } diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 54ebeed..5711cb3 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -990,6 +990,7 @@ static void test_typography(void) static void test_GetClusterMetrics(void) { + static const WCHAR str2W[] = {0x202a,0x202c,'a',0}; static const WCHAR strW[] = {'a','b','c','d',0}; DWRITE_INLINE_OBJECT_METRICS inline_metrics; DWRITE_CLUSTER_METRICS metrics[4]; @@ -1096,8 +1097,49 @@ todo_wine ok(inline_metrics.width > 0.0 && inline_metrics.width == metrics[0].width, "got %.2f, expected %.2f\n", inline_metrics.width, metrics[0].width); - IDWriteInlineObject_Release(trimm); IDWriteTextLayout_Release(layout); + + /* text with non-visual control codes */ + hr = IDWriteFactory_CreateTextLayout(factory, str2W, 3, format, 1000.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* bidi control codes take a separate cluster */ + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 3, "got %u\n", count); + +todo_wine + ok(metrics[0].width == 0.0, "got %.2f\n", metrics[0].width); + ok(metrics[0].length == 1, "got %d\n", metrics[0].length); + ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter); + ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace); + ok(metrics[0].isNewline == 0, "got %d\n", metrics[0].isNewline); + ok(metrics[0].isSoftHyphen == 0, "got %d\n", metrics[0].isSoftHyphen); + ok(metrics[0].isRightToLeft == 0, "got %d\n", metrics[0].isRightToLeft); + +todo_wine + ok(metrics[1].width == 0.0, "got %.2f\n", metrics[1].width); + ok(metrics[1].length == 1, "got %d\n", metrics[1].length); + ok(metrics[1].canWrapLineAfter == 0, "got %d\n", metrics[1].canWrapLineAfter); + ok(metrics[1].isWhitespace == 0, "got %d\n", metrics[1].isWhitespace); + ok(metrics[1].isNewline == 0, "got %d\n", metrics[1].isNewline); + ok(metrics[1].isSoftHyphen == 0, "got %d\n", metrics[1].isSoftHyphen); + ok(metrics[1].isRightToLeft == 0, "got %d\n", metrics[1].isRightToLeft); + + ok(metrics[2].width > 0.0, "got %.2f\n", metrics[2].width); + ok(metrics[2].length == 1, "got %d\n", metrics[2].length); +todo_wine + ok(metrics[2].canWrapLineAfter == 1, "got %d\n", metrics[2].canWrapLineAfter); + ok(metrics[2].isWhitespace == 0, "got %d\n", metrics[2].isWhitespace); + ok(metrics[2].isNewline == 0, "got %d\n", metrics[2].isNewline); + ok(metrics[2].isSoftHyphen == 0, "got %d\n", metrics[2].isSoftHyphen); + ok(metrics[2].isRightToLeft == 0, "got %d\n", metrics[2].isRightToLeft); + + IDWriteTextLayout_Release(layout); + + IDWriteInlineObject_Release(trimm); IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); }
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
43
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
Results per page:
10
25
50
100
200