From 7ce1e0e1ecbb1b3ec5e3cc15306a9df7e786c564 Mon Sep 17 00:00:00 2001 From: Aron Budea Date: Mon, 22 Dec 2014 06:23:46 +0100 Subject: fdo#43368 Remove MapiLogon/Logoff calls so simplemail works with WLM Signed-off-by: Michael Stahl Conflicts: shell/source/win32/simplemail/senddoc.cxx Change-Id: I31cac063ffb4afbfde068558ebcf5f66ea34d1a8 --- shell/source/win32/simplemail/senddoc.cxx | 49 ++++++++++++++----------------- 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'shell/source/win32/simplemail/senddoc.cxx') diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx index 37c5377103b9..10a0775ce6ab 100644 --- a/shell/source/win32/simplemail/senddoc.cxx +++ b/shell/source/win32/simplemail/senddoc.cxx @@ -263,40 +263,35 @@ int main(int argc, char* argv[]) // is installed as Exchange and Mail Client a Profile // selection dialog must appear because we specify no // profile name, so the user has to specify a profile - FLAGS flFlag = MAPI_NEW_SESSION | MAPI_LOGON_UI; - LHANDLE hSession; - ulRet = mapi.MAPILogon(0, NULL, NULL, flFlag, 0L, &hSession); - if (ulRet == SUCCESS_SUCCESS) - { - MapiRecipDesc mapiOriginator; - MapiRecipientList_t mapiRecipientList; - MapiAttachmentList_t mapiAttachmentList; - MapiMessage mapiMsg; + LHANDLE hSession = 0; - initMapiOriginator(&mapiOriginator); - initRecipientList(&mapiRecipientList); - initAttachmentList(&mapiAttachmentList); - initMapiMessage((gFrom.length() ? &mapiOriginator : NULL), mapiRecipientList, mapiAttachmentList, &mapiMsg); + MapiRecipDesc mapiOriginator; + MapiRecipientList_t mapiRecipientList; + MapiAttachmentList_t mapiAttachmentList; + MapiMessage mapiMsg; - ulRet = mapi.MAPISendMail(hSession, 0, &mapiMsg, gMapiFlags, 0); + initMapiOriginator(&mapiOriginator); + initRecipientList(&mapiRecipientList); + initAttachmentList(&mapiAttachmentList); + initMapiMessage((gFrom.length() ? &mapiOriginator : NULL), mapiRecipientList, mapiAttachmentList, &mapiMsg); - // There is no point in treating an aborted mail sending - // dialog as an error to be returned as our exit - // status. If the user decided to abort sending a document - // as mail, OK, that is not an error. + ulRet = mapi.MAPISendMail(hSession, 0, &mapiMsg, gMapiFlags, 0); - // Also, it seems that GroupWise makes MAPISendMail() - // return MAPI_E_USER_ABORT even if the mail sending - // dialog was not aborted by the user, and the mail was - // actually sent just fine. See bnc#660241 (visible to - // Novell people only, sorry). + // There is no point in treating an aborted mail sending + // dialog as an error to be returned as our exit + // status. If the user decided to abort sending a document + // as mail, OK, that is not an error. - if (ulRet == MAPI_E_USER_ABORT) - ulRet = SUCCESS_SUCCESS; + // Also, it seems that GroupWise makes MAPISendMail() + // return MAPI_E_USER_ABORT even if the mail sending + // dialog was not aborted by the user, and the mail was + // actually sent just fine. See bnc#660241 (visible to + // Novell people only, sorry). + + if (ulRet == MAPI_E_USER_ABORT) + ulRet = SUCCESS_SUCCESS; - mapi.MAPILogoff(hSession, 0, 0, 0); - } } catch (const std::runtime_error& #if OSL_DEBUG_LEVEL > 0 -- cgit