summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-01-09 15:40:12 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-01-09 15:40:12 +0100
commitf2e743010dec14e358e3b138a35b0cb6f758bb6b (patch)
tree3c52916e23e8f44cefff9c732fd99473ce4b88aa /unotools
parent3b2ec686862e3d3c5634ee06eae12641cf1fe6cf (diff)
New loplugin:externvar: unotools
Change-Id: I117f5166dffa1514cfc774105b4c94009183fe90
Diffstat (limited to 'unotools')
-rw-r--r--unotools/Library_utl.mk5
-rw-r--r--unotools/inc/unotoolsservices.hxx22
-rw-r--r--unotools/source/config/misccfg.cxx2
-rw-r--r--unotools/source/config/printwarningoptions.cxx2
-rw-r--r--unotools/source/misc/ServiceDocumenter.cxx5
-rw-r--r--unotools/source/misc/fontcvt.cxx12
-rw-r--r--unotools/source/misc/unotoolsservices.cxx6
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx5
8 files changed, 43 insertions, 16 deletions
diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk
index 75a40298fdd3..0270b4f84b92 100644
--- a/unotools/Library_utl.mk
+++ b/unotools/Library_utl.mk
@@ -20,6 +20,11 @@ $(eval $(call gb_Library_use_custom_headers,utl,\
# in case UNO services are exported: declare location of component file
$(eval $(call gb_Library_set_componentfile,utl,unotools/util/utl))
+$(eval $(call gb_Library_set_include,utl, \
+ $$(INCLUDE) \
+ -I$(SRCDIR)/unotools/inc \
+))
+
# add any additional definitions to be set for compilation here
# (e.g. -DLIB_DLLIMPLEMENTATION)
$(eval $(call gb_Library_add_defs,utl,\
diff --git a/unotools/inc/unotoolsservices.hxx b/unotools/inc/unotoolsservices.hxx
new file mode 100644
index 000000000000..59d760a48246
--- /dev/null
+++ b/unotools/inc/unotoolsservices.hxx
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_UNOTOOLS_INC_UNOTOOLSSERVICES_HXX
+#define INCLUDED_UNOTOOLS_INC_UNOTOOLSSERVICES_HXX
+
+#include <sal/config.h>
+
+namespace comphelper { namespace service_decl { class ServiceDecl; } }
+
+extern comphelper::service_decl::ServiceDecl const OTempFileServiceDecl;
+extern comphelper::service_decl::ServiceDecl const ServiceDocumenterDecl;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/unotools/source/config/misccfg.cxx b/unotools/source/config/misccfg.cxx
index 4d5a953890ce..64c195cb5b0d 100644
--- a/unotools/source/config/misccfg.cxx
+++ b/unotools/source/config/misccfg.cxx
@@ -36,7 +36,7 @@ namespace utl
{
class SfxMiscCfg;
-std::weak_ptr<SfxMiscCfg> g_pOptions;
+static std::weak_ptr<SfxMiscCfg> g_pOptions;
class SfxMiscCfg : public utl::ConfigItem
{
diff --git a/unotools/source/config/printwarningoptions.cxx b/unotools/source/config/printwarningoptions.cxx
index 7e9cc8719c99..4634d7e4698d 100644
--- a/unotools/source/config/printwarningoptions.cxx
+++ b/unotools/source/config/printwarningoptions.cxx
@@ -221,7 +221,7 @@ Sequence< OUString > SvtPrintWarningOptions_Impl::impl_GetPropertyNames()
return seqPropertyNames;
}
-std::weak_ptr<SvtPrintWarningOptions_Impl> g_pPrintWarningOptions;
+static std::weak_ptr<SvtPrintWarningOptions_Impl> g_pPrintWarningOptions;
SvtPrintWarningOptions::SvtPrintWarningOptions()
{
diff --git a/unotools/source/misc/ServiceDocumenter.cxx b/unotools/source/misc/ServiceDocumenter.cxx
index ad24713ec196..7b90b57ebfcc 100644
--- a/unotools/source/misc/ServiceDocumenter.cxx
+++ b/unotools/source/misc/ServiceDocumenter.cxx
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <ServiceDocumenter.hxx>
+#include <unotoolsservices.hxx>
#include <comphelper/servicedecl.hxx>
#include <com/sun/star/system/XSystemShellExecute.hpp>
using namespace com::sun::star;
@@ -59,8 +60,8 @@ void unotools::misc::ServiceDocumenter::showServiceDocs(const Reference<XService
}
namespace sdecl = ::comphelper::service_decl;
-sdecl::class_< unotools::misc::ServiceDocumenter > ServiceDocumenterImpl;
-extern const sdecl::ServiceDecl ServiceDocumenterDecl(
+sdecl::class_< unotools::misc::ServiceDocumenter > const ServiceDocumenterImpl;
+const sdecl::ServiceDecl ServiceDocumenterDecl(
ServiceDocumenterImpl,
"com.sun.star.comp.unotools.misc.ServiceDocumenter",
"");
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index b48f2106155f..97fdc3cb13af 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1018,7 +1018,7 @@ enum SymbolFont
Wingdings3=32, MTExtra=64, TimesNewRoman=128
};
-const char *aSymbolNames[] =
+const char * const aSymbolNames[] =
{
"Symbol", "Wingdings", "Monotype Sorts", "Webdings", "Wingdings 2",
"Wingdings 3", "MT Extra", "Times New Roman"
@@ -1041,7 +1041,7 @@ public:
struct ExtraTable { sal_Unicode cStar; sal_uInt8 cMS;};
-ExtraTable aWingDingsExtraTab[] =
+ExtraTable const aWingDingsExtraTab[] =
{
{0x25cf, 0x6C}, {0x2714, 0xFC}, {0x2717, 0xFB}, {0x2794, 0xE8},
{0x27a2, 0xD8}, {0xe000, 0x6F}, {0xe001, 0x73}, {0xe002, 0x74},
@@ -1059,7 +1059,7 @@ ExtraTable aWingDingsExtraTab[] =
{0xe034, 0x4D}, {0xe0aa, 0x71}, {0xe422, 0x44}
};
-ExtraTable aSymbolExtraTab2[] =
+ExtraTable const aSymbolExtraTab2[] =
{
{0x0020, 0x20}, {0x00A0, 0x20}, {0x0021, 0x21}, {0x2200, 0x22},
{0x0023, 0x23}, {0x2203, 0x24}, {0x0025, 0x25}, {0x0026, 0x26},
@@ -1087,7 +1087,7 @@ ExtraTable aSymbolExtraTab2[] =
{0x2320, 0xF3}, {0x2321, 0xF5}, {0x2013, 0x2D}
};
-ExtraTable aSymbolExtraTab[] =
+ExtraTable const aSymbolExtraTab[] =
{
{0xe021, 0xD3}, {0xe024, 0xD2}, {0xe035, 0x20}, {0xe036, 0x28},
{0xe037, 0x29}, {0xe039, 0x20}, {0xe083, 0x2B}, {0xe084, 0x3C},
@@ -1109,7 +1109,7 @@ ExtraTable aSymbolExtraTab[] =
{0xe0dc, 0xAD}, {0xe0dd, 0xAF}
};
-ExtraTable aTNRExtraTab[] =
+ExtraTable const aTNRExtraTab[] =
{
{0xe021, 0xA9},
{0xe022, 0x40},
@@ -1207,7 +1207,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl()
const char *SymbolFontToString(int nResult)
{
- const char **ppName = aSymbolNames;
+ const char * const *ppName = aSymbolNames;
int nI = Symbol;
while (nI <= nResult)
{
diff --git a/unotools/source/misc/unotoolsservices.cxx b/unotools/source/misc/unotoolsservices.cxx
index e7e62e681eb0..09ab8d97debd 100644
--- a/unotools/source/misc/unotoolsservices.cxx
+++ b/unotools/source/misc/unotoolsservices.cxx
@@ -11,11 +11,9 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <uno/environment.h>
-namespace sdecl = ::comphelper::service_decl;
-
-extern sdecl::ServiceDecl const OTempFileServiceDecl;
-extern sdecl::ServiceDecl const ServiceDocumenterDecl;
+#include <unotoolsservices.hxx>
+namespace sdecl = ::comphelper::service_decl;
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL utl_component_getFactory(
sal_Char const* pImplName, void*, void*)
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 572871e3e4df..bcf247ad4696 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -18,6 +18,7 @@
*/
#include "XTempFile.hxx"
+#include <unotoolsservices.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -402,8 +403,8 @@ throw ( css::io::IOException, css::uno::RuntimeException, std::exception )
}
namespace sdecl = ::comphelper::service_decl;
-sdecl::class_< OTempFileService> OTempFileServiceImpl;
-extern const sdecl::ServiceDecl OTempFileServiceDecl(
+sdecl::class_< OTempFileService> const OTempFileServiceImpl;
+const sdecl::ServiceDecl OTempFileServiceDecl(
OTempFileServiceImpl,
"com.sun.star.io.comp.TempFile",
"com.sun.star.io.TempFile");