Kaydet (Commit) c2f7759e authored tarafından Mike Kaganski's avatar Mike Kaganski

Use Unicode for senddoc

Also removes unused code and unnecessary dependencies from it.

Change-Id: Ib6de29358098846ca5e7330b10e67a88cfff8a6a
Reviewed-on: https://gerrit.libreoffice.org/50444Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst d5837fcf
...@@ -17,10 +17,6 @@ $(eval $(call gb_Executable_use_libraries,senddoc,\ ...@@ -17,10 +17,6 @@ $(eval $(call gb_Executable_use_libraries,senddoc,\
sal \ sal \
)) ))
$(eval $(call gb_Executable_use_static_libraries,senddoc,\
simplemapi \
))
$(eval $(call gb_Executable_add_exception_objects,senddoc,\ $(eval $(call gb_Executable_add_exception_objects,senddoc,\
shell/source/win32/simplemail/senddoc \ shell/source/win32/simplemail/senddoc \
)) ))
......
...@@ -21,10 +21,6 @@ $(eval $(call gb_Library_use_libraries,smplmail,\ ...@@ -21,10 +21,6 @@ $(eval $(call gb_Library_use_libraries,smplmail,\
sal \ 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_set_componentfile,smplmail,shell/source/win32/simplemail/smplmail))
$(eval $(call gb_Library_add_exception_objects,smplmail,\ $(eval $(call gb_Library_add_exception_objects,smplmail,\
......
...@@ -49,7 +49,6 @@ $(eval $(call gb_Module_add_targets,shell,\ ...@@ -49,7 +49,6 @@ $(eval $(call gb_Module_add_targets,shell,\
Executable_senddoc \ Executable_senddoc \
Library_smplmail \ Library_smplmail \
Library_wininetbe \ Library_wininetbe \
StaticLibrary_simplemapi \
)) ))
ifeq ($(COM),MSC) ifeq ($(COM),MSC)
......
# -*- 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:
/* -*- 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: */
/* -*- 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: */
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
#include "smplmailsuppl.hxx" #include "smplmailsuppl.hxx"
#include "smplmailclient.hxx" #include "smplmailclient.hxx"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
using com::sun::star::uno::Reference; using com::sun::star::uno::Reference;
using com::sun::star::uno::RuntimeException; using com::sun::star::uno::RuntimeException;
using com::sun::star::uno::Sequence; using com::sun::star::uno::Sequence;
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/system/XSimpleMailClientSupplier.hpp> #include <com/sun/star/system/XSimpleMailClientSupplier.hpp>
#include "simplemapi.hxx"
class CSmplMailSupplBase class CSmplMailSupplBase
{ {
......
...@@ -13224,8 +13224,6 @@ shell/source/win32/shlxthandler/util/iso8601_converter.cxx ...@@ -13224,8 +13224,6 @@ shell/source/win32/shlxthandler/util/iso8601_converter.cxx
shell/source/win32/shlxthandler/util/registry.cxx shell/source/win32/shlxthandler/util/registry.cxx
shell/source/win32/shlxthandler/util/utilities.cxx shell/source/win32/shlxthandler/util/utilities.cxx
shell/source/win32/simplemail/senddoc.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.cxx
shell/source/win32/simplemail/smplmailclient.hxx shell/source/win32/simplemail/smplmailclient.hxx
shell/source/win32/simplemail/smplmailentry.cxx shell/source/win32/simplemail/smplmailentry.cxx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment