diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-18 11:54:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-19 07:57:49 +0200 |
commit | 265072a4cafd9f8552264448e2fc049ae3ac97e5 (patch) | |
tree | effa65b8c43bedee6493da446840f3114fd2d77f /vcl/unx/generic | |
parent | a22d32644be3fede66558df997e4c75ed96b2fa8 (diff) |
loplugin:staticvar in vcl
Change-Id: I2bdab84dc81e0545aa96542caec213db61765f68
Reviewed-on: https://gerrit.libreoffice.org/61922
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/app/i18n_ic.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 17 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontmanager.cxx | 2 |
3 files changed, 9 insertions, 12 deletions
diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index 87c84b5c44ef..ad7f408748b2 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -443,7 +443,7 @@ SalI18N_InputContext::GetWeightingOfIMStyle( XIMStyle nStyle ) }; StyleWeightingT const *pWeightPtr; - const StyleWeightingT pWeight[] = { + static const StyleWeightingT pWeight[] = { { XIMPreeditCallbacks, 0x10000000 }, { XIMPreeditPosition, 0x02000000 }, { XIMPreeditArea, 0x01000000 }, diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index dbe1995f5150..e454587bafe0 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -158,24 +158,21 @@ extern "C" srv_vendor_t sal_GetServerVendor( Display *p_display ) { typedef struct { - srv_vendor_t const e_vendor; // vendor as enum - const char *p_name; // vendor name as returned by VendorString() - unsigned int const n_len; // number of chars to compare + srv_vendor_t e_vendor; // vendor as enum + const char* p_name; // vendor name as returned by VendorString() + unsigned int n_len; // number of chars to compare } vendor_t; - const vendor_t p_vendorlist[] = { + static const vendor_t vendorlist[] = { { vendor_sun, "Sun Microsystems, Inc.", 10 }, - // always the last entry: vendor_none to indicate eol - { vendor_none, nullptr, 0 }, }; // handle regular server vendors char *p_name = ServerVendor( p_display ); - vendor_t *p_vendor; - for (p_vendor = const_cast<vendor_t*>(p_vendorlist); p_vendor->e_vendor != vendor_none; p_vendor++) + for (auto const & vendor : vendorlist) { - if ( strncmp (p_name, p_vendor->p_name, p_vendor->n_len) == 0 ) - return p_vendor->e_vendor; + if ( strncmp (p_name, vendor.p_name, vendor.n_len) == 0 ) + return vendor.e_vendor; } // vendor not found in list diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 06ee4f180b1b..394c5484a5bd 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -847,7 +847,7 @@ FontFamily PrintFontManager::matchFamilyName( const OUString& rFamily ) } family_t; #define InitializeClass( p, a ) p, sizeof(p) - 1, a - const family_t pFamilyMatch[] = { + static const family_t pFamilyMatch[] = { { InitializeClass( "arial", FAMILY_SWISS ) }, { InitializeClass( "arioso", FAMILY_SCRIPT ) }, { InitializeClass( "avant garde", FAMILY_SWISS ) }, |