summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-07-21 14:23:23 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-08-16 06:30:09 +0000
commit127f70d66ac32b7a4ec818adaf1bdccb71865ee5 (patch)
treea020d2002c2eea81484297421f0fbe3ee84c2db0 /svx
parentce95e39f8e952159844e9dc04a1df402bb103634 (diff)
new loplugin to check for static OUStrings
that are better declared as OUStringLiteral Change-Id: Ifb5d9a12bb31a68641940bec16971a8181a46567 Reviewed-on: https://gerrit.libreoffice.org/27377 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/fmgridif.cxx21
-rw-r--r--svx/source/form/fmdmod.cxx40
-rw-r--r--svx/source/form/fmundo.cxx12
3 files changed, 36 insertions, 37 deletions
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index fbb6d18f221e..6f40844c9088 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1594,24 +1594,22 @@ Reference< XIndexContainer > FmXGridPeer::getColumns() throw( RuntimeException,
void FmXGridPeer::addColumnListeners(const Reference< XPropertySet >& xCol)
{
- static const OUString aPropsListenedTo[] =
+ static const OUStringLiteral aPropsListenedTo[] =
{
- OUString(FM_PROP_LABEL), OUString(FM_PROP_WIDTH), OUString(FM_PROP_HIDDEN), OUString(FM_PROP_ALIGN), OUString(FM_PROP_FORMATKEY)
+ OUStringLiteral(FM_PROP_LABEL), OUStringLiteral(FM_PROP_WIDTH), OUStringLiteral(FM_PROP_HIDDEN),
+ OUStringLiteral(FM_PROP_ALIGN), OUStringLiteral(FM_PROP_FORMATKEY)
};
// as not all properties have to be supported by all columns we have to check this
// before adding a listener
Reference< XPropertySetInfo > xInfo = xCol->getPropertySetInfo();
- Property aPropDesc;
- const OUString* pProps = aPropsListenedTo;
- const OUString* pPropsEnd = pProps + SAL_N_ELEMENTS( aPropsListenedTo );
- for (; pProps != pPropsEnd; ++pProps)
+ for (unsigned i=0; i<SAL_N_ELEMENTS(aPropsListenedTo); ++i)
{
- if ( xInfo->hasPropertyByName( *pProps ) )
+ if ( xInfo->hasPropertyByName( aPropsListenedTo[i] ) )
{
- aPropDesc = xInfo->getPropertyByName( *pProps );
+ Property aPropDesc = xInfo->getPropertyByName( aPropsListenedTo[i] );
if ( 0 != ( aPropDesc.Attributes & PropertyAttribute::BOUND ) )
- xCol->addPropertyChangeListener( *pProps, this );
+ xCol->addPropertyChangeListener( aPropsListenedTo[i], this );
}
}
}
@@ -1621,9 +1619,10 @@ void FmXGridPeer::removeColumnListeners(const Reference< XPropertySet >& xCol)
{
// the same props as in addColumnListeners ... linux has problems with global static UStrings, so
// we have to do it this way ....
- static const OUString aPropsListenedTo[] =
+ static const OUStringLiteral aPropsListenedTo[] =
{
- OUString(FM_PROP_LABEL), OUString(FM_PROP_WIDTH), OUString(FM_PROP_HIDDEN), OUString(FM_PROP_ALIGN), OUString(FM_PROP_FORMATKEY)
+ OUStringLiteral(FM_PROP_LABEL), OUStringLiteral(FM_PROP_WIDTH), OUStringLiteral(FM_PROP_HIDDEN),
+ OUStringLiteral(FM_PROP_ALIGN), OUStringLiteral(FM_PROP_FORMATKEY)
};
Reference< XPropertySetInfo > xInfo = xCol->getPropertySetInfo();
diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx
index a11a99eaaa1d..3b980e493c45 100644
--- a/svx/source/form/fmdmod.cxx
+++ b/svx/source/form/fmdmod.cxx
@@ -62,27 +62,27 @@ SAL_WNOUNREACHABLE_CODE_POP
::com::sun::star::uno::Sequence< OUString > SAL_CALL SvxFmMSFactory::getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception )
{
- static const OUString aSvxComponentServiceNameList[] =
+ static const OUStringLiteral aSvxComponentServiceNameList[] =
{
- OUString(FM_SUN_COMPONENT_TEXTFIELD),
- OUString(FM_SUN_COMPONENT_FORM),
- OUString(FM_SUN_COMPONENT_LISTBOX),
- OUString(FM_SUN_COMPONENT_COMBOBOX),
- OUString(FM_SUN_COMPONENT_RADIOBUTTON),
- OUString(FM_SUN_COMPONENT_GROUPBOX),
- OUString(FM_SUN_COMPONENT_FIXEDTEXT),
- OUString(FM_SUN_COMPONENT_COMMANDBUTTON),
- OUString(FM_SUN_COMPONENT_CHECKBOX),
- OUString(FM_SUN_COMPONENT_GRIDCONTROL),
- OUString(FM_SUN_COMPONENT_IMAGEBUTTON),
- OUString(FM_SUN_COMPONENT_FILECONTROL),
- OUString(FM_SUN_COMPONENT_TIMEFIELD),
- OUString(FM_SUN_COMPONENT_DATEFIELD),
- OUString(FM_SUN_COMPONENT_NUMERICFIELD),
- OUString(FM_SUN_COMPONENT_CURRENCYFIELD),
- OUString(FM_SUN_COMPONENT_PATTERNFIELD),
- OUString(FM_SUN_COMPONENT_HIDDENCONTROL),
- OUString(FM_SUN_COMPONENT_IMAGECONTROL)
+ OUStringLiteral(FM_SUN_COMPONENT_TEXTFIELD),
+ OUStringLiteral(FM_SUN_COMPONENT_FORM),
+ OUStringLiteral(FM_SUN_COMPONENT_LISTBOX),
+ OUStringLiteral(FM_SUN_COMPONENT_COMBOBOX),
+ OUStringLiteral(FM_SUN_COMPONENT_RADIOBUTTON),
+ OUStringLiteral(FM_SUN_COMPONENT_GROUPBOX),
+ OUStringLiteral(FM_SUN_COMPONENT_FIXEDTEXT),
+ OUStringLiteral(FM_SUN_COMPONENT_COMMANDBUTTON),
+ OUStringLiteral(FM_SUN_COMPONENT_CHECKBOX),
+ OUStringLiteral(FM_SUN_COMPONENT_GRIDCONTROL),
+ OUStringLiteral(FM_SUN_COMPONENT_IMAGEBUTTON),
+ OUStringLiteral(FM_SUN_COMPONENT_FILECONTROL),
+ OUStringLiteral(FM_SUN_COMPONENT_TIMEFIELD),
+ OUStringLiteral(FM_SUN_COMPONENT_DATEFIELD),
+ OUStringLiteral(FM_SUN_COMPONENT_NUMERICFIELD),
+ OUStringLiteral(FM_SUN_COMPONENT_CURRENCYFIELD),
+ OUStringLiteral(FM_SUN_COMPONENT_PATTERNFIELD),
+ OUStringLiteral(FM_SUN_COMPONENT_HIDDENCONTROL),
+ OUStringLiteral(FM_SUN_COMPONENT_IMAGECONTROL)
};
static const sal_uInt16 nSvxComponentServiceNameListCount = SAL_N_ELEMENTS(aSvxComponentServiceNameList);
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index db6162f7d1ac..22476b5e6a46 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -535,13 +535,13 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt)
return;
// if it's a "default value" property of a control model, set the according "value" property
- static const OUString pDefaultValueProperties[] = {
- OUString(FM_PROP_DEFAULT_TEXT), OUString(FM_PROP_DEFAULTCHECKED), OUString(FM_PROP_DEFAULT_DATE), OUString(FM_PROP_DEFAULT_TIME),
- OUString(FM_PROP_DEFAULT_VALUE), OUString(FM_PROP_DEFAULT_SELECT_SEQ), OUString(FM_PROP_EFFECTIVE_DEFAULT)
+ static const OUStringLiteral pDefaultValueProperties[] = {
+ OUStringLiteral(FM_PROP_DEFAULT_TEXT), OUStringLiteral(FM_PROP_DEFAULTCHECKED), OUStringLiteral(FM_PROP_DEFAULT_DATE), OUStringLiteral(FM_PROP_DEFAULT_TIME),
+ OUStringLiteral(FM_PROP_DEFAULT_VALUE), OUStringLiteral(FM_PROP_DEFAULT_SELECT_SEQ), OUStringLiteral(FM_PROP_EFFECTIVE_DEFAULT)
};
- const OUString aValueProperties[] = {
- OUString(FM_PROP_TEXT), OUString(FM_PROP_STATE), OUString(FM_PROP_DATE), OUString(FM_PROP_TIME),
- OUString(FM_PROP_VALUE), OUString(FM_PROP_SELECT_SEQ), OUString(FM_PROP_EFFECTIVE_VALUE)
+ static const OUStringLiteral aValueProperties[] = {
+ OUStringLiteral(FM_PROP_TEXT), OUStringLiteral(FM_PROP_STATE), OUStringLiteral(FM_PROP_DATE), OUStringLiteral(FM_PROP_TIME),
+ OUStringLiteral(FM_PROP_VALUE), OUStringLiteral(FM_PROP_SELECT_SEQ), OUStringLiteral(FM_PROP_EFFECTIVE_VALUE)
};
sal_Int32 nDefaultValueProps = SAL_N_ELEMENTS(pDefaultValueProperties);
OSL_ENSURE(SAL_N_ELEMENTS(aValueProperties) == nDefaultValueProps,