[Libreoffice-commits] core.git: shell/Executable_senddoc.mk shell/Library_smplmail.mk shell/Module_shell.mk shell/source shell/StaticLibrary_simplemapi.mk solenv/clang-format

Mike Kaganski mike.kaganski at collabora.com
Wed Feb 28 05:00:02 UTC 2018


 shell/Executable_senddoc.mk                     |    4 
 shell/Library_smplmail.mk                       |    4 
 shell/Module_shell.mk                           |    1 
 shell/StaticLibrary_simplemapi.mk               |   16 --
 shell/source/win32/simplemail/senddoc.cxx       |  178 ++++++++++--------------
 shell/source/win32/simplemail/simplemapi.cxx    |   88 -----------
 shell/source/win32/simplemail/simplemapi.hxx    |   69 ---------
 shell/source/win32/simplemail/smplmailsuppl.cxx |    3 
 shell/source/win32/simplemail/smplmailsuppl.hxx |    2 
 solenv/clang-format/blacklist                   |    2 
 10 files changed, 79 insertions(+), 288 deletions(-)

New commits:
commit c2f7759e85f3e5cc9f56aaf03eefa0f1ba834734
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Wed Feb 28 01:37:04 2018 +0300

    Use Unicode for senddoc
    
    Also removes unused code and unnecessary dependencies from it.
    
    Change-Id: Ib6de29358098846ca5e7330b10e67a88cfff8a6a
    Reviewed-on: https://gerrit.libreoffice.org/50444
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/shell/Executable_senddoc.mk b/shell/Executable_senddoc.mk
index aa8f57122636..f51c8441aada 100644
--- a/shell/Executable_senddoc.mk
+++ b/shell/Executable_senddoc.mk
@@ -17,10 +17,6 @@ $(eval $(call gb_Executable_use_libraries,senddoc,\
 	sal \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,senddoc,\
-	simplemapi \
-))
-
 $(eval $(call gb_Executable_add_exception_objects,senddoc,\
     shell/source/win32/simplemail/senddoc \
 ))
diff --git a/shell/Library_smplmail.mk b/shell/Library_smplmail.mk
index a6a82179fd7e..d68f0a65e8ec 100644
--- a/shell/Library_smplmail.mk
+++ b/shell/Library_smplmail.mk
@@ -21,10 +21,6 @@ $(eval $(call gb_Library_use_libraries,smplmail,\
 	sal \
 ))
 
-$(eval $(call gb_Library_use_static_libraries,smplmail,\
-	simplemapi \
-))
-
 $(eval $(call gb_Library_set_componentfile,smplmail,shell/source/win32/simplemail/smplmail))
 
 $(eval $(call gb_Library_add_exception_objects,smplmail,\
diff --git a/shell/Module_shell.mk b/shell/Module_shell.mk
index 5da2416b6662..6d54617f0268 100644
--- a/shell/Module_shell.mk
+++ b/shell/Module_shell.mk
@@ -49,7 +49,6 @@ $(eval $(call gb_Module_add_targets,shell,\
 	Executable_senddoc \
 	Library_smplmail \
 	Library_wininetbe \
-	StaticLibrary_simplemapi \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/shell/StaticLibrary_simplemapi.mk b/shell/StaticLibrary_simplemapi.mk
deleted file mode 100644
index 15012449f146..000000000000
--- a/shell/StaticLibrary_simplemapi.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_StaticLibrary_StaticLibrary,simplemapi))
-
-$(eval $(call gb_StaticLibrary_add_exception_objects,simplemapi,\
-    shell/source/win32/simplemail/simplemapi \
-))
-
-# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx
index f0dfe8f547ea..f3fe6112b4eb 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -19,34 +19,36 @@
 
 #include <osl/diagnose.h>
 #include <sal/macros.h>
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
-#include <rtl/uri.hxx>
-#include <osl/thread.hxx>
 
-#include "simplemapi.hxx"
+#include <wchar.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mapi.h>
+#include <MapiUnicodeHelp.h>
 
-#include <iostream>
+#include <string>
 #include <vector>
+#if OSL_DEBUG_LEVEL > 0
 #include <sstream>
+#endif
 #include <stdexcept>
 
 #if OSL_DEBUG_LEVEL > 0
     void dumpParameter();
 #endif
 
-typedef std::vector<std::string> StringList_t;
+typedef std::vector<std::wstring> StringList_t;
 typedef StringList_t::const_iterator StringListIterator_t;
-typedef std::vector<MapiRecipDesc> MapiRecipientList_t;
-typedef std::vector<MapiFileDesc> MapiAttachmentList_t;
+typedef std::vector<MapiRecipDescW> MapiRecipientList_t;
+typedef std::vector<MapiFileDescW> MapiAttachmentList_t;
 
 const int LEN_SMTP_PREFIX = 5; // "SMTP:"
 
 namespace /* private */
 {
-    std::string gFrom;
-    std::string gSubject;
-    std::string gBody;
+    std::wstring gFrom;
+    std::wstring gSubject;
+    std::wstring gBody;
     StringList_t gTo;
     StringList_t gCc;
     StringList_t gBcc;
@@ -67,9 +69,9 @@ namespace /* private */
     @returns
     the email address prefixed with the specified prefix.
 */
-inline std::string prefixEmailAddress(
-    const std::string& aEmailAddress,
-    const std::string& aPrefix = "SMTP:")
+inline std::wstring prefixEmailAddress(
+    const std::wstring& aEmailAddress,
+    const std::wstring& aPrefix = L"SMTP:")
 {
     return (aPrefix + aEmailAddress);
 }
@@ -77,15 +79,15 @@ inline std::string prefixEmailAddress(
 /** @internal */
 void addRecipient(
     ULONG recipClass,
-    const std::string& recipAddress,
+    const std::wstring& recipAddress,
     MapiRecipientList_t* pMapiRecipientList)
 {
-    MapiRecipDesc mrd;
+    MapiRecipDescW mrd;
     ZeroMemory(&mrd, sizeof(mrd));
 
     mrd.ulRecipClass = recipClass;
-    mrd.lpszName = const_cast<char*>(recipAddress.c_str()) + LEN_SMTP_PREFIX;
-    mrd.lpszAddress = const_cast<char*>(recipAddress.c_str());
+    mrd.lpszName = const_cast<wchar_t*>(recipAddress.c_str()) + LEN_SMTP_PREFIX;
+    mrd.lpszAddress = const_cast<wchar_t*>(recipAddress.c_str());
     pMapiRecipientList->push_back(mrd);
 }
 
@@ -95,22 +97,16 @@ void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
     OSL_ASSERT(pMapiRecipientList->empty());
 
     // add to recipients
-    StringListIterator_t iter = gTo.begin();
-    StringListIterator_t iter_end = gTo.end();
-    for (; iter != iter_end; ++iter)
-        addRecipient(MAPI_TO, *iter, pMapiRecipientList);
+    for (const auto& address : gTo)
+        addRecipient(MAPI_TO, address, pMapiRecipientList);
 
     // add cc recipients
-    iter = gCc.begin();
-    iter_end = gCc.end();
-    for (; iter != iter_end; ++iter)
-        addRecipient(MAPI_CC, *iter, pMapiRecipientList);
+    for (const auto& address : gCc)
+        addRecipient(MAPI_CC, address, pMapiRecipientList);
 
     // add bcc recipients
-    iter = gBcc.begin();
-    iter_end = gBcc.end();
-    for (; iter != iter_end; ++iter)
-        addRecipient(MAPI_BCC, *iter, pMapiRecipientList);
+    for (const auto& address : gBcc)
+        addRecipient(MAPI_BCC, address, pMapiRecipientList);
 }
 
 /** @internal */
@@ -118,49 +114,37 @@ void initAttachmentList(MapiAttachmentList_t* pMapiAttachmentList)
 {
     OSL_ASSERT(pMapiAttachmentList->empty());
 
-    StringListIterator_t iter = gAttachments.begin();
-    StringListIterator_t iter_end = gAttachments.end();
-    for (/**/; iter != iter_end; ++iter)
+    for (const auto& attachment : gAttachments)
     {
-        MapiFileDesc mfd;
+        MapiFileDescW mfd;
         ZeroMemory(&mfd, sizeof(mfd));
-        mfd.lpszPathName = const_cast<char*>(iter->c_str());
+        mfd.lpszPathName = const_cast<wchar_t*>(attachment.c_str());
         mfd.nPosition = sal::static_int_cast<ULONG>(-1);
         pMapiAttachmentList->push_back(mfd);
     }
 }
 
 /** @internal */
-void initMapiOriginator(MapiRecipDesc* pMapiOriginator)
+void initMapiOriginator(MapiRecipDescW* pMapiOriginator)
 {
-    ZeroMemory(pMapiOriginator, sizeof(MapiRecipDesc));
+    ZeroMemory(pMapiOriginator, sizeof(*pMapiOriginator));
 
     pMapiOriginator->ulRecipClass = MAPI_ORIG;
-    pMapiOriginator->lpszName = const_cast<char*>("");
-    pMapiOriginator->lpszAddress = const_cast<char*>(gFrom.c_str());
+    pMapiOriginator->lpszName = const_cast<wchar_t*>(L"");
+    pMapiOriginator->lpszAddress = const_cast<wchar_t*>(gFrom.c_str());
 }
 
 /** @internal */
 void initMapiMessage(
-    MapiRecipDesc* aMapiOriginator,
+    MapiRecipDescW* aMapiOriginator,
     MapiRecipientList_t& aMapiRecipientList,
     MapiAttachmentList_t& aMapiAttachmentList,
-    MapiMessage* pMapiMessage)
+    MapiMessageW* pMapiMessage)
 {
-    ZeroMemory(pMapiMessage, sizeof(MapiMessage));
-
-    try {
-         rtl_uString *subject = nullptr;
-         rtl_uString_newFromAscii(&subject, gSubject.c_str());
-         rtl_uString *decoded_subject = nullptr;
-         rtl_uriDecode(subject, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8, &decoded_subject);
-         OUString ou_subject(decoded_subject);
-         pMapiMessage->lpszSubject = strdup(OUStringToOString(ou_subject, osl_getThreadTextEncoding(), RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK).getStr());
-    }
-    catch (...) {
-    pMapiMessage->lpszSubject = const_cast<char*>(gSubject.c_str());
-    }
-    pMapiMessage->lpszNoteText = (gBody.length() ? const_cast<char*>(gBody.c_str()) : nullptr);
+    ZeroMemory(pMapiMessage, sizeof(*pMapiMessage));
+
+    pMapiMessage->lpszSubject = const_cast<wchar_t*>(gSubject.c_str());
+    pMapiMessage->lpszNoteText = (gBody.length() ? const_cast<wchar_t*>(gBody.c_str()) : nullptr);
     pMapiMessage->lpOriginator = aMapiOriginator;
     pMapiMessage->lpRecips = aMapiRecipientList.size() ? &aMapiRecipientList[0] : nullptr;
     pMapiMessage->nRecipCount = aMapiRecipientList.size();
@@ -168,33 +152,33 @@ void initMapiMessage(
     pMapiMessage->nFileCount = aMapiAttachmentList.size();
 }
 
-const char* const KnownParameter[] =
+const wchar_t* const KnownParameter[] =
 {
-    "--to",
-    "--cc",
-    "--bcc",
-    "--from",
-    "--subject",
-    "--body",
-    "--attach",
-    "--mapi-dialog",
-    "--mapi-logon-ui"
+    L"--to",
+    L"--cc",
+    L"--bcc",
+    L"--from",
+    L"--subject",
+    L"--body",
+    L"--attach",
+    L"--mapi-dialog",
+    L"--mapi-logon-ui"
 };
 
 const size_t nKnownParameter = SAL_N_ELEMENTS(KnownParameter);
 
 /** @internal */
-bool isKnownParameter(const char* aParameterName)
+bool isKnownParameter(const wchar_t* aParameterName)
 {
     for (size_t i = 0; i < nKnownParameter; i++)
-        if (_stricmp(aParameterName, KnownParameter[i]) == 0)
+        if (_wcsicmp(aParameterName, KnownParameter[i]) == 0)
             return true;
 
     return false;
 }
 
 /** @internal */
-void initParameter(int argc, char* argv[])
+void initParameter(int argc, wchar_t* argv[])
 {
     for (int i = 1; i < argc; i++)
     {
@@ -204,29 +188,29 @@ void initParameter(int argc, char* argv[])
             continue;
         }
 
-        if (_stricmp(argv[i], "--mapi-dialog") == 0)
+        if (_wcsicmp(argv[i], L"--mapi-dialog") == 0)
         {
             gMapiFlags |= MAPI_DIALOG;
         }
-        else if (_stricmp(argv[i], "--mapi-logon-ui") == 0)
+        else if (_wcsicmp(argv[i], L"--mapi-logon-ui") == 0)
         {
             gMapiFlags |= MAPI_LOGON_UI;
         }
         else if ((i+1) < argc) // is the value of a parameter available too?
         {
-            if (_stricmp(argv[i], "--to") == 0)
+            if (_wcsicmp(argv[i], L"--to") == 0)
                 gTo.push_back(prefixEmailAddress(argv[i+1]));
-            else if (_stricmp(argv[i], "--cc") == 0)
+            else if (_wcsicmp(argv[i], L"--cc") == 0)
                 gCc.push_back(prefixEmailAddress(argv[i+1]));
-            else if (_stricmp(argv[i], "--bcc") == 0)
+            else if (_wcsicmp(argv[i], L"--bcc") == 0)
                 gBcc.push_back(prefixEmailAddress(argv[i+1]));
-            else if (_stricmp(argv[i], "--from") == 0)
+            else if (_wcsicmp(argv[i], L"--from") == 0)
                 gFrom = prefixEmailAddress(argv[i+1]);
-            else if (_stricmp(argv[i], "--subject") == 0)
+            else if (_wcsicmp(argv[i], L"--subject") == 0)
                 gSubject = argv[i+1];
-            else if (_stricmp(argv[i], "--body") == 0)
+            else if (_wcsicmp(argv[i], L"--body") == 0)
                 gBody = argv[i+1];
-            else if (_stricmp(argv[i], "--attach") == 0)
+            else if (_wcsicmp(argv[i], L"--attach") == 0)
                 gAttachments.push_back(argv[i+1]);
 
             i++;
@@ -241,7 +225,7 @@ void initParameter(int argc, char* argv[])
     parameter checking is very limited. Every unknown parameter
     will be ignored.
 */
-int main(int argc, char* argv[])
+int wmain(int argc, wchar_t* argv[])
 {
 
     initParameter(argc, argv);
@@ -254,8 +238,6 @@ int main(int argc, char* argv[])
 
     try
     {
-        CSimpleMapi mapi;
-
         // we have to set the flag MAPI_NEW_SESSION,
         // because in the case Outlook xxx (not Outlook Express!)
         // is installed as Exchange and Mail Client a Profile
@@ -264,17 +246,17 @@ int main(int argc, char* argv[])
 
         LHANDLE const hSession = 0;
 
-        MapiRecipDesc mapiOriginator;
+        MapiRecipDescW mapiOriginator;
         MapiRecipientList_t mapiRecipientList;
         MapiAttachmentList_t mapiAttachmentList;
-        MapiMessage mapiMsg;
+        MapiMessageW mapiMsg;
 
         initMapiOriginator(&mapiOriginator);
         initRecipientList(&mapiRecipientList);
         initAttachmentList(&mapiAttachmentList);
         initMapiMessage((gFrom.length() ? &mapiOriginator : nullptr), mapiRecipientList, mapiAttachmentList, &mapiMsg);
 
-        ulRet = mapi.MAPISendMail(hSession, 0, &mapiMsg, gMapiFlags, 0);
+        ulRet = MAPISendMailHelper(hSession, 0, &mapiMsg, gMapiFlags, 0);
 
         // There is no point in treating an aborted mail sending
         // dialog as an error to be returned as our exit
@@ -301,7 +283,7 @@ int main(int argc, char* argv[])
 #if OSL_DEBUG_LEVEL > 0
     void dumpParameter()
     {
-        std::ostringstream oss;
+        std::wostringstream oss;
 
         if (gFrom.length() > 0)
             oss << "--from " << gFrom << std::endl;
@@ -312,25 +294,17 @@ int main(int argc, char* argv[])
         if (gBody.length() > 0)
             oss << "--body " << gBody << std::endl;
 
-        StringListIterator_t iter = gTo.begin();
-        StringListIterator_t iter_end = gTo.end();
-        for (/**/;iter != iter_end; ++iter)
-            oss << "--to " << *iter << std::endl;
+        for (const auto& address : gTo)
+            oss << "--to " << address << std::endl;
 
-        iter = gCc.begin();
-        iter_end = gCc.end();
-        for (/**/;iter != iter_end; ++iter)
-            oss << "--cc " << *iter << std::endl;
+        for (const auto& address : gCc)
+            oss << "--cc " << address << std::endl;
 
-        iter = gBcc.begin();
-        iter_end = gBcc.end();
-        for (/**/;iter != iter_end; ++iter)
-            oss << "--bcc " << *iter << std::endl;
+        for (const auto& address : gBcc)
+            oss << "--bcc " << address << std::endl;
 
-        iter = gAttachments.begin();
-        iter_end = gAttachments.end();
-        for (/**/;iter != iter_end; ++iter)
-            oss << "--attach " << *iter << std::endl;
+        for (const auto& attachment : gAttachments)
+            oss << "--attach " << attachment << std::endl;
 
         if (gMapiFlags & MAPI_DIALOG)
             oss << "--mapi-dialog" << std::endl;
@@ -338,7 +312,7 @@ int main(int argc, char* argv[])
         if (gMapiFlags & MAPI_LOGON_UI)
             oss << "--mapi-logon-ui" << std::endl;
 
-        MessageBoxA(nullptr, oss.str().c_str(), "Arguments", MB_OK | MB_ICONINFORMATION);
+        MessageBoxW(nullptr, oss.str().c_str(), L"Arguments", MB_OK | MB_ICONINFORMATION);
     }
 #endif
 
diff --git a/shell/source/win32/simplemail/simplemapi.cxx b/shell/source/win32/simplemail/simplemapi.cxx
deleted file mode 100644
index e7680048c220..000000000000
--- a/shell/source/win32/simplemail/simplemapi.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "simplemapi.hxx"
-
-#include <string>
-#include <stdexcept>
-
-CSimpleMapi::CSimpleMapi() :
-    m_lpfnMapiLogon(nullptr),
-    m_lpfnMapiLogoff(nullptr),
-    m_lpfnMapiSendMail(nullptr)
-{
-    m_hMapiDll = LoadLibraryW(L"mapi32.dll");
-    if ((m_hMapiDll == INVALID_HANDLE_VALUE) || (m_hMapiDll == nullptr))
-        throw std::runtime_error("Couldn't load MAPI library");
-
-    m_lpfnMapiLogon = reinterpret_cast<LPMAPILOGON>(GetProcAddress(m_hMapiDll, "MAPILogon"));
-    if (!m_lpfnMapiLogon)
-        throw std::runtime_error("Couldn't find method MAPILogon");
-
-    m_lpfnMapiLogoff = reinterpret_cast<LPMAPILOGOFF>(GetProcAddress(m_hMapiDll, "MAPILogoff"));
-    if (!m_lpfnMapiLogoff)
-        throw std::runtime_error("Couldn't find method MAPILogoff");
-
-    m_lpfnMapiSendMail = reinterpret_cast<LPMAPISENDMAIL>(GetProcAddress(m_hMapiDll, "MAPISendMail"));
-    if (!m_lpfnMapiSendMail)
-        throw std::runtime_error("Couldn't find method MAPISendMail");
-}
-
-CSimpleMapi::~CSimpleMapi()
-{
-    FreeLibrary(m_hMapiDll);
-}
-
-ULONG CSimpleMapi::MAPILogon(
-    ULONG ulUIParam,
-    LPSTR lpszProfileName,
-    LPSTR lpszPassword,
-    FLAGS flFlags,
-    ULONG ulReserved,
-    LPLHANDLE lplhSession )
-{
-    return m_lpfnMapiLogon(
-        ulUIParam,
-        lpszProfileName,
-        lpszPassword,
-        flFlags,
-        ulReserved,
-        lplhSession );
-}
-
-ULONG CSimpleMapi::MAPILogoff(
-    LHANDLE lhSession,
-    ULONG ulUIParam,
-    FLAGS flFlags,
-    ULONG ulReserved )
-{
-    return m_lpfnMapiLogoff(lhSession, ulUIParam, flFlags, ulReserved);
-}
-
-ULONG CSimpleMapi::MAPISendMail(
-    LHANDLE lhSession,
-    ULONG ulUIParam,
-    lpMapiMessage lpMessage,
-    FLAGS flFlags,
-    ULONG ulReserved )
-{
-    return m_lpfnMapiSendMail(lhSession, ulUIParam, lpMessage, flFlags, ulReserved);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/simplemail/simplemapi.hxx b/shell/source/win32/simplemail/simplemapi.hxx
deleted file mode 100644
index a9bf054557c3..000000000000
--- a/shell/source/win32/simplemail/simplemapi.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SHELL_SOURCE_WIN32_SIMPLEMAIL_SIMPLEMAPI_HXX
-#define INCLUDED_SHELL_SOURCE_WIN32_SIMPLEMAIL_SIMPLEMAPI_HXX
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mapi.h>
-
-class CSimpleMapi
-{
-public:
-    /**
-        @throws std::runtime_error
-        if either the mapi32.dll could not be loaded at all
-        or necessary function exports are missing
-    */
-    CSimpleMapi(); // throws std::runtime_error;
-
-    ~CSimpleMapi();
-
-    ULONG MAPILogon(
-        ULONG ulUIParam,
-        LPSTR lpszProfileName,
-        LPSTR lpszPassword,
-        FLAGS flFlags,
-        ULONG ulReserved,
-        LPLHANDLE lplhSession );
-
-    ULONG MAPILogoff(
-        LHANDLE lhSession,
-        ULONG ulUIParam,
-        FLAGS flFlags,
-        ULONG ulReserved );
-
-    ULONG MAPISendMail(
-        LHANDLE lhSession,
-        ULONG ulUIParam,
-        lpMapiMessage lpMessage,
-        FLAGS flFlags,
-        ULONG ulReserved );
-
-private:
-    HMODULE         m_hMapiDll;
-    LPMAPILOGON     m_lpfnMapiLogon;
-    LPMAPILOGOFF    m_lpfnMapiLogoff;
-    LPMAPISENDMAIL  m_lpfnMapiSendMail;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/simplemail/smplmailsuppl.cxx b/shell/source/win32/simplemail/smplmailsuppl.cxx
index 4e8aecc92a3d..4af43f4a06cc 100644
--- a/shell/source/win32/simplemail/smplmailsuppl.cxx
+++ b/shell/source/win32/simplemail/smplmailsuppl.cxx
@@ -21,6 +21,9 @@
 #include "smplmailsuppl.hxx"
 #include "smplmailclient.hxx"
 
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
 using com::sun::star::uno::Reference;
 using com::sun::star::uno::RuntimeException;
 using com::sun::star::uno::Sequence;
diff --git a/shell/source/win32/simplemail/smplmailsuppl.hxx b/shell/source/win32/simplemail/smplmailsuppl.hxx
index 9c5496065d3c..3c7fbe0f2059 100644
--- a/shell/source/win32/simplemail/smplmailsuppl.hxx
+++ b/shell/source/win32/simplemail/smplmailsuppl.hxx
@@ -25,8 +25,6 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/system/XSimpleMailClientSupplier.hpp>
 
-#include "simplemapi.hxx"
-
 
 class CSmplMailSupplBase
 {
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 3dcc621bea71..9ab96f7e1473 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -13224,8 +13224,6 @@ shell/source/win32/shlxthandler/util/iso8601_converter.cxx
 shell/source/win32/shlxthandler/util/registry.cxx
 shell/source/win32/shlxthandler/util/utilities.cxx
 shell/source/win32/simplemail/senddoc.cxx
-shell/source/win32/simplemail/simplemapi.cxx
-shell/source/win32/simplemail/simplemapi.hxx
 shell/source/win32/simplemail/smplmailclient.cxx
 shell/source/win32/simplemail/smplmailclient.hxx
 shell/source/win32/simplemail/smplmailentry.cxx


More information about the Libreoffice-commits mailing list