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
November 2007
----- 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
3 participants
757 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: More range tests and fixes.
by Alexandre Julliard
06 Nov '07
06 Nov '07
Module: wine Branch: master Commit: 918b00f8ef4880493a1b79f9d12ddad19f06704f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=918b00f8ef4880493a1b79f9d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 5 21:45:46 2007 +0100 mshtml: More range tests and fixes. --- dlls/mshtml/tests/dom.c | 30 ++++++++- dlls/mshtml/txtrange.c | 161 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 138 insertions(+), 53 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=918b00f8ef4880493a1b7…
1
0
0
0
Jacek Caban : mshtml: Store HTMLDocument pointer in BSCallback object.
by Alexandre Julliard
06 Nov '07
06 Nov '07
Module: wine Branch: master Commit: f309cdf733caaf3219b51db91256421ae9c9f011 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f309cdf733caaf3219b51db91…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 5 21:45:07 2007 +0100 mshtml: Store HTMLDocument pointer in BSCallback object. --- dlls/mshtml/htmldoc.c | 1 + dlls/mshtml/mshtml_private.h | 5 ++++- dlls/mshtml/navigate.c | 27 ++++++++++++++++++++++++--- dlls/mshtml/persist.c | 2 +- dlls/mshtml/task.c | 7 ++++--- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 4ea2912..e9df70e 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1185,6 +1185,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) ret->window = NULL; ret->option_factory = NULL; + list_init(&ret->bindings); list_init(&ret->selection_list); list_init(&ret->range_list); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 14ae1be..2a8627c 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -140,6 +140,7 @@ struct HTMLDocument { BSCallback *bscallback; IMoniker *mon; LPOLESTR url; + struct list bindings; HWND hwnd; HWND tooltips_hwnd; @@ -260,6 +261,8 @@ struct BSCallback { HTMLDocument *doc; nsProtocolStream *nsstream; + + struct list entry; }; typedef struct { @@ -417,7 +420,7 @@ void init_nsevents(NSContainer*); nsresult get_nsinterface(nsISupports*,REFIID,void**); BSCallback *create_bscallback(IMoniker*); -HRESULT start_binding(BSCallback*); +HRESULT start_binding(HTMLDocument*,BSCallback*); HRESULT load_stream(BSCallback*,IStream*); void set_document_bscallback(HTMLDocument*,BSCallback*); void set_current_mon(HTMLDocument*,IMoniker*); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 659ba22..85fb2e5 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -29,6 +29,7 @@ #include "winuser.h" #include "ole2.h" #include "hlguids.h" +#include "shlguid.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -222,7 +223,7 @@ static HRESULT read_stream_data(BSCallback *This, IStream *stream) FIXME("OnStartRequest failed: %08x\n", nsres); /* events are reset when a new document URI is loaded, so re-initialise them here */ - if(This->doc && This->doc->nscontainer) + if(This->doc && This->doc->bscallback == This && This->doc->nscontainer) init_nsevents(This->doc->nscontainer); } @@ -328,6 +329,7 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface) IMoniker_Release(This->mon); if(This->binding) IBinding_Release(This->binding); + list_remove(&This->entry); mshtml_free(This->headers); mshtml_free(This); } @@ -345,6 +347,9 @@ static HRESULT WINAPI BindStatusCallback_OnStartBinding(IBindStatusCallback *ifa IBinding_AddRef(pbind); This->binding = pbind; + if(This->doc) + list_add_head(&This->doc->bindings, &This->entry); + add_nsrequest(This); return S_OK; @@ -414,7 +419,12 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac } } - if(This->doc && !This->doc->nscontainer) { + list_remove(&This->entry); + + if(FAILED(hresult)) + return S_OK; + + if(This->doc && This->doc->bscallback == This && !This->doc->nscontainer) { task_t *task = mshtml_alloc(sizeof(task_t)); task->doc = This->doc; @@ -670,6 +680,8 @@ BSCallback *create_bscallback(IMoniker *mon) ret->binding = NULL; ret->doc = NULL; + list_init(&ret->entry); + if(mon) IMoniker_AddRef(mon); ret->mon = mon; @@ -796,12 +808,14 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame, IBindStatusCallback_Release(STATUSCLB(callback)); } -HRESULT start_binding(BSCallback *bscallback) +HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback) { IStream *str = NULL; IBindCtx *bctx; HRESULT hres; + bscallback->doc = doc; + hres = CreateAsyncBindCtx(0, STATUSCLB(bscallback), NULL, &bctx); if(FAILED(hres)) { WARN("CreateAsyncBindCtx failed: %08x\n", hres); @@ -828,6 +842,8 @@ HRESULT start_binding(BSCallback *bscallback) void set_document_bscallback(HTMLDocument *doc, BSCallback *callback) { + BSCallback *iter; + if(doc->bscallback) { if(doc->bscallback->binding) IBinding_Abort(doc->bscallback->binding); @@ -835,6 +851,11 @@ void set_document_bscallback(HTMLDocument *doc, BSCallback *callback) IBindStatusCallback_Release(STATUSCLB(doc->bscallback)); } + LIST_FOR_EACH_ENTRY(iter, &doc->bindings, BSCallback, entry) { + iter->doc = NULL; + list_remove(&iter->entry); + } + doc->bscallback = callback; if(callback) { diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 70da02e..8a4ad25 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -429,7 +429,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva return hres; if(!bind_complete) - return start_binding(This->bscallback); + return start_binding(This, This->bscallback); return S_OK; } diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 5204a89..3a94cbc 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -211,9 +211,10 @@ static void set_progress(HTMLDocument *doc) } } -static void task_start_binding(BSCallback *bscallback) +static void task_start_binding(HTMLDocument *doc, BSCallback *bscallback) { - start_binding(bscallback); + if(doc) + start_binding(doc, bscallback); IBindStatusCallback_Release(STATUSCLB(bscallback)); } @@ -230,7 +231,7 @@ static void process_task(task_t *task) set_progress(task->doc); break; case TASK_START_BINDING: - task_start_binding(task->bscallback); + task_start_binding(task->doc, task->bscallback); break; default: ERR("Wrong task_id %d\n", task->task_id);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixOrthoOffCenterLH.
by Alexandre Julliard
06 Nov '07
06 Nov '07
Module: wine Branch: master Commit: 951ca73ff7c95670530de6f93e703202f4323b2a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=951ca73ff7c95670530de6f93…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 5 19:34:34 2007 +0100 d3dx8: Implement D3DXMatrixOrthoOffCenterLH. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 12 ++++++++++++ dlls/d3dx8/tests/math.c | 8 ++++++++ include/d3dx8math.h | 2 ++ 4 files changed, 23 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 3e6c092..3d69e20 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -45,7 +45,7 @@ @ stdcall D3DXMatrixOrthoRH(ptr long long long long) @ stdcall D3DXMatrixOrthoLH(ptr long long long long) @ stdcall D3DXMatrixOrthoOffCenterRH(ptr long long long long long long) -@ stub D3DXMatrixOrthoOffCenterLH +@ stdcall D3DXMatrixOrthoOffCenterLH(ptr long long long long long long) @ stub D3DXMatrixShadow @ stub D3DXMatrixReflect @ stub D3DXQuaternionToAxisAngle diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 666c05a..1f14d5c 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -126,6 +126,18 @@ D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT z return pout; } +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf) +{ + D3DXMatrixIdentity(pout); + pout->m[0][0] = 2.0f / (r - l); + pout->m[1][1] = 2.0f / (t - b); + pout->m[2][2] = 1.0f / (zf -zn); + pout->m[3][0] = -1.0f -2.0f *l / (r - l); + pout->m[3][1] = 1.0f + 2.0f * t / (b - t); + pout->m[3][2] = zn / (zn -zf); + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf) { D3DXMatrixIdentity(pout); diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 8b2ab5b..c3cef3b 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -230,6 +230,14 @@ static void D3DXMatrixTest(void) D3DXMatrixOrthoLH(&gotmat, 2.5f, 7.4f, -3.2f, -9.8f); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixOrthoOffCenterLH_______________*/ + expectedmat.m[0][0] = 3.636364f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0f; expectedmat.m[1][1] = 0.180180f; expectedmat.m[1][2] = 0.0; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = -0.045662f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = -1.727272f; expectedmat.m[3][1] = -0.567568f; expectedmat.m[3][2] = 0.424658f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixOrthoOffCenterLH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f, 9.3, -12.6); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixOrthoOffCenterRH_______________*/ expectedmat.m[0][0] = 3.636364f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; expectedmat.m[1][0] = 0.0f; expectedmat.m[1][1] = 0.180180f; expectedmat.m[1][2] = 0.0; expectedmat.m[1][3] = 0.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index ecb6cd5..bd1dc4f 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -63,7 +63,9 @@ D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf); D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf); +D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf); D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixOrthoOffCenterRH.
by Alexandre Julliard
06 Nov '07
06 Nov '07
Module: wine Branch: master Commit: 9fc132d02f6185bbecf964df48acbbfbc508aa67 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9fc132d02f6185bbecf964df4…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 5 19:30:49 2007 +0100 d3dx8: Implement D3DXMatrixOrthoOffCenterRH. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 12 ++++++++++++ dlls/d3dx8/tests/math.c | 8 ++++++++ include/d3dx8math.h | 1 + 4 files changed, 22 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index ca5759d..3e6c092 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -44,7 +44,7 @@ @ stdcall D3DXMatrixPerspectiveOffCenterLH(ptr long long long long long long) @ stdcall D3DXMatrixOrthoRH(ptr long long long long) @ stdcall D3DXMatrixOrthoLH(ptr long long long long) -@ stub D3DXMatrixOrthoOffCenterRH +@ stdcall D3DXMatrixOrthoOffCenterRH(ptr long long long long long long) @ stub D3DXMatrixOrthoOffCenterLH @ stub D3DXMatrixShadow @ stub D3DXMatrixReflect diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 7070895..666c05a 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -126,6 +126,18 @@ D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT z return pout; } +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf) +{ + D3DXMatrixIdentity(pout); + pout->m[0][0] = 2.0f / (r - l); + pout->m[1][1] = 2.0f / (t - b); + pout->m[2][2] = 1.0f / (zn -zf); + pout->m[3][0] = -1.0f -2.0f *l / (r - l); + pout->m[3][1] = 1.0f + 2.0f * t / (b - t); + pout->m[3][2] = zn / (zn -zf); + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf) { D3DXMatrixIdentity(pout); diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 1b1048c..8b2ab5b 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -230,6 +230,14 @@ static void D3DXMatrixTest(void) D3DXMatrixOrthoLH(&gotmat, 2.5f, 7.4f, -3.2f, -9.8f); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixOrthoOffCenterRH_______________*/ + expectedmat.m[0][0] = 3.636364f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0f; expectedmat.m[1][1] = 0.180180f; expectedmat.m[1][2] = 0.0; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 0.045662f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = -1.727272f; expectedmat.m[3][1] = -0.567568f; expectedmat.m[3][2] = 0.424658f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixOrthoOffCenterRH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f, 9.3, -12.6); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixOrthoRH_______________*/ expectedmat.m[0][0] = 0.8f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; expectedmat.m[1][0] = 0.0f; expectedmat.m[1][1] = 0.270270f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index f17fd5c..ecb6cd5 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -63,6 +63,7 @@ D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf); D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf); D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
1
0
0
0
David Adam : d3dx8: Uniformize the matrix format in the tests.
by Alexandre Julliard
06 Nov '07
06 Nov '07
Module: wine Branch: master Commit: 2a7d4bd3d2ceebab5dfbe155f5504f78dc791ef5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2a7d4bd3d2ceebab5dfbe155f…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 5 19:27:01 2007 +0100 d3dx8: Uniformize the matrix format in the tests. --- dlls/d3dx8/tests/math.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index f84426d..1b1048c 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -223,14 +223,18 @@ static void D3DXMatrixTest(void) expect_mat(expectedmat,gotmat); /*____________D3DXMatrixOrthoLH_______________*/ - D3DXMatrixIdentity(&expectedmat); - expectedmat.m[0][0] = 0.8f; expectedmat.m[1][1] = 0.270270f; expectedmat.m[2][2] = -0.151515f; expectedmat.m[3][2] = -0.484848f; + expectedmat.m[0][0] = 0.8f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0f; expectedmat.m[1][1] = 0.270270f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = -0.151515f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = -0.484848f; expectedmat.m[3][3] = 1.0f; D3DXMatrixOrthoLH(&gotmat, 2.5f, 7.4f, -3.2f, -9.8f); expect_mat(expectedmat,gotmat); /*____________D3DXMatrixOrthoRH_______________*/ - D3DXMatrixIdentity(&expectedmat); - expectedmat.m[0][0] = 0.8f; expectedmat.m[1][1] = 0.270270f; expectedmat.m[2][2] = 0.151515f; expectedmat.m[3][2] = -0.484848f; + expectedmat.m[0][0] = 0.8f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0f; expectedmat.m[1][1] = 0.270270f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 0.151515f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = -0.484848f; expectedmat.m[3][3] = 1.0f; D3DXMatrixOrthoRH(&gotmat, 2.5f, 7.4f, -3.2f, -9.8f); expect_mat(expectedmat,gotmat);
1
0
0
0
Alex Villacís Lasso : riched20: EM_GETMODIFY should not report modification after WM_SETTEXT ( fixes todo_wine).
by Alexandre Julliard
06 Nov '07
06 Nov '07
Module: wine Branch: master Commit: 5d8b8cd899e65a6b5b165b25caa23261ab72744d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d8b8cd899e65a6b5b165b25c…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Nov 5 11:30:58 2007 -0500 riched20: EM_GETMODIFY should not report modification after WM_SETTEXT (fixes todo_wine). --- dlls/riched20/editor.c | 1 + dlls/riched20/tests/editor.c | 2 -- 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index f626e8f..b1444c0 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1929,6 +1929,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_CommitUndo(editor); ME_EmptyUndoStack(editor); ME_SetSelection(editor, 0, 0); + editor->nModifyStep = 0; ME_UpdateRepaint(editor); return 1; } diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index f5902ed..c5bde6a 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -1546,10 +1546,8 @@ static void test_EM_GETMODIFY(void) SendMessage(hwndRichEdit, EM_SETMODIFY, FALSE, 0); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)TestItem2); result = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); - todo_wine { ok (result == 0, "EM_GETMODIFY returned non-zero for WM_SETTEXT\n"); - } /* clear the text */ SendMessage(hwndRichEdit, EM_SETMODIFY, FALSE, 0);
1
0
0
0
Huw Davies : inetcomm: Add a test for MimeOleCreateVirtualStream.
by Alexandre Julliard
06 Nov '07
06 Nov '07
Module: wine Branch: master Commit: ba6b7e8ba525d82d73f91050f340648d605956f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba6b7e8ba525d82d73f91050f…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Nov 2 15:45:39 2007 +0000 inetcomm: Add a test for MimeOleCreateVirtualStream. --- .gitignore | 4 +++ Makefile.in | 2 + configure | 3 ++ configure.ac | 1 + dlls/Makefile.in | 1 + dlls/inetcomm/tests/Makefile.in | 14 +++++++++++ dlls/inetcomm/tests/mimeole.c | 49 +++++++++++++++++++++++++++++++++++++++ programs/winetest/Makefile.in | 3 ++ programs/winetest/winetest.rc | 1 + 9 files changed, 78 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index c33da3f..b442c45 100644 --- a/.gitignore +++ b/.gitignore @@ -187,6 +187,9 @@ dlls/imm.dll16 dlls/imm32/libimm32.def dlls/imm32/version.res dlls/inetcomm/libinetcomm.def +dlls/inetcomm/tests/*.ok +dlls/inetcomm/tests/inetcomm_crosstest.exe +dlls/inetcomm/tests/testlist.c dlls/infosoft/tests/*.ok dlls/infosoft/tests/infosoft_crosstest.exe dlls/infosoft/tests/testlist.c @@ -719,6 +722,7 @@ programs/winetest/dsound_test.exe programs/winetest/gdi32_test.exe programs/winetest/gdiplus_test.exe programs/winetest/hlink_test.exe +programs/winetest/inetcomm_test.exe programs/winetest/infosoft_test.exe programs/winetest/iphlpapi_test.exe programs/winetest/itss_test.exe diff --git a/Makefile.in b/Makefile.in index 640142a..69120be 100644 --- a/Makefile.in +++ b/Makefile.in @@ -258,6 +258,7 @@ ALL_MAKEFILES = \ dlls/imagehlp/Makefile \ dlls/imm32/Makefile \ dlls/inetcomm/Makefile \ + dlls/inetcomm/tests/Makefile \ dlls/infosoft/Makefile \ dlls/infosoft/tests/Makefile \ dlls/inkobj/Makefile \ @@ -637,6 +638,7 @@ dlls/imaadp32.acm/Makefile: dlls/imaadp32.acm/Makefile.in dlls/Makedll.rules dlls/imagehlp/Makefile: dlls/imagehlp/Makefile.in dlls/Makedll.rules dlls/imm32/Makefile: dlls/imm32/Makefile.in dlls/Makedll.rules dlls/inetcomm/Makefile: dlls/inetcomm/Makefile.in dlls/Makedll.rules +dlls/inetcomm/tests/Makefile: dlls/inetcomm/tests/Makefile.in dlls/Maketest.rules dlls/infosoft/Makefile: dlls/infosoft/Makefile.in dlls/Makedll.rules dlls/infosoft/tests/Makefile: dlls/infosoft/tests/Makefile.in dlls/Maketest.rules dlls/inkobj/Makefile: dlls/inkobj/Makefile.in dlls/Makedll.rules diff --git a/configure b/configure index 8b14068..1fc3fa7 100755 --- a/configure +++ b/configure @@ -20714,6 +20714,8 @@ ac_config_files="$ac_config_files dlls/imm32/Makefile" ac_config_files="$ac_config_files dlls/inetcomm/Makefile" +ac_config_files="$ac_config_files dlls/inetcomm/tests/Makefile" + ac_config_files="$ac_config_files dlls/infosoft/Makefile" ac_config_files="$ac_config_files dlls/infosoft/tests/Makefile" @@ -21908,6 +21910,7 @@ do "dlls/imagehlp/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/imagehlp/Makefile" ;; "dlls/imm32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/imm32/Makefile" ;; "dlls/inetcomm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/inetcomm/Makefile" ;; + "dlls/inetcomm/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/inetcomm/tests/Makefile" ;; "dlls/infosoft/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/infosoft/Makefile" ;; "dlls/infosoft/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/infosoft/tests/Makefile" ;; "dlls/inkobj/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/inkobj/Makefile" ;; diff --git a/configure.ac b/configure.ac index cccb9b6..aa90092 100644 --- a/configure.ac +++ b/configure.ac @@ -1674,6 +1674,7 @@ AC_CONFIG_FILES([dlls/imaadp32.acm/Makefile]) AC_CONFIG_FILES([dlls/imagehlp/Makefile]) AC_CONFIG_FILES([dlls/imm32/Makefile]) AC_CONFIG_FILES([dlls/inetcomm/Makefile]) +AC_CONFIG_FILES([dlls/inetcomm/tests/Makefile]) AC_CONFIG_FILES([dlls/infosoft/Makefile]) AC_CONFIG_FILES([dlls/infosoft/tests/Makefile]) AC_CONFIG_FILES([dlls/inkobj/Makefile]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 932d449..0d2f3e4 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -269,6 +269,7 @@ TESTSUBDIRS = \ gdi32/tests \ gdiplus/tests \ hlink/tests \ + inetcomm/tests \ infosoft/tests \ iphlpapi/tests \ itss/tests \ diff --git a/dlls/inetcomm/tests/Makefile.in b/dlls/inetcomm/tests/Makefile.in new file mode 100644 index 0000000..93e8b3b --- /dev/null +++ b/dlls/inetcomm/tests/Makefile.in @@ -0,0 +1,14 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +TESTDLL = inetcomm.dll +IMPORTS = inetcomm ole32 kernel32 +EXTRALIBS = + +CTESTS = \ + mimeole.c + +@MAKE_TEST_RULES@ + +@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/inetcomm/tests/mimeole.c b/dlls/inetcomm/tests/mimeole.c new file mode 100644 index 0000000..d128193 --- /dev/null +++ b/dlls/inetcomm/tests/mimeole.c @@ -0,0 +1,49 @@ +/* + * MimeOle tests + * + * Copyright 2007 Huw Davies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "windows.h" +#include "ole2.h" +#include "mimeole.h" + +#include <stdio.h> +#include <assert.h> + +#include "wine/test.h" + + +static void test_CreateVirtualStream(void) +{ + HRESULT hr; + IStream *pstm; + + hr = MimeOleCreateVirtualStream(&pstm); + ok(hr == S_OK, "ret %08x\n", hr); + + IStream_Release(pstm); +} + +START_TEST(mimeole) +{ + OleInitialize(NULL); + test_CreateVirtualStream(); + OleUninitialize(); +} diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index 2d4b12b..2cc17d1 100644 --- a/programs/winetest/Makefile.in +++ b/programs/winetest/Makefile.in @@ -42,6 +42,7 @@ TESTBINS = \ gdi32_test.exe \ gdiplus_test.exe \ hlink_test.exe \ + inetcomm_test.exe \ infosoft_test.exe \ iphlpapi_test.exe \ itss_test.exe \ @@ -137,6 +138,8 @@ gdiplus_test.exe: $(DLLDIR)/gdiplus/tests/gdiplus_test.exe$(DLLEXT) cp $(DLLDIR)/gdiplus/tests/gdiplus_test.exe$(DLLEXT) $@ && $(STRIP) $@ hlink_test.exe: $(DLLDIR)/hlink/tests/hlink_test.exe$(DLLEXT) cp $(DLLDIR)/hlink/tests/hlink_test.exe$(DLLEXT) $@ && $(STRIP) $@ +inetcomm_test.exe: $(DLLDIR)/inetcomm/tests/inetcomm_test.exe$(DLLEXT) + cp $(DLLDIR)/inetcomm/tests/inetcomm_test.exe$(DLLEXT) $@ && $(STRIP) $@ infosoft_test.exe: $(DLLDIR)/infosoft/tests/infosoft_test.exe$(DLLEXT) cp $(DLLDIR)/infosoft/tests/infosoft_test.exe$(DLLEXT) $@ && $(STRIP) $@ iphlpapi_test.exe: $(DLLDIR)/iphlpapi/tests/iphlpapi_test.exe$(DLLEXT) diff --git a/programs/winetest/winetest.rc b/programs/winetest/winetest.rc index de1f7e9..58ae062 100644 --- a/programs/winetest/winetest.rc +++ b/programs/winetest/winetest.rc @@ -100,6 +100,7 @@ dsound_test.exe TESTRES "dsound_test.exe" gdi32_test.exe TESTRES "gdi32_test.exe" gdiplus_test.exe TESTRES "gdiplus_test.exe" hlink_test.exe TESTRES "hlink_test.exe" +inetcomm_test.exe TESTRES "inetcomm_test.exe" infosoft_test.exe TESTRES "infosoft_test.exe" iphlpapi_test.exe TESTRES "iphlpapi_test.exe" itss_test.exe TESTRES "itss_test.exe"
1
0
0
0
Alexander Nicolaysen Sørnes : Show login form when login is required
by Chris Morgan
06 Nov '07
06 Nov '07
Module: appdb Branch: master Commit: 734a4f8a1f5380d84939c4e5483c5290fe4d3963 URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=734a4f8a1f5380d84939c4e5…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Mon Nov 5 19:27:17 2007 +0100 Show login form when login is required --- contact.php | 6 ++++-- include/objectManager.php | 11 +++++------ include/util.php | 14 ++++++++++++++ queueditems.php | 5 ++++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/contact.php b/contact.php index 993105f..5bd1bef 100644 --- a/contact.php +++ b/contact.php @@ -12,8 +12,10 @@ $oUser = new User($_SESSION['current']->iUserId); /* Restrict error to logged-in users */ if(!$oUser->isLoggedIn()) - util_show_error_page_and_exit("You need to be <a href=\"".login_url(). - "\">logged in</a>."); +{ + login_form(); + exit; +} $oRecipient = new User($aClean['iRecipientId']); diff --git a/include/objectManager.php b/include/objectManager.php index 02f40e5..6a282f8 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -164,8 +164,9 @@ class ObjectManager if(!$_SESSION['current']->isLoggedIn() && $this->bIsQueue) { $sQueueText = $this->bIsRejected ? "rejected" : "queued"; - echo '<div align="center">You need to <a href="'.login_url().'">'; - echo "log in</a> in order to process $sQueueText entries</div>\n"; + echo '<div align="center">You need to '; + echo "log in in order to process $sQueueText entries</div>\n"; + login_form(false); return; } @@ -934,10 +935,8 @@ class ObjectManager if($oObject->allowAnonymousSubmissions() || $_SESSION['current']->isLoggedIn()) return; - util_show_error_page_and_exit("You need to be <a href=\"".login_url(). - "\">logged in</a>. If you don’t have an ". - "account you can <a href=\"".BASE."account.php?sCmd=new\">register ". - "now</a>, it only takes a few seconds."); + login_form(); + exit; } private function displayMoveChildren($oObject) diff --git a/include/util.php b/include/util.php index 99362ac..4f6f546 100644 --- a/include/util.php +++ b/include/util.php @@ -55,6 +55,20 @@ function values($arr) return $res; } +/* Display a login form */ +function login_form($bShowHeader = true) +{ + global $aClean; + $aClean['sReturnTo'] = urlencode($_SERVER['REQUEST_URI']); + + if($bShowHeader) + apidb_header("Login"); + include(BASE."include/"."form_login.php"); + + if($bShowHeader) + apidb_footer(); +} + // print the month, day, year, hour, minute, second function print_date($sTimestamp) { diff --git a/queueditems.php b/queueditems.php index 4a226bc..373bb18 100644 --- a/queueditems.php +++ b/queueditems.php @@ -11,7 +11,10 @@ require_once(BASE."include/appData.php"); $oUser = new User($_SESSION['current']->iUserId); if(!$oUser->isLoggedIn()) - util_show_error_page_and_exit(); +{ + login_form(); + exit; +} apidb_header("View Your Queued Items");
1
0
0
0
Alexander Nicolaysen Sørnes : objectManager: Support purging rejected entries
by Chris Morgan
06 Nov '07
06 Nov '07
Module: appdb Branch: master Commit: 70e4306e2bfd65b2731fdf7aa82589fa93f1aa0b URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=70e4306e2bfd65b2731fdf7a…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Mon Nov 5 18:38:06 2007 +0100 objectManager: Support purging rejected entries --- include/application.php | 10 +++ include/application_queue.php | 10 +++ include/objectManager.php | 126 +++++++++++++++++++++++++++++++++++++---- include/testData.php | 10 +++ include/testData_queue.php | 10 +++ include/version.php | 10 +++ include/version_queue.php | 10 +++ objectManager.php | 9 +++ 8 files changed, 184 insertions(+), 11 deletions(-) diff --git a/include/application.php b/include/application.php index 9bab415..99b1e22 100644 --- a/include/application.php +++ b/include/application.php @@ -1180,6 +1180,16 @@ class Application { return FALSE; } + function objectAllowPurgingRejected() + { + return TRUE; + } + + public function objectGetSubmitTime() + { + return mysqltimestamp_to_unixtimestamp($this->sSubmitTime); + } + public function objectGetId() { return $this->iAppId; diff --git a/include/application_queue.php b/include/application_queue.php index 93e1171..6fa7123 100644 --- a/include/application_queue.php +++ b/include/application_queue.php @@ -400,6 +400,16 @@ class application_queue return application::allowAnonymousSubmissions(); } + function objectAllowPurgingRejected() + { + return $this->oApp->objectAllowPurgingRejected(); + } + + public function objectGetSubmitTime() + { + return $this->oApp->objectGetSubmitTime(); + } + function objectGetId() { return $this->oApp->objectGetId(); diff --git a/include/objectManager.php b/include/objectManager.php index 9350891..02f40e5 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -220,6 +220,15 @@ class ObjectManager return; } + /* Show a link to the 'purge rejected entries' page if we are an admin */ + if($_SESSION['current']->hasPriv('admin') && $this->getOptionalSetting('objectAllowPurgingRejected', FALSE)) + { + echo '<div align="center">'; + $oM = new objectManager($this->sClass, 'Purge Rejected Entries'); + echo '<a href="'.$oM->makeUrl('purgeRejected').'">Purge rejected entries</a><br /><br />'; + echo '</div>'; + } + /* output the header */ echo '<table width="100%" border="0" cellpadding="3" cellspacing="0">'; @@ -520,8 +529,9 @@ class ObjectManager } } - /* Delete the object associated with the given id */ - public function delete_entry($sReplyText) + /* Delete the object associated with the given id + bStandAlone determines whether this is a stand alone delete operation, where we want to output messages and return */ + public function delete_entry($sReplyText, $bStandAlone = true) { $this->checkMethods(array("delete", "canEdit")); @@ -603,19 +613,25 @@ class ObjectManager if($oSubmitterMail) $oSubmitterMail->send("delete", $sReplyText); - addmsg("Entry deleted", "green"); + if($bStandAlone) + { + addmsg("Entry deleted", "green"); - if($iDeleted) - addmsg("Deleted $iDeleted child entries", "green"); + if($iDeleted) + addmsg("Deleted $iDeleted child entries", "green"); - if($iFailed) - addmsg("Failed to delete $iFailed child entries", "red"); + if($iFailed) + addmsg("Failed to delete $iFailed child entries", "red"); - $this->return_to_url($this->makeUrl("view", false)); - } else - { - addmsg("Failed to delete entry", "red"); + $this->return_to_url($this->makeUrl("view", false)); + } + return TRUE; } + + if($bStandAlone) + addmsg("Failed to delete entry", "red"); + + return FALSE; } /* Return the user to the url specified in the objectManager object. Fall back to a @@ -667,6 +683,94 @@ class ObjectManager } } + /* Purge rejected entries, optionally by date */ + public function purgeRejected($aClean) + { + if(!$_SESSION['current']->hasPriv("admin")) + { + addmsg("Insufficient privileges", "red"); + return FALSE; + } + + if(!$this->getOptionalSetting("objectAllowPurgingRejected", FALSE)) + { + addmsg("Purging rejected entries is not allowed for this object type"); + return FALSE; + } + + $oObject = $this->getObject(); + + $hResult = $oObject->objectGetEntries(true, true); + + if(!$hResult) + { + addmsg("Failed to get list of rejected entries", "red"); + return FALSE; + } + + if($aClean['bTimeLimit'] == 'true') + $iSubmittedBefore = mysqltimestamp_to_unixtimestamp($aClean['sSubmittedBefore']); + else + $iSubmittedBefore = 0; + + $iDeleted = 0; + $iFailed = 0; + + if($sSubmittedBefore) + $sMailWord = "old"; + else + $sMailWord = "all"; + + while($oRow = mysql_fetch_object($hResult)) + { + $oObject = new $this->sClass(null, $oRow); + + if(!$iSubmittedBefore || $oObject->objectGetSubmitTime() < $iSubmittedBefore) + { + $oM = new objectManager($this->sClass, "", $oObject->objectGetId()); + if($oM->delete_entry("Purging $sMailWord rejected entries", false)) + $iDeleted++; + else + $iFailed++; + } + } + + if($iFailed) + addmsg("Failed to delete $iFailed entries", 'red'); + + $sNoun = ($iDeleted == 1) ? 'entry' : 'entries'; + + if($iDeleted) + addmsg("Deleted $iDeleted $sNoun", 'green'); + + $this->return_to_url(APPDB_ROOT); + } + + public function displayPurgeRejected() + { + if(!$_SESSION['current']->hasPriv("admin")) + { + $this->error_exit('Only admins can do this'); + return FALSE; + } + + if(!$this->getOptionalSetting("objectAllowPurgingRejected", FALSE)) + { + $this->error_exit('Purging rejected entries is not allowed for this object type'); + return FALSE; + } + + echo '<form action="objectManager.php" action="post" />'; + echo 'Purge rejected entries of this type<br />'; + echo '<input type="checkbox" value="true" name="bTimeLimit" /> '; + echo 'Only entries submitted before '; + echo '<input type="text" name="sSubmittedBefore" size="25" value="'.date('Y-m-d H:i:s').'" /><br /><br />'; + echo '<input type="hidden" name="sAction" value="doPurgeRejected" />'; + echo $this->makeUrlFormData(); + echo '<input type="submit" value="Purge" />'; + echo '</form>'; + } + /* Move all the object's children to another object of the same type, and delete the original object afterwards */ public function move_children($iNewId) diff --git a/include/testData.php b/include/testData.php index 03bd92d..0605c81 100644 --- a/include/testData.php +++ b/include/testData.php @@ -1213,6 +1213,16 @@ class testData{ return FALSE; } + function objectAllowPurgingRejected() + { + return TRUE; + } + + public function objectGetSubmitTime() + { + return mysqltimestamp_to_unixtimestamp($this->sSubmitTime); + } + function objectGetItemsPerPage($bQueued = false) { $aItemsPerPage = array(25, 50, 100, 200); diff --git a/include/testData_queue.php b/include/testData_queue.php index 190d19e..9e492bc 100644 --- a/include/testData_queue.php +++ b/include/testData_queue.php @@ -173,6 +173,16 @@ class testData_queue return testData::allowAnonymousSubmissions(); } + function objectAllowPurgingRejected() + { + return $this->oTestData->objectAllowPurgingRejected(); + } + + public function objectGetSubmitTime() + { + return $this->oTestData->objectGetSubmitTime(); + } + function objectGetItemsPerPage($bQueued = false) { return testData::objectGetItemsPerPage($bQueued); diff --git a/include/version.php b/include/version.php index 3984a1e..2cfc2df 100644 --- a/include/version.php +++ b/include/version.php @@ -1796,6 +1796,16 @@ class version { return FALSE; } + function objectAllowPurgingRejected() + { + return TRUE; + } + + public function objectGetSubmitTime() + { + return mysqltimestamp_to_unixtimestamp($this->sSubmitTime); + } + public function objectGetId() { return $this->iVersionId; diff --git a/include/version_queue.php b/include/version_queue.php index 4451586..007296a 100644 --- a/include/version_queue.php +++ b/include/version_queue.php @@ -299,6 +299,16 @@ class version_queue return version::allowAnonymousSubmissions(); } + function objectAllowPurgingRejected() + { + return $this->oVersion->objectAllowPurgingRejected(); + } + + public function objectGetSubmitTime() + { + return $this->oVersion->objectGetSubmitTime(); + } + function objectGetId() { return $this->oVersion->objectGetId(); diff --git a/objectManager.php b/objectManager.php index 46894d8..526f291 100644 --- a/objectManager.php +++ b/objectManager.php @@ -95,6 +95,11 @@ if($sAction) if($oObject->getId() && $aClean['iNewId']) $oObject->move_children($aClean['iNewId']); break; + + case 'doPurgeRejected': + /* Purge some or all rejected entries */ + $oObject->purgeRejected($aClean); + break; } } @@ -140,6 +145,10 @@ if($oObject->getId() && $sAction != "add") $oObject->add_entry($aClean, $sErrors); break; + case 'purgeRejected': + $oObject->displayPurgeRejected(); + break; + default: $oObject->display_table($aClean); }
1
0
0
0
Alexander Nicolaysen Sørnes : objectManager: Restructure some form processing code
by Chris Morgan
06 Nov '07
06 Nov '07
Module: appdb Branch: master Commit: 5db7f0f7fb4f6b77715c5bb467193e67e82aa68b URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=5db7f0f7fb4f6b77715c5bb4…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Mon Nov 5 17:41:11 2007 +0100 objectManager: Restructure some form processing code --- objectManager.php | 42 ++++++++++++++++++++++++++++++------------ 1 files changed, 30 insertions(+), 12 deletions(-) diff --git a/objectManager.php b/objectManager.php index 4b74ac2..46894d8 100644 --- a/objectManager.php +++ b/objectManager.php @@ -75,15 +75,28 @@ $oOtherObject = new $sClass($oObject->getId()); on failure */ $sErrors = $oObject->processForm($aClean); -if(isset($aClean['sAction']) && $aClean['sAction'] == "add") - $oObject->handle_anonymous_submission(); - -/* Provided the necessary values are present, an object's children may be moved - without any confirmation */ -if($oObject->getId() && $aClean['sAction'] == "moveChildren" && $aClean['iNewId']) - $oObject->move_children($aClean['iNewId']); +if(array_key_exists("sAction", $aClean)) + $sAction = $aClean['sAction']; +else + $sAction = ""; -$sAction = $aClean['sAction']; +/* Handle things that need to be done before showing any output */ +if($sAction) +{ + switch($aClean['sAction']) + { + case 'add': + $oObject->handle_anonymous_submission(); + break; + + case 'moveChildren': + /* Provided the necessary values are present, an object's children may be moved + without any confirmation */ + if($oObject->getId() && $aClean['iNewId']) + $oObject->move_children($aClean['iNewId']); + break; + } +} /* If no action is specified, use a default depending on other parameters */ if(!$sAction) @@ -119,12 +132,17 @@ if($oObject->getId() && $sAction != "add") $oObject->view($_SERVER['REQUEST_URI'], $aClean); break; } -} else if ($sAction == "add") -{ - $oObject->add_entry($aClean, $sErrors); } else { - $oObject->display_table($aClean); + switch($sAction) + { + case 'add': + $oObject->add_entry($aClean, $sErrors); + break; + + default: + $oObject->display_table($aClean); + } } apidb_footer();
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
76
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
Results per page:
10
25
50
100
200