On Wednesday 18 March 2009 08:57:41 pm Brad Hards wrote:
> 3. Tell the user not to call FreeBookmark for SetCollapseState. If they do,
> its their error.
I changed SetCollapseState() to not return the bookmark, since there seems
to be no effective use for it.
Proposed patch.
OK to commit?
Brad
Index: libmapi/IMAPITable.c
===================================================================
--- libmapi/IMAPITable.c (revision 1292)
+++ libmapi/IMAPITable.c (working copy)
@@ -1741,13 +1741,7 @@
\param obj_table the table we are restoring the state for
\param CollapseState the Collapse State to restore
- \param lpbkPosition pointer to the bookmark value. This bookmark
- can be passed in a call to the SeekRowBookmark method
- You obtain the row number and row instance number arguments from
- the PR_INST_ID and PR_INST_NUM properties of the row you want to
- use as the cursor.
-
\return MAPI_E_SUCCESS on success, otherwise MAPI error.
\note Developers may also call GetLastError() to retrieve the last
@@ -1760,8 +1754,7 @@
\sa GetCollapseState
*/
_PUBLIC_ enum MAPISTATUS SetCollapseState(mapi_object_t *obj_table,
- struct SBinary_short *CollapseState,
- uint32_t *lpbkPosition)
+ struct SBinary_short *CollapseState)
{
struct mapi_request *mapi_request;
struct mapi_response *mapi_response;
@@ -1774,7 +1767,6 @@
uint32_t size;
TALLOC_CTX *mem_ctx;
mapi_object_table_t *mapi_table;
- mapi_object_bookmark_t *bookmark;
/* Sanity checks */
OPENCHANGE_RETVAL_IF(!global_mapi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
@@ -1821,18 +1813,6 @@
mapi_table = (mapi_object_table_t *)obj_table->private_data;
OPENCHANGE_RETVAL_IF(!mapi_table, MAPI_E_INVALID_PARAMETER, mem_ctx);
- /* Store the bookmark in the mapi_object_table private_data */
- bookmark = talloc_zero((TALLOC_CTX *)mapi_table->bookmark,
mapi_object_bookmark_t);
- mapi_table->bk_last++;
- bookmark->index = mapi_table->bk_last;
- bookmark->bin.cb = reply->bookmark.cb;
- bookmark->bin.lpb = talloc_array((TALLOC_CTX *)bookmark, uint8_t,
reply->bookmark.cb);
- memcpy(bookmark->bin.lpb, reply->bookmark.lpb, reply->bookmark.cb);
-
- DLIST_ADD(mapi_table->bookmark, bookmark);
-
- *lpbkPosition = mapi_table->bk_last;
-
obj_table->private_data = mapi_table;
talloc_free(mapi_response);
Index: utils/mapitest/modules/module_oxctable.c
===================================================================
--- utils/mapitest/modules/module_oxctable.c (revision 1292)
+++ utils/mapitest/modules/module_oxctable.c (working copy)
@@ -733,9 +733,7 @@
uint32_t Numerator = 0;
uint32_t Denominator = 0;
struct SBinary_short collapseState;
- uint32_t bookmark;
-
/* Step 1. Logon */
if (! mapitest_common_setup(mt, &obj_htable, &count)) {
return false;
@@ -870,7 +868,7 @@
}
/* Restore the collapse state */
- SetCollapseState(&(obj_test_folder), &collapseState, &bookmark);
+ SetCollapseState(&(obj_test_folder), &collapseState);
mapitest_print_retval(mt, "SetCollapseState");
if (GetLastError() != MAPI_E_SUCCESS) {
ret = false;
@@ -892,14 +890,6 @@
}
cleanup:
- if (bookmark) {
- FreeBookmark(&(obj_test_folder), bookmark);
- mapitest_print_retval(mt, "FreeBookmark");
- if (GetLastError() != MAPI_E_SUCCESS) {
- ret = false;
- }
- }
-
/* Release */
mapi_object_release(&obj_htable);
mapi_object_release(&(obj_test_folder));
_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel