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
April 2008
----- 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
4 participants
1278 discussions
Start a n
N
ew thread
Alex Villacís Lasso : richedit: EM_LINELENGTH: honor CR and LF counters.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: d95cbeef671186421da94a585d6201e524e428d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d95cbeef671186421da94a585…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 18:14:13 2008 -0500 richedit: EM_LINELENGTH: honor CR and LF counters. Add fixup to ME_FindItemAtOffset(), fixes crash by null-pointer access. Add tests for EM_LINELENGTH. --- dlls/riched20/editor.c | 19 ++++++++++++++++--- dlls/riched20/tests/editor.c | 36 +++++++++++++++++++++++++++++++++++- dlls/riched32/tests/editor.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index da61cd2..01502bf 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1190,6 +1190,7 @@ ME_DisplayItem * ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int *nItemOffset) { ME_DisplayItem *item = ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph); + int runLength; while (item && item->member.para.next_para->member.para.nCharOfs <= nOffset) item = ME_FindItemFwd(item, diParagraph); @@ -1206,7 +1207,10 @@ ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int do { item = ME_FindItemFwd(item, diRun); - } while (item && (item->member.run.nCharOfs + ME_StrLen(item->member.run.strText) <= nOffset)); + runLength = ME_StrLen(item->member.run.strText); + if (item->member.run.nFlags & MERF_ENDPARA) + runLength = item->member.run.nCR + item->member.run.nLF; + } while (item && (item->member.run.nCharOfs + runLength <= nOffset)); if (item) { nOffset -= item->member.run.nCharOfs; if (nItemOffset) @@ -2735,8 +2739,17 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (item_end->type == diStartRow) nNextLineOfs = ME_CharOfsFromRunOfs(editor, ME_FindItemFwd(item_end, diRun), 0); else - nNextLineOfs = ME_FindItemFwd(item, diParagraphOrEnd)->member.para.nCharOfs - - (editor->bEmulateVersion10?2:1); + { + ME_DisplayItem *endPara; + + nNextLineOfs = ME_FindItemFwd(item, diParagraphOrEnd)->member.para.nCharOfs; + endPara = ME_FindItemFwd(item, diParagraphOrEnd); + endPara = ME_FindItemBack(endPara, diRun); + assert(endPara); + assert(endPara->type == diRun); + assert(endPara->member.run.nFlags & MERF_ENDPARA); + nNextLineOfs -= endPara->member.run.nCR + endPara->member.run.nLF; + } nChars = nNextLineOfs - nThisLineOfs; TRACE("EM_LINELENGTH(%ld)==%d\n",wParam, nChars); return nChars; diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index d78c7f6..28b4ce5 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -261,6 +261,40 @@ static void test_EM_GETLINE(void) DestroyWindow(hwndRichEdit); } +static void test_EM_LINELENGTH(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text = + "richedit1\r" + "richedit1\n" + "richedit1\r\n" + "richedit1"; + int offset_test[10][2] = { + {0, 9}, + {5, 9}, + {10, 9}, + {15, 9}, + {20, 9}, + {25, 9}, + {30, 9}, + {35, 9}, + {40, 0}, + {45, 0}, + }; + int i; + LRESULT result; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + + for (i = 0; i < 10; i++) { + result = SendMessage(hwndRichEdit, EM_LINELENGTH, offset_test[i][0], 0); + ok(result == offset_test[i][1], "Length of line at offset %d is %ld, expected %d\n", + offset_test[i][0], result, offset_test[i][1]); + } + + DestroyWindow(hwndRichEdit); +} + static int get_scroll_pos_y(HWND hwnd) { POINT p = {-1, -1}; @@ -2972,7 +3006,6 @@ static void test_eventMask(void) } - START_TEST( editor ) { MSG msg; @@ -2989,6 +3022,7 @@ START_TEST( editor ) test_EM_SCROLLCARET(); test_EM_SCROLL(); test_WM_SETTEXT(); + test_EM_LINELENGTH(); test_EM_SETCHARFORMAT(); test_EM_SETTEXTMODE(); test_TM_PLAINTEXT(); diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 106cd65..6fe027b 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -430,6 +430,39 @@ static void test_EM_GETLINE(void) DestroyWindow(hwndRichEdit); } +static void test_EM_LINELENGTH(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text = + "richedit1\r" + "richedit1\n" + "richedit1\r\n" + "richedit1\r\r\r\r\r\n"; + int offset_test[10][2] = { + {0, 9}, + {5, 9}, + {10, 9}, + {15, 9}, + {20, 9}, + {25, 9}, + {30, 9}, + {35, 9}, + {40, 9}, /* <----- in the middle of the \r run, but run not counted */ + {45, 0}, + }; + int i; + LRESULT result; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + + for (i = 0; i < 10; i++) { + result = SendMessage(hwndRichEdit, EM_LINELENGTH, offset_test[i][0], 0); + ok(result == offset_test[i][1], "Length of line at offset %d is %ld, expected %d\n", + offset_test[i][0], result, offset_test[i][1]); + } + + DestroyWindow(hwndRichEdit); +} START_TEST( editor ) { @@ -446,6 +479,7 @@ START_TEST( editor ) test_EM_STREAMIN(); test_EM_STREAMOUT(); test_EM_GETLINE(); + test_EM_LINELENGTH(); /* Set the environment variable WINETEST_RICHED32 to keep windows * responsive and open for 30 seconds. This is useful for debugging.
1
0
0
0
Alex Villacís Lasso : richedit: EM_GETLINE: honor CR and LF counters.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 3968a67eb9faa428365c5a2ca42d15e0f14d4d9c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3968a67eb9faa428365c5a2ca…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 16:43:14 2008 -0500 richedit: EM_GETLINE: honor CR and LF counters. Add richedit 1.0 tests for EM_GETLINE. --- dlls/riched20/editor.c | 50 ++++++++++++++++---------- dlls/riched32/tests/editor.c | 79 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 19 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 7a0dce7..da61cd2 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2608,11 +2608,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { ME_DisplayItem *run; const unsigned int nMaxChars = *(WORD *) lParam; - unsigned int nEndChars, nCharsLeft = nMaxChars; + unsigned int nCharsLeft = nMaxChars; char *dest = (char *) lParam; - /* rich text editor 1.0 uses \r\n for line end, 2.0 uses just \r; - we need to know how if we have the extra \n or not */ - int nLF = editor->bEmulateVersion10; + BOOL wroteNull = FALSE; TRACE("EM_GETLINE: row=%d, nMaxChars=%d (%s)\n", (int) wParam, nMaxChars, unicode ? "Unicode" : "Ansi"); @@ -2640,24 +2638,38 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, nCharsLeft -= nCopy; } - /* append \r\0 (or \r\n\0 in 1.0), space allowing */ - nEndChars = min(nCharsLeft, 2 + nLF); - nCharsLeft -= nEndChars; - if (unicode) + /* append line termination, space allowing */ + if (nCharsLeft > 0) { - const WCHAR src[] = {'\r', '\0'}; - const WCHAR src10[] = {'\r', '\n', '\0'}; - lstrcpynW((LPWSTR) dest, nLF ? src10 : src, nEndChars); + if (run && (run->member.run.nFlags & MERF_ENDPARA)) + { + unsigned int i; + /* Write as many \r as encoded in end-of-paragraph, space allowing */ + for (i = 0; i < run->member.run.nCR && nCharsLeft > 0; i++, nCharsLeft--) + { + *((WCHAR *)dest) = '\r'; + dest += unicode ? sizeof(WCHAR) : 1; + } + /* Write as many \n as encoded in end-of-paragraph, space allowing */ + for (i = 0; i < run->member.run.nLF && nCharsLeft > 0; i++, nCharsLeft--) + { + *((WCHAR *)dest) = '\n'; + dest += unicode ? sizeof(WCHAR) : 1; + } + } + if (nCharsLeft > 0) + { + if (unicode) + *((WCHAR *)dest) = '\0'; + else + *dest = '\0'; + nCharsLeft--; + wroteNull = TRUE; + } } - else - lstrcpynA(dest, nLF ? "\r\n" : "\r", nEndChars); - - TRACE("EM_GETLINE: got %u bytes\n", nMaxChars - nCharsLeft); - if (nEndChars == 2 + nLF) - return nMaxChars - nCharsLeft - 1; /* don't count \0 */ - else - return nMaxChars - nCharsLeft; + TRACE("EM_GETLINE: got %u characters\n", nMaxChars - nCharsLeft); + return nMaxChars - nCharsLeft - (wroteNull ? 1 : 0); } case EM_GETLINECOUNT: { diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 4bf35ab..106cd65 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -353,6 +353,84 @@ static void test_EM_STREAMOUT(void) DestroyWindow(hwndRichEdit); } +static const struct getline_s { + int line; + size_t buffer_len; + const char *text; + int wine_todo; +} gl[] = { + {0, 10, "foo bar\r\n", 0}, + {1, 10, "\n", 1}, + {2, 10, "bar\n", 1}, + {3, 10, "\r\n", 0}, + + /* Buffer smaller than line length */ + {0, 2, "foo bar\r", 0}, + {0, 1, "foo bar\r", 0}, + {0, 0, "foo bar\r", 0} +}; + +static void test_EM_GETLINE(void) +{ + int i; + HWND hwndRichEdit = new_richedit(NULL); + static const int nBuf = 1024; + char dest[1024], origdest[1024]; + const char text[] = "foo bar\r\n" + "\n" + "bar\n"; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + + memset(origdest, 0xBB, nBuf); + for (i = 0; i < sizeof(gl)/sizeof(struct getline_s); i++) + { + int nCopied; + int expected_nCopied = min(gl[i].buffer_len, strlen(gl[i].text)); + int expected_bytes_written = min(gl[i].buffer_len, strlen(gl[i].text) + 1); + memset(dest, 0xBB, nBuf); + *(WORD *) dest = gl[i].buffer_len; + + /* EM_GETLINE appends a "\r\0" to the end of the line + * nCopied counts up to and including the '\r' */ + nCopied = SendMessage(hwndRichEdit, EM_GETLINE, gl[i].line, (LPARAM) dest); + if (gl[i].wine_todo) todo_wine { + ok(nCopied == expected_nCopied, "%d: %d!=%d\n", i, nCopied, + expected_nCopied); + } else + ok(nCopied == expected_nCopied, "%d: %d!=%d\n", i, nCopied, + expected_nCopied); + /* two special cases since a parameter is passed via dest */ + if (gl[i].buffer_len == 0) + ok(!dest[0] && !dest[1] && !strncmp(dest+2, origdest+2, nBuf-2), + "buffer_len=0\n"); + else if (gl[i].buffer_len == 1) + ok(dest[0] == gl[i].text[0] && !dest[1] && + !strncmp(dest+2, origdest+2, nBuf-2), "buffer_len=1\n"); + else + { + if (gl[i].wine_todo) todo_wine { + ok(!strncmp(dest, gl[i].text, expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + ok(!strncmp(dest + expected_bytes_written, origdest + + expected_bytes_written, nBuf - expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + } + else + { + ok(!strncmp(dest, gl[i].text, expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + ok(!strncmp(dest + expected_bytes_written, origdest + + expected_bytes_written, nBuf - expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + } + } + } + + DestroyWindow(hwndRichEdit); +} + + START_TEST( editor ) { MSG msg; @@ -367,6 +445,7 @@ START_TEST( editor ) test_WM_GETTEXTLENGTH(); test_EM_STREAMIN(); test_EM_STREAMOUT(); + test_EM_GETLINE(); /* Set the environment variable WINETEST_RICHED32 to keep windows * responsive and open for 30 seconds. This is useful for debugging.
1
0
0
0
Alex Villacís Lasso : richedit: Add support for encoding number of CR and LF contained within a line break .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: d47f66191e1497fd2776528aac29b9ddedf82108 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d47f66191e1497fd2776528aa…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 13:29:53 2008 -0500 richedit: Add support for encoding number of CR and LF contained within a line break. --- dlls/riched20/caret.c | 10 +++++++++- dlls/riched20/editor.h | 2 +- dlls/riched20/editstr.h | 2 ++ dlls/riched20/list.c | 2 ++ dlls/riched20/para.c | 25 +++++++++++++++++-------- dlls/riched20/undo.c | 6 +++++- 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 7d50460..2153092 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -531,7 +531,15 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, } tmp_style = ME_GetInsertStyle(editor, nCursor); /* ME_SplitParagraph increases style refcount */ - tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style); + + /* TODO: move here and fix logic for pos updating according to emulation, + so that number of CR and LF encoded are a result of such logic, instead + of hardcoded as below. + */ + if (editor->bEmulateVersion10) + tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, 1, 1); + else + tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, 1, 0); p->pRun = ME_FindItemFwd(tp, diRun); end_run = ME_FindItemBack(tp, diRun); ME_ReleaseStyle(end_run->member.run.style); diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 0c0d324..992ce7f 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -220,7 +220,7 @@ int ME_twips2pointsY(ME_Context *c, int y); ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run); void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end); void ME_MakeFirstParagraph(ME_TextEditor *editor); -ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style); +ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, int numCR, int numLF); ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp); void ME_DumpParaStyle(ME_Paragraph *s); void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]); diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 964f356..aedaefa 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -148,6 +148,7 @@ typedef struct tagME_Run POINT pt; /* relative to para's position */ struct tagME_TableCell *pCell; /* for MERF_CELL: points to respective cell in ME_Paragraph */ REOBJECT *ole_obj; /* FIXME: should be a union with strText (at least) */ + int nCR; int nLF; /* for MERF_ENDPARA: number of \r and \n characters encoded by run */ } ME_Run; typedef struct tagME_Document { @@ -217,6 +218,7 @@ typedef struct tagME_UndoItem { ME_DisplayItem di; int nStart, nLen; + int nCR, nLF; /* used by diUndoSplitParagraph */ } ME_UndoItem; typedef struct tagME_TextBuffer diff --git a/dlls/riched20/list.c b/dlls/riched20/list.c index 14f9b17..951e7f3 100644 --- a/dlls/riched20/list.c +++ b/dlls/riched20/list.c @@ -200,6 +200,8 @@ void ME_DumpDocument(ME_TextBuffer *buffer) case diRun: TRACE(" - Run(\"%s\", %d)\n", debugstr_w(pItem->member.run.strText->szData), pItem->member.run.nCharOfs); + if (pItem->member.run.nFlags & MERF_ENDPARA) + TRACE(" - Paragraph end: %d CR, %d LF\n", pItem->member.run.nCR, pItem->member.run.nLF); break; case diTextEnd: TRACE("End(ofs=%d)\n", pItem->member.para.nCharOfs); diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index b2f8e6c..6f52910 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -110,7 +110,7 @@ void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_D } /* split paragraph at the beginning of the run */ -ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME_Style *style) +ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME_Style *style, int numCR, int numLF) { ME_DisplayItem *next_para = NULL; ME_DisplayItem *run_para = NULL; @@ -119,10 +119,12 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME ME_UndoItem *undo = NULL; int ofs; ME_DisplayItem *pp; - int end_len = (editor->bEmulateVersion10 ? 2 : 1); + int end_len = numCR + numLF; assert(run->type == diRun); + end_run->member.run.nCR = numCR; + end_run->member.run.nLF = numLF; run_para = ME_GetParagraph(run); assert(run_para->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); @@ -204,7 +206,7 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) ME_DisplayItem *pNext, *pFirstRunInNext, *pRun, *pTmp; int i, shift; ME_UndoItem *undo = NULL; - int end_len = (editor->bEmulateVersion10 ? 2 : 1); + int end_len; assert(tp->type == diParagraph); assert(tp->member.para.next_para); @@ -212,6 +214,15 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) pNext = tp->member.para.next_para; + /* Need to locate end-of-paragraph run here, in order to know end_len */ + pRun = ME_FindItemBack(pNext, diRunOrParagraph); + + assert(pRun); + assert(pRun->type == diRun); + assert(pRun->member.run.nFlags & MERF_ENDPARA); + + end_len = pRun->member.run.nCR + pRun->member.run.nLF; + { /* null char format operation to store the original char format for the ENDPARA run */ CHARFORMAT2W fmt; @@ -222,18 +233,16 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) if (undo) { undo->nStart = pNext->member.para.nCharOfs - end_len; + undo->nCR = pRun->member.run.nCR; + undo->nLF = pRun->member.run.nLF; assert(pNext->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); *undo->di.member.para.pFmt = *pNext->member.para.pFmt; } shift = pNext->member.para.nCharOfs - tp->member.para.nCharOfs - end_len; - pRun = ME_FindItemBack(pNext, diRunOrParagraph); pFirstRunInNext = ME_FindItemFwd(pNext, diRunOrParagraph); - - assert(pRun); - assert(pRun->type == diRun); - assert(pRun->member.run.nFlags & MERF_ENDPARA); + assert(pFirstRunInNext->type == diRun); /* if some cursor points at end of paragraph, make it point to the first diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c index 43f8810..a26f0e0 100644 --- a/dlls/riched20/undo.c +++ b/dlls/riched20/undo.c @@ -56,6 +56,7 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_Disp else { ME_DisplayItem *pItem = (ME_DisplayItem *)ALLOC_OBJ(ME_UndoItem); + ((ME_UndoItem *)pItem)->nCR = ((ME_UndoItem *)pItem)->nLF = -1; switch(type) { case diUndoEndTransaction: @@ -225,7 +226,10 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) ME_CursorFromCharOfs(editor, pUItem->nStart, &tmp); if (tmp.nOffset) tmp.pRun = ME_SplitRunSimple(editor, tmp.pRun, tmp.nOffset); - new_para = ME_SplitParagraph(editor, tmp.pRun, tmp.pRun->member.run.style); + assert(pUItem->nCR >= 0); + assert(pUItem->nLF >= 0); + new_para = ME_SplitParagraph(editor, tmp.pRun, tmp.pRun->member.run.style, + pUItem->nCR, pUItem->nLF); assert(pItem->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); *new_para->member.para.pFmt = *pItem->member.para.pFmt; break;
1
0
0
0
Alex Villacís Lasso : richedit: Fixups to move over to reliance on CR and LF counters.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 8d37388fe7ff2d45054e0a05374767b515dba237 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d37388fe7ff2d45054e0a053…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 15:26:58 2008 -0500 richedit: Fixups to move over to reliance on CR and LF counters. Text streamout now honors CR and LF counters. Tests to pin down required EM_STREAMOUT behavior. --- dlls/riched20/editor.c | 3 ++ dlls/riched20/para.c | 2 + dlls/riched20/run.c | 12 +++++-- dlls/riched20/tests/editor.c | 55 +++++++++++++++++++++++++++++++++ dlls/riched20/writer.c | 45 ++++++++++++++++++++++----- dlls/riched32/tests/editor.c | 69 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 173 insertions(+), 13 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8d37388fe7ff2d45054e0…
1
0
0
0
Alex Villacís Lasso : richedit: Remove reliance on bEmulateVersion10 for end-of-line handling in ME_InternalDeleteText .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: fd557736806050d195991b6540aa3970a0d88f14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fd557736806050d195991b654…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 15:48:24 2008 -0500 richedit: Remove reliance on bEmulateVersion10 for end-of-line handling in ME_InternalDeleteText. --- dlls/riched20/caret.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 2153092..56cd2b1 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -270,6 +270,8 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, ME_CursorFromCharOfs(editor, nOfs, &c); run = &c.pRun->member.run; if (run->nFlags & MERF_ENDPARA) { + int eollen = run->nCR + run->nLF; + if (!ME_FindItemFwd(c.pRun, diParagraph)) { return; @@ -277,9 +279,7 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, ME_JoinParagraphs(editor, ME_GetParagraph(c.pRun)); /* ME_SkipAndPropagateCharOffset(p->pRun, shift); */ ME_CheckCharOffsets(editor); - nChars--; - if (editor->bEmulateVersion10 && nChars) - nChars--; + nChars -= (eollen < nChars) ? eollen : nChars; continue; } else
1
0
0
0
Jeremy White : gdi32: Shift default height used in EnumStructs to the standard em size of 2048.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: f4625d1ae1109ee9a30faa8254b10779853f0ac2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4625d1ae1109ee9a30faa825…
Author: Jeremy White <jwhite(a)codeweavers.com> Date: Wed Apr 23 23:25:27 2008 -0500 gdi32: Shift default height used in EnumStructs to the standard em size of 2048. As pointed out by Dmitry Timoshkov. --- dlls/gdi32/freetype.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index bfa986d..82150d3 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3560,7 +3560,7 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf, font = alloc_font(); if(face->scalable) { - height = 100; + height = -2048; /* 2048 is the most common em size */ width = 0; } else { height = face->size.y_ppem >> 6;
1
0
0
0
Aric Stewart : hlink: Implement IExtensionServices.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 09af64cb83ca5122c0ce271d275fa3c35ab943ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09af64cb83ca5122c0ce271d2…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Apr 28 13:44:16 2008 -0500 hlink: Implement IExtensionServices. --- dlls/hlink/extserv.c | 117 ++++++++++++++++++++++++++++++++++++++++++-------- include/hlguids.h | 2 + include/hlink.idl | 22 +++++++++ 3 files changed, 123 insertions(+), 18 deletions(-) diff --git a/dlls/hlink/extserv.c b/dlls/hlink/extserv.c index daedf9e..c4e95ab 100644 --- a/dlls/hlink/extserv.c +++ b/dlls/hlink/extserv.c @@ -26,9 +26,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(hlink); #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) typedef struct { - const IUnknownVtbl *lpIUnknownVtbl; - const IAuthenticateVtbl *lpIAuthenticateVtbl; - const IHttpNegotiateVtbl *lpIHttpNegotiateVtbl; + const IUnknownVtbl *lpIUnknownVtbl; + const IAuthenticateVtbl *lpIAuthenticateVtbl; + const IHttpNegotiateVtbl *lpIHttpNegotiateVtbl; + const IExtensionServicesVtbl *lpIExtensionServicesVtbl; LONG ref; IUnknown *outer; @@ -42,6 +43,7 @@ typedef struct { #define EXTSERVUNK(x) ((IUnknown*) &(x)->lpIUnknownVtbl) #define AUTHENTICATE(x) ((IAuthenticate*) &(x)->lpIAuthenticateVtbl) #define HTTPNEGOTIATE(x) ((IHttpNegotiate*) &(x)->lpIHttpNegotiateVtbl) +#define EXTENSIONSERVICES(x) ((IExtensionServices*) &(x)->lpIExtensionServicesVtbl) #define EXTSERVUNK_THIS(iface) DEFINE_THIS(ExtensionService, IUnknown, iface) @@ -60,6 +62,9 @@ static HRESULT WINAPI ExtServUnk_QueryInterface(IUnknown *iface, REFIID riid, vo }else if(IsEqualGUID(&IID_IHttpNegotiate, riid)) { TRACE("(%p)->(IID_IHttpNegotiate %p)\n", This, ppv); *ppv = HTTPNEGOTIATE(This); + }else if(IsEqualGUID(&IID_IExtensionServices, riid)) { + TRACE("(%p)->(IID_IExtensionServices %p)\n", This, ppv); + *ppv = EXTENSIONSERVICES(This); } if(*ppv) { @@ -209,6 +214,90 @@ static const IHttpNegotiateVtbl HttpNegotiateVtbl = { HttpNegotiate_OnResponse }; +#define EXTENSIONSERVICES_THIS(iface) DEFINE_THIS(ExtensionService, IExtensionServices, iface) + +static HRESULT WINAPI ExtServ_QueryInterface(IExtensionServices *iface, REFIID riid, void **ppv) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + return IUnknown_QueryInterface(This->outer, riid, ppv); +} + +static ULONG WINAPI ExtServ_AddRef(IExtensionServices *iface) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + return IUnknown_AddRef(This->outer); +} + +static ULONG WINAPI ExtServ_Release(IExtensionServices *iface) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + return IUnknown_Release(This->outer); +} + +static HRESULT ExtServ_ImplSetAdditionalHeaders(ExtensionService* This, LPCWSTR pwzAdditionalHeaders) +{ + int len = 0; + + heap_free(This->headers); + This->headers = NULL; + + if (!pwzAdditionalHeaders) + return S_OK; + + len = strlenW(pwzAdditionalHeaders); + + if(len && pwzAdditionalHeaders[len-1] != '\n' && pwzAdditionalHeaders[len-1] != '\r') { + static const WCHAR endlW[] = {'\r','\n',0}; + This->headers = heap_alloc(len*sizeof(WCHAR) + sizeof(endlW)); + memcpy(This->headers, pwzAdditionalHeaders, len*sizeof(WCHAR)); + memcpy(This->headers+len, endlW, sizeof(endlW)); + }else { + This->headers = hlink_strdupW(pwzAdditionalHeaders); + } + + return S_OK; +} + +static HRESULT WINAPI ExtServ_SetAdditionalHeaders(IExtensionServices* iface, LPCWSTR pwzAdditionalHeaders) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_w(pwzAdditionalHeaders)); + + return ExtServ_ImplSetAdditionalHeaders(This,pwzAdditionalHeaders); +} + +static HRESULT ExtServ_ImplSetAuthenticateData(ExtensionService* This, HWND phwnd, LPCWSTR pwzUsername, LPCWSTR pwzPassword) +{ + heap_free(This->username); + heap_free(This->password); + + This->hwnd = phwnd; + This->username = hlink_strdupW(pwzUsername); + This->password = hlink_strdupW(pwzPassword); + + return S_OK; +} + +static HRESULT WINAPI ExtServ_SetAuthenticateData(IExtensionServices* iface, HWND phwnd, LPCWSTR pwzUsername, LPCWSTR pwzPassword) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + + TRACE("(%p)->(%p %s %s)\n", This, phwnd, debugstr_w(pwzUsername), debugstr_w(pwzPassword)); + + return ExtServ_ImplSetAuthenticateData(This, phwnd, pwzUsername, pwzPassword); +} + +#undef EXTENSIONSERVICES_THIS + +static const IExtensionServicesVtbl ExtServVtbl = { + ExtServ_QueryInterface, + ExtServ_AddRef, + ExtServ_Release, + ExtServ_SetAdditionalHeaders, + ExtServ_SetAuthenticateData +}; + /*********************************************************************** * HlinkCreateExtensionServices (HLINK.@) */ @@ -217,7 +306,6 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders, IUnknown *punkOuter, REFIID riid, void** ppv) { ExtensionService *ret; - int len = 0; HRESULT hres = S_OK; TRACE("%s %p %s %s %p %s %p\n",debugstr_w(pwzAdditionalHeaders), @@ -229,22 +317,15 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders, ret->lpIUnknownVtbl = &ExtServUnkVtbl; ret->lpIAuthenticateVtbl = &AuthenticateVtbl; ret->lpIHttpNegotiateVtbl = &HttpNegotiateVtbl; + ret->lpIExtensionServicesVtbl= &ExtServVtbl; ret->ref = 1; - ret->hwnd = phwnd; - ret->username = hlink_strdupW(pszUsername); - ret->password = hlink_strdupW(pszPassword); - - if(pwzAdditionalHeaders) - len = strlenW(pwzAdditionalHeaders); + ret->headers = NULL; + ret->hwnd = NULL; + ret->username = NULL; + ret->password = NULL; - if(len && pwzAdditionalHeaders[len-1] != '\n' && pwzAdditionalHeaders[len-1] != '\r') { - static const WCHAR endlW[] = {'\r','\n',0}; - ret->headers = heap_alloc(len*sizeof(WCHAR) + sizeof(endlW)); - memcpy(ret->headers, pwzAdditionalHeaders, len*sizeof(WCHAR)); - memcpy(ret->headers+len, endlW, sizeof(endlW)); - }else { - ret->headers = hlink_strdupW(pwzAdditionalHeaders); - } + ExtServ_ImplSetAuthenticateData(ret, phwnd, pszUsername, pszPassword); + ExtServ_ImplSetAdditionalHeaders(ret, pwzAdditionalHeaders); if(!punkOuter) { ret->outer = EXTSERVUNK(ret); diff --git a/include/hlguids.h b/include/hlguids.h index 77bac3e..7a45e66 100644 --- a/include/hlguids.h +++ b/include/hlguids.h @@ -25,5 +25,7 @@ DEFINE_GUID(CLSID_StdHlink, 0x79eac9d0, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa,0x00,0x4b,0xa9,0x0b); DEFINE_GUID(CLSID_StdHlinkBrowseContext, 0x79eac9d1, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa,0x00,0x4b,0xa9,0x0b); +DEFINE_GUID(CLSID_IID_IExtensionServices, + 0x79eac9cb, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa,0x00,0x4b,0xa9,0x0b); #endif diff --git a/include/hlink.idl b/include/hlink.idl index c59cd32..886acb3 100644 --- a/include/hlink.idl +++ b/include/hlink.idl @@ -416,3 +416,25 @@ interface IHlinkFrame : IUnknown [in, unique] LPCWSTR pwzLocation, [in, unique] LPCWSTR pwzFriendlyName); } + +/***************************************************************************** + * IExtensionServices interface + */ +[ + object, + uuid(79eac9cb-baf9-11ce-8c82-00aa004ba90b), + pointer_default(unique) +] + +interface IExtensionServices: IUnknown +{ + typedef IExtensionServices *LPEXTENSIONSERVICES; + + HRESULT SetAdditionalHeaders( + [in] LPCWSTR pwzAdditionalHeaders); + + HRESULT SetAuthenticateData( + [in] HWND phwnd, + [in] LPCWSTR pwzUsername, + [in] LPCWSTR pwzPassword); +}
1
0
0
0
Kusanagi Kouichi : winex11: Allow XIM server to be started after Wine.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: bf05ded740b283e64a33d8139170654e0ac443bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf05ded740b283e64a33d8139…
Author: Kusanagi Kouichi <slash(a)ma.neweb.ne.jp> Date: Tue Apr 29 20:03:51 2008 +0900 winex11: Allow XIM server to be started after Wine. --- dlls/winex11.drv/ime.c | 17 ----------------- dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/xim.c | 1 - 3 files changed, 0 insertions(+), 19 deletions(-) diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index 5d36612..ffd8e80 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -75,7 +75,6 @@ static const WCHAR UI_CLASS_NAME[] = {'W','i','n','e','X','1','1','I','M','E',0} static HIMC *hSelectedFrom = NULL; static INT hSelectedCount = 0; -static BOOL hXIMPresent = FALSE; /* MSIME messages */ static UINT WM_MSIME_SERVICE; @@ -521,11 +520,6 @@ BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo, LPWSTR lpszUIClass, LPCWSTR lpszOption) { TRACE("\n"); - if (!hXIMPresent) - { - ERR("No XIM in the back end\n"); - return FALSE; - } lpIMEInfo->dwPrivateDataSize = sizeof (IMEPRIVATE); lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET; lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE; @@ -592,12 +586,6 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect) return FALSE; } - if (!hXIMPresent) - { - ERR("No XIM in the back end\n"); - return FALSE; - } - if (!hIMC) return TRUE; @@ -981,11 +969,6 @@ void IME_SetOpenStatus(BOOL fOpen) ImmSetOpenStatus(RealIMC(FROM_X11), fOpen); } -void IME_XIMPresent(BOOL present) -{ - hXIMPresent = present; -} - LRESULT IME_SendMessageToSelectedHWND(UINT msg, WPARAM wParam, LPARAM lParam) { LPINPUTCONTEXT lpIMC; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 2f2e583..c543ef8 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -277,7 +277,6 @@ extern BOOL destroy_glxpixmap(Display *display, XID glxpixmap); extern void IME_RegisterClasses(HINSTANCE hImeInst); extern void IME_UnregisterClasses(HINSTANCE hImeInst); extern void IME_SetOpenStatus(BOOL fOpen); -extern void IME_XIMPresent(BOOL present); extern LRESULT IME_SendMessageToSelectedHWND(UINT msg, WPARAM wParam, LPARAM lParam); extern INT IME_GetCursorPos(); extern void IME_SetCursorPos(DWORD pos); diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index c44a869..a4fbdb2 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -475,7 +475,6 @@ static void X11DRV_OpenIM(Display *display, XPointer ptr, XPointer data) thread_data->xim = xim; XUnregisterIMInstantiateCallback(display, NULL, NULL, NULL, X11DRV_OpenIM, NULL); wine_tsx11_unlock(); - IME_XIMPresent(TRUE); IME_UpdateAssociation(NULL); }
1
0
0
0
Tijl Coosemans : hhctrl: Fix NULL pointer dereference in some failure cases .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: efa040119ba2a636c654e69b5caed1829b5c0968 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=efa040119ba2a636c654e69b5…
Author: Tijl Coosemans <tijl(a)ulyssis.org> Date: Mon Apr 28 22:41:47 2008 +0200 hhctrl: Fix NULL pointer dereference in some failure cases. --- dlls/hhctrl.ocx/hhctrl.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index e663c11..a555a42 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -123,14 +123,17 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat } info = CreateHelpViewer(filename); + if(!info) + return NULL; + + if(!index) + index = info->WinType.pszFile; - if (info) + res = NavigateToChm(info, info->pCHMInfo->szFile, index); + if(!res) { - if (!index) - index = info->WinType.pszFile; - res = NavigateToChm(info, info->pCHMInfo->szFile, index); - if(!res) - ReleaseHelpViewer(info); + ReleaseHelpViewer(info); + return NULL; } return info->WinType.hwndHelp; }
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipGetPathGradientCenterPointI.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 9cce789881caddb67be8dede18adbe854af16950 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9cce789881caddb67be8dede1…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:10:25 2008 +0400 gdiplus: Implemented GdipGetPathGradientCenterPointI. --- dlls/gdiplus/brush.c | 19 +++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 21 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 5d0a1de..31c7cf1 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -488,6 +488,25 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad, return Ok; } +GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient *grad, + GpPoint *point) +{ + GpStatus ret; + GpPointF ptf; + + if(!point) + return InvalidParameter; + + ret = GdipGetPathGradientCenterPoint(grad,&ptf); + + if(ret == Ok){ + point->X = roundr(ptf.X); + point->Y = roundr(ptf.Y); + } + + return ret; +} + GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient *grad, REAL *x, REAL *y) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c06fa2e..8e8e94f 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -329,7 +329,7 @@ @ stub GdipGetPathGradientBlendCount @ stub GdipGetPathGradientCenterColor @ stdcall GdipGetPathGradientCenterPoint(ptr ptr) -@ stub GdipGetPathGradientCenterPointI +@ stdcall GdipGetPathGradientCenterPointI(ptr ptr) @ stdcall GdipGetPathGradientFocusScales(ptr ptr ptr) @ stdcall GdipGetPathGradientGammaCorrection(ptr ptr) @ stub GdipGetPathGradientPath diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index dbf1c85..49464d8 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -169,6 +169,7 @@ GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient*,GpRect*); GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient*,ARGB*); GpStatus WINGDIPAPI GdipGetPathGradientCenterColor(GpPathGradient*,ARGB*); GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient*,GpPointF*); +GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient*,GpPoint*); GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient*,REAL*,REAL*); GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient*,BOOL*); GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*);
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
128
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Results per page:
10
25
50
100
200