diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-21 14:23:23 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-16 06:30:09 +0000 |
commit | 127f70d66ac32b7a4ec818adaf1bdccb71865ee5 (patch) | |
tree | a020d2002c2eea81484297421f0fbe3ee84c2db0 /svx/source/fmcomp/fmgridif.cxx | |
parent | ce95e39f8e952159844e9dc04a1df402bb103634 (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/source/fmcomp/fmgridif.cxx')
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 21 |
1 files changed, 10 insertions, 11 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(); |