Kaydet (Commit) 7ea01578 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:staticvar in soltools..svx

Change-Id: Ie9f36eb0e00aaee34a27f136ed903f8f87e52dcc
Reviewed-on: https://gerrit.libreoffice.org/61916
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 8274c4c6
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
Array of new shape type descriptors. Array of new shape type descriptors.
*/ */
void AddShapeTypeList (int nDescriptorCount, void AddShapeTypeList (int nDescriptorCount,
ShapeTypeDescriptor aDescriptorList[]); ShapeTypeDescriptor const aDescriptorList[]);
/// get the accessible base name for an object /// get the accessible base name for an object
/// ///
......
...@@ -48,7 +48,7 @@ struct pri ...@@ -48,7 +48,7 @@ struct pri
char const ctype; char const ctype;
}; };
static struct pri priority[] = static const struct pri priority[] =
{ {
{ {
0, 0, 0 0, 0, 0
......
...@@ -71,7 +71,7 @@ struct fsm ...@@ -71,7 +71,7 @@ struct fsm
int const nextstate; /* enter this state if +ve */ int const nextstate; /* enter this state if +ve */
}; };
static /*const*/ struct fsm fsm[] = { static const struct fsm fsm[] = {
/* start state */ /* start state */
{START, {C_XX}, ACT(UNCLASS, S_SELF)}, {START, {C_XX}, ACT(UNCLASS, S_SELF)},
{START, {' ', '\t', '\v'}, WS1}, {START, {' ', '\t', '\v'}, WS1},
...@@ -259,7 +259,7 @@ static short bigfsm[256][MAXSTATE]; ...@@ -259,7 +259,7 @@ static short bigfsm[256][MAXSTATE];
void void
expandlex(void) expandlex(void)
{ {
/* const */ struct fsm *fp; const struct fsm *fp;
int i, j, nstate; int i, j, nstate;
for (fp = fsm; fp->state >= 0; fp++) for (fp = fsm; fp->state >= 0; fp++)
......
...@@ -43,7 +43,7 @@ struct kwtab ...@@ -43,7 +43,7 @@ struct kwtab
int const flag; int const flag;
}; };
static struct kwtab kwtab[] = static const struct kwtab kwtab[] =
{ {
{"if", KIF, ISKW}, {"if", KIF, ISKW},
{"ifdef", KIFDEF, ISKW}, {"ifdef", KIFDEF, ISKW},
...@@ -76,7 +76,7 @@ unsigned long namebit[077 + 1]; ...@@ -76,7 +76,7 @@ unsigned long namebit[077 + 1];
void void
setup_kwtab(void) setup_kwtab(void)
{ {
struct kwtab *kp; struct kwtab const *kp;
Nlist *np; Nlist *np;
Token t; Token t;
static Token deftoken[1] = {{NAME, 0, 7, (uchar *) "defined", 0}}; static Token deftoken[1] = {{NAME, 0, 7, (uchar *) "defined", 0}};
......
...@@ -1098,11 +1098,11 @@ void Test::testIsNumberFormat() ...@@ -1098,11 +1098,11 @@ void Test::testIsNumberFormat()
LanguageType eLang = LANGUAGE_ENGLISH_US; LanguageType eLang = LANGUAGE_ENGLISH_US;
SvNumberFormatter aFormatter(m_xContext, eLang); SvNumberFormatter aFormatter(m_xContext, eLang);
struct NumberFormatData static struct NumberFormatData
{ {
const char* pFormat; const char* pFormat;
bool const bIsNumber; bool const bIsNumber;
} aTests[] = { } const aTests[] = {
{ "20.3", true }, { "20.3", true },
{ "2", true }, { "2", true },
{ "test", false }, { "test", false },
......
...@@ -549,7 +549,7 @@ OUString SvNumberformat::ImpObtainCalendarAndNumerals( OUStringBuffer& rString, ...@@ -549,7 +549,7 @@ OUString SvNumberformat::ImpObtainCalendarAndNumerals( OUStringBuffer& rString,
break; break;
} }
/** Reference language for each numeral ID */ /** Reference language for each numeral ID */
const LanguageType aNumeralIDtoLanguage []= static const LanguageType aNumeralIDtoLanguage []=
{ {
LANGUAGE_DONTKNOW, // 0x00 LANGUAGE_DONTKNOW, // 0x00
LANGUAGE_ENGLISH_US, // 0x01 LANGUAGE_ENGLISH_US, // 0x01
......
...@@ -104,12 +104,10 @@ namespace { ...@@ -104,12 +104,10 @@ namespace {
uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme) uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
{ {
uno::Sequence<OUString> aNames(2 * ColorConfigEntryCount);
OUString* pNames = aNames.getArray();
struct ColorConfigEntryData_Impl struct ColorConfigEntryData_Impl
{ {
OUStringLiteral const cName; OUStringLiteral cName;
bool const bCanBeVisible; bool bCanBeVisible;
}; };
static const ColorConfigEntryData_Impl cNames[] = static const ColorConfigEntryData_Impl cNames[] =
{ {
...@@ -164,19 +162,19 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme) ...@@ -164,19 +162,19 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
{ OUStringLiteral("/SQLParameter"), false }, { OUStringLiteral("/SQLParameter"), false },
{ OUStringLiteral("/SQLComment"), false } { OUStringLiteral("/SQLComment"), false }
}; };
uno::Sequence<OUString> aNames(2 * ColorConfigEntryCount);
OUString* pNames = aNames.getArray();
int nIndex = 0; int nIndex = 0;
OUString sBase = "ColorSchemes/" OUString sBase = "ColorSchemes/"
+ utl::wrapConfigurationElementName(rScheme); + utl::wrapConfigurationElementName(rScheme);
const int nCount = ColorConfigEntryCount; for(sal_Int32 i = 0; i < ColorConfigEntryCount; ++i)
for(sal_Int32 i = 0; i < nCount; ++i)
{ {
OUString sBaseName = sBase + cNames[i].cName; OUString sBaseName = sBase + cNames[i].cName;
pNames[nIndex] += sBaseName; pNames[nIndex++] = sBaseName + "/Color";
pNames[nIndex++] += "/Color";
if(cNames[i].bCanBeVisible) if(cNames[i].bCanBeVisible)
{ {
pNames[nIndex] += sBaseName; pNames[nIndex++] = sBaseName + g_sIsVisible;
pNames[nIndex++] += g_sIsVisible;
} }
} }
aNames.realloc(nIndex); aNames.realloc(nIndex);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -147,7 +147,7 @@ ShapeTypeHandler::~ShapeTypeHandler() ...@@ -147,7 +147,7 @@ ShapeTypeHandler::~ShapeTypeHandler()
void ShapeTypeHandler::AddShapeTypeList (int nDescriptorCount, void ShapeTypeHandler::AddShapeTypeList (int nDescriptorCount,
ShapeTypeDescriptor aDescriptorList[]) ShapeTypeDescriptor const aDescriptorList[])
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
......
...@@ -89,7 +89,7 @@ void RegisterDrawShapeTypes() ...@@ -89,7 +89,7 @@ void RegisterDrawShapeTypes()
/** List of shape type descriptors corresponding to the /** List of shape type descriptors corresponding to the
<type>SvxShapeTypes</type> enum. <type>SvxShapeTypes</type> enum.
*/ */
ShapeTypeDescriptor aSvxShapeTypeList[] = { static ShapeTypeDescriptor const aSvxShapeTypeList[] = {
ShapeTypeDescriptor ( DRAWING_TEXT, "com.sun.star.drawing.TextShape", ShapeTypeDescriptor ( DRAWING_TEXT, "com.sun.star.drawing.TextShape",
CreateSvxAccessibleShape), CreateSvxAccessibleShape),
ShapeTypeDescriptor (DRAWING_RECTANGLE, "com.sun.star.drawing.RectangleShape", ShapeTypeDescriptor (DRAWING_RECTANGLE, "com.sun.star.drawing.RectangleShape",
......
...@@ -371,7 +371,7 @@ XPropertyList::CreatePropertyListFromURL( XPropertyListType t, ...@@ -371,7 +371,7 @@ XPropertyList::CreatePropertyListFromURL( XPropertyListType t,
static struct { static struct {
XPropertyListType const t; XPropertyListType const t;
const char *pExt; const char *pExt;
} pExtnMap[] = { } const pExtnMap[] = {
{ XPropertyListType::Color, "soc" }, { XPropertyListType::Color, "soc" },
{ XPropertyListType::LineEnd, "soe" }, { XPropertyListType::LineEnd, "soe" },
{ XPropertyListType::Dash, "sod" }, { XPropertyListType::Dash, "sod" },
......
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