summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-24 15:41:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-24 17:22:05 +0200
commit928b1b04adc1cd49cc5d00069084e03675a320f3 (patch)
tree8710687a4a66a628bd12c5482d7d93cc27f8996a /shell
parentec709a8d5e808b970a8930a389c0a5a6f61fe8c7 (diff)
loplugin:external (clang-cl)
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/backends/localebe/localebackend.cxx2
-rw-r--r--shell/source/tools/regsvrex/regsvrex.cxx2
-rw-r--r--shell/source/win32/ooofilereader/metainforeader.cxx2
-rw-r--r--shell/source/win32/shlxthandler/infotips/infotips.cxx8
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx4
-rw-r--r--shell/source/win32/shlxthandler/shlxthdl.cxx1
-rw-r--r--shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx6
-rw-r--r--shell/source/win32/simplemail/senddoc.cxx20
-rw-r--r--shell/source/win32/spsupp/COMOpenDocuments.cxx4
-rw-r--r--shell/source/win32/spsupp/spsuppServ.cxx2
10 files changed, 28 insertions, 23 deletions
diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx
index 0e0f53c10e4f..87d021a6d0e7 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -40,7 +40,7 @@
#endif
#include <windows.h>
-css::beans::Optional<css::uno::Any> ImplGetLocale(LCID lcid)
+static css::beans::Optional<css::uno::Any> ImplGetLocale(LCID lcid)
{
WCHAR buffer[8];
PWSTR cp = buffer;
diff --git a/shell/source/tools/regsvrex/regsvrex.cxx b/shell/source/tools/regsvrex/regsvrex.cxx
index 7fe5a0d95c3b..c7fb87943a5d 100644
--- a/shell/source/tools/regsvrex/regsvrex.cxx
+++ b/shell/source/tools/regsvrex/regsvrex.cxx
@@ -24,7 +24,7 @@
typedef HRESULT (__stdcall *lpfnDllRegisterServer)();
typedef HRESULT (__stdcall *lpfnDllUnregisterServer)();
-bool IsUnregisterParameter(const wchar_t* Param)
+static bool IsUnregisterParameter(const wchar_t* Param)
{
return ((0 == _wcsicmp(Param, L"/u")) ||
(0 == _wcsicmp(Param, L"-u")));
diff --git a/shell/source/win32/ooofilereader/metainforeader.cxx b/shell/source/win32/ooofilereader/metainforeader.cxx
index 52a9117d7e4e..1f87bba8dccb 100644
--- a/shell/source/win32/ooofilereader/metainforeader.cxx
+++ b/shell/source/win32/ooofilereader/metainforeader.cxx
@@ -168,7 +168,7 @@ std::wstring CMetaInfoReader::getTagAttribute(const std::wstring& TagName, cons
*/
const LocaleSet_t EN_US_LOCALE( ::std::make_pair( ::std::wstring( L"en" ), ::std::wstring( L"US" )));
-bool isValidLocale(const ::std::wstring& Locale)
+static bool isValidLocale(const ::std::wstring& Locale)
{
return ( Locale.length() == 5 );
}
diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx
index 088eb8e5a983..3a18895bf189 100644
--- a/shell/source/win32/shlxthandler/infotips/infotips.cxx
+++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx
@@ -101,7 +101,7 @@ ULONG STDMETHODCALLTYPE CInfoTip::Release()
/** get file type information from registry.
*/
-std::wstring getFileTypeInfo(const std::wstring& file_extension)
+static std::wstring getFileTypeInfo(const std::wstring& file_extension)
{
wchar_t extKeyValue[MAX_STRING];
wchar_t typeKeyValue[MAX_STRING];
@@ -115,7 +115,7 @@ std::wstring getFileTypeInfo(const std::wstring& file_extension)
/** get file size.
*/
-DWORD getSizeOfFile( wchar_t const * FileName )
+static DWORD getSizeOfFile( wchar_t const * FileName )
{
HANDLE hFile = CreateFileW(FileName, // open file
GENERIC_READ, // open for reading
@@ -137,7 +137,7 @@ DWORD getSizeOfFile( wchar_t const * FileName )
/** format file size in to be more readable.
*/
-std::wstring formatSizeOfFile( DWORD dwSize )
+static std::wstring formatSizeOfFile( DWORD dwSize )
{
if ( dwSize < 1000 )
{
@@ -178,7 +178,7 @@ std::wstring formatSizeOfFile( DWORD dwSize )
/** get file size information.
*/
-std::wstring getFileSizeInfo(wchar_t const * FileName)
+static std::wstring getFileSizeInfo(wchar_t const * FileName)
{
DWORD dwSize=getSizeOfFile(FileName);
if (dwSize != INVALID_FILE_SIZE)
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index 8782704180ad..8f9ac227b137 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -62,6 +62,8 @@
#include <stream_helper.hxx>
+#include <olectl.h> // declarations of DllRegisterServer/DllUnregisterServer
+
//C-------------------------------------------------------------------------
// Class: COooFilter
// Summary: Implements LibreOffice filter class
@@ -436,7 +438,7 @@ SCODE STDMETHODCALLTYPE COooFilter::GetText(ULONG * pcwcBuffer, WCHAR * awcBuffe
// Returns: corresponding metainfo names.
-::std::wstring GetMetaInfoNameFromPropertyId( ULONG ulPropID )
+static ::std::wstring GetMetaInfoNameFromPropertyId( ULONG ulPropID )
{
switch ( ulPropID )
{
diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx
index 8cf408688ab6..6ca91f0d98ed 100644
--- a/shell/source/win32/shlxthandler/shlxthdl.cxx
+++ b/shell/source/win32/shlxthandler/shlxthdl.cxx
@@ -28,6 +28,7 @@
#include <string>
#include <shlobj.h>
+#include <olectl.h> // declarations of DllRegisterServer/DllUnregisterServer
// Module global
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index cdc5d97622ec..c6dc1253b953 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -45,7 +45,7 @@ namespace internal
/* The signet.png used for thumbnails of signed documents
is contained as resource in this module, the resource
id is 2000 */
- void LoadSignetImageFromResource(ZipFile::ZipContentBuffer_t& buffer)
+ static void LoadSignetImageFromResource(ZipFile::ZipContentBuffer_t& buffer)
{
HRSRC hrc = FindResourceW(g_hModule, L"#2000", RT_RCDATA);
DWORD size = SizeofResource(g_hModule, hrc);
@@ -54,12 +54,12 @@ namespace internal
buffer = ZipFile::ZipContentBuffer_t(data, data + size);
}
- bool IsSignedDocument(const ZipFile* zipfile)
+ static bool IsSignedDocument(const ZipFile* zipfile)
{
return zipfile->HasContent("META-INF/documentsignatures.xml");
}
- Gdiplus::Point CalcSignetPosition(
+ static Gdiplus::Point CalcSignetPosition(
const Gdiplus::Rect& canvas, const Gdiplus::Rect& thumbnail_border, const Gdiplus::Rect& signet)
{
int x = 0;
diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx
index e4f9c3b3dfd9..fc56630504c6 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -39,7 +39,7 @@
#include <stdexcept>
#if OSL_DEBUG_LEVEL > 0
- void dumpParameter();
+ static void dumpParameter();
#endif
typedef std::vector<MapiRecipDescW> MapiRecipientList_t;
@@ -75,7 +75,7 @@ namespace /* private */
@returns
the email address prefixed with the specified prefix.
*/
-inline std::wstring prefixEmailAddress(
+static inline std::wstring prefixEmailAddress(
const std::wstring& aEmailAddress,
const std::wstring& aPrefix = L"SMTP:")
{
@@ -83,7 +83,7 @@ inline std::wstring prefixEmailAddress(
}
/** @internal */
-void addRecipient(
+static void addRecipient(
ULONG recipClass,
const std::wstring& recipAddress,
MapiRecipientList_t* pMapiRecipientList)
@@ -98,7 +98,7 @@ void addRecipient(
}
/** @internal */
-void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
+static void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
{
OSL_ASSERT(pMapiRecipientList->empty());
@@ -116,7 +116,7 @@ void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
}
/** @internal */
-void initAttachmentList(MapiAttachmentList_t* pMapiAttachmentList)
+static void initAttachmentList(MapiAttachmentList_t* pMapiAttachmentList)
{
OSL_ASSERT(pMapiAttachmentList->empty());
@@ -140,7 +140,7 @@ void initAttachmentList(MapiAttachmentList_t* pMapiAttachmentList)
}
/** @internal */
-void initMapiOriginator(MapiRecipDescW* pMapiOriginator)
+static void initMapiOriginator(MapiRecipDescW* pMapiOriginator)
{
ZeroMemory(pMapiOriginator, sizeof(*pMapiOriginator));
@@ -150,7 +150,7 @@ void initMapiOriginator(MapiRecipDescW* pMapiOriginator)
}
/** @internal */
-void initMapiMessage(
+static void initMapiMessage(
MapiRecipDescW* aMapiOriginator,
MapiRecipientList_t& aMapiRecipientList,
MapiAttachmentList_t& aMapiAttachmentList,
@@ -184,7 +184,7 @@ const wchar_t* const KnownParameters[] =
};
/** @internal */
-bool isKnownParameter(const wchar_t* aParameterName)
+static bool isKnownParameter(const wchar_t* aParameterName)
{
for (const wchar_t* KnownParameter : KnownParameters)
if (_wcsicmp(aParameterName, KnownParameter) == 0)
@@ -194,7 +194,7 @@ bool isKnownParameter(const wchar_t* aParameterName)
}
/** @internal */
-void initParameter(int argc, wchar_t* argv[])
+static void initParameter(int argc, wchar_t* argv[])
{
for (int i = 1; i < argc; i++)
{
@@ -249,7 +249,7 @@ void initParameter(int argc, wchar_t* argv[])
}
}
-void ShowError(ULONG nMAPIResult)
+static void ShowError(ULONG nMAPIResult)
{
if (!gBootstrap.isEmpty())
rtl::Bootstrap::setIniFilename(gBootstrap);
diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 829d1923fe5f..c4818263b832 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -17,7 +17,7 @@
#include <stdio.h>
// Display confirmation dialog, return false on negative answer
-bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
+static bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
{
// TODO: change wording (currently taken from MS Office), use LO localization
wchar_t sBuf[65536];
@@ -30,7 +30,7 @@ bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
}
// Returns S_OK if successful
-HRESULT LOStart(const wchar_t* sModeArg, const wchar_t* sFilePath, bool bDoSecurityWarning)
+static HRESULT LOStart(const wchar_t* sModeArg, const wchar_t* sFilePath, bool bDoSecurityWarning)
{
const wchar_t* sProgram = GetLOPath();
if (bDoSecurityWarning && !SecurityWarning(sProgram, sFilePath))
diff --git a/shell/source/win32/spsupp/spsuppServ.cxx b/shell/source/win32/spsupp/spsuppServ.cxx
index 6fdd4c0e5396..78af725bec60 100644
--- a/shell/source/win32/spsupp/spsuppServ.cxx
+++ b/shell/source/win32/spsupp/spsuppServ.cxx
@@ -26,6 +26,8 @@
#include <COMOpenDocuments.hpp>
#include <registrar.hpp>
+#include <shlwapi.h> // declaration of DllInstall
+
namespace {
HANDLE g_hModule;