summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-06 11:05:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-08 07:20:29 +0100
commit5c23459245f566831383934dd64d19e002bfcfcb (patch)
tree27d92a2167c6245c3be7844e2bbe7b6e624f0f9e /sfx2
parent4a7771ffa8d98d08dffbba90fd42d1ab75e056fe (diff)
new loplugin constvars
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/newhelp.cxx2
-rw-r--r--sfx2/source/appl/shutdownicon.cxx2
-rw-r--r--sfx2/source/sidebar/Paint.cxx2
3 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 1e643918361e..56cb15663268 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2588,7 +2588,7 @@ void SfxHelpWindow_Impl::Resize()
void SfxHelpWindow_Impl::Split()
{
static const long nMinSplitSize = 5;
- static long nMaxSplitSize = 99 - nMinSplitSize;
+ static const long nMaxSplitSize = 99 - nMinSplitSize;
SplitWindow::Split();
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index da830474037a..a74a785e667a 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -123,7 +123,7 @@ extern "C" {
namespace {
-boost::logic::tribool loaded(boost::logic::indeterminate);
+boost::logic::tribool loaded(boost::logic::indeterminate); // loplugin:constvars:ignore
oslGenericFunction pInitSystray = disabled_initSystray;
oslGenericFunction pDeInitSystray = disabled_deInitSystray;
diff --git a/sfx2/source/sidebar/Paint.cxx b/sfx2/source/sidebar/Paint.cxx
index 114ef9339b74..817bd0e54f00 100644
--- a/sfx2/source/sidebar/Paint.cxx
+++ b/sfx2/source/sidebar/Paint.cxx
@@ -59,7 +59,7 @@ const Color& Paint::GetColor() const
if (meType != ColorPaint)
{
assert(meType==ColorPaint);
- static Color aErrorColor;
+ static const Color aErrorColor;
return aErrorColor;
}
else