diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-23 10:22:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-23 13:23:42 +0200 |
commit | bf39807c67eb2dc7596926486a22d781e8969d47 (patch) | |
tree | 55adb68b8fa059dd3b68fcc0012cf7fe7de94794 /extensions | |
parent | 20e1822a2582d4207b13368b3521b9d42407ce69 (diff) |
loplugin:oncevar editeng..extensions
Change-Id: I3a63e3e3b873ef8a2d708d39be084124a6ad1346
Reviewed-on: https://gerrit.libreoffice.org/39153
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/abpilot/datasourcehandling.cxx | 3 | ||||
-rw-r--r-- | extensions/source/abpilot/fieldmappingimpl.cxx | 2 | ||||
-rw-r--r-- | extensions/source/bibliography/bibconfig.cxx | 24 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 6 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 6 | ||||
-rw-r--r-- | extensions/source/dbpilots/optiongrouplayouter.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/browserline.cxx | 4 |
7 files changed, 15 insertions, 34 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index b7a2c3492e7c..88abdcce660e 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -547,9 +547,8 @@ namespace abp // failure to create the interaction handler is a serious issue ... if (!xInteractions.is()) { - OUString s_sInteractionHandlerServiceName("com.sun.star.task.InteractionHandler"); if ( _pMessageParent ) - ShowServiceNotAvailableError( _pMessageParent, s_sInteractionHandlerServiceName, true ); + ShowServiceNotAvailableError( _pMessageParent, "com.sun.star.task.InteractionHandler", true ); return false; } diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx b/extensions/source/abpilot/fieldmappingimpl.cxx index 1aba04832332..392a613bd694 100644 --- a/extensions/source/abpilot/fieldmappingimpl.cxx +++ b/extensions/source/abpilot/fieldmappingimpl.cxx @@ -168,7 +168,7 @@ namespace abp DBG_ASSERT( 0 == SAL_N_ELEMENTS( pMappingProgrammatics ) % 2, "fieldmapping::defaultMapping: invalid programmatic map!" ); // number of pairs - sal_Int32 nIntersectedProgrammatics = SAL_N_ELEMENTS( pMappingProgrammatics ) / 2; + sal_Int32 const nIntersectedProgrammatics = SAL_N_ELEMENTS( pMappingProgrammatics ) / 2; const sal_Char** pProgrammatic = pMappingProgrammatics; OUString sAddressProgrammatic; diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx index af33237173ee..7eb7402429ee 100644 --- a/extensions/source/bibliography/bibconfig.cxx +++ b/extensions/source/bibliography/bibconfig.cxx @@ -124,9 +124,6 @@ BibConfig::BibConfig() } } } - OUString sName("DataSourceName"); - OUString sTable("Command"); - OUString sCommandType("CommandType"); Sequence< OUString > aNodeNames = GetNodeNames(cDataSourceHistory); const OUString* pNodeNames = aNodeNames.getConstArray(); for(sal_Int32 nNode = 0; nNode < aNodeNames.getLength(); nNode++) @@ -138,12 +135,9 @@ BibConfig::BibConfig() sPrefix += "/"; sPrefix += pNodeNames[nNode]; sPrefix += "/"; - pHistoryNames[0] = sPrefix; - pHistoryNames[0] += sName; - pHistoryNames[1] = sPrefix; - pHistoryNames[1] += sTable; - pHistoryNames[2] = sPrefix; - pHistoryNames[2] += sCommandType; + pHistoryNames[0] = sPrefix + "DataSourceName"; + pHistoryNames[1] = sPrefix + "Command"; + pHistoryNames[2] = sPrefix + "CommandType"; Sequence<Any> aHistoryValues = GetProperties( aHistoryNames ); const Any* pHistoryValues = aHistoryValues.getConstArray(); @@ -233,9 +227,6 @@ void BibConfig::ImplCommit() PropertyValue* pNodeValues = aNodeValues.getArray(); sal_Int32 nIndex = 0; - OUString sName("DataSourceName"); - OUString sTable("Command"); - OUString sCommandType("CommandType"); for(sal_Int32 i = 0; i < (sal_Int32)pMappingsArr->size(); i++) { const Mapping* pMapping = (*pMappingsArr)[i].get(); @@ -243,14 +234,11 @@ void BibConfig::ImplCommit() sPrefix += "/_"; sPrefix += OUString::number(i); sPrefix += "/"; - pNodeValues[nIndex].Name = sPrefix; - pNodeValues[nIndex].Name += sName; + pNodeValues[nIndex].Name = sPrefix + "DataSourceName"; pNodeValues[nIndex++].Value <<= pMapping->sURL; - pNodeValues[nIndex].Name = sPrefix; - pNodeValues[nIndex].Name += sTable; + pNodeValues[nIndex].Name = sPrefix + "Command"; pNodeValues[nIndex++].Value <<= pMapping->sTableName; - pNodeValues[nIndex].Name = sPrefix; - pNodeValues[nIndex].Name += sCommandType; + pNodeValues[nIndex].Name = sPrefix + "CommandType"; pNodeValues[nIndex++].Value <<= pMapping->nCommandType; SetSetProperties(cDataSourceHistory, aNodeValues); diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 3514fba2c249..9f7d29c84fd9 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -1447,13 +1447,12 @@ void BibDataManager::SetMeAsUidListener() Sequence< OUString > aFields(xFields->getElementNames()); const OUString* pFields = aFields.getConstArray(); sal_Int32 nCount=aFields.getLength(); - OUString StrUID(STR_UID); OUString theFieldName; for( sal_Int32 i=0; i<nCount; i++ ) { const OUString& rName = pFields[i]; - if (rName.equalsIgnoreAsciiCase(StrUID)) + if (rName.equalsIgnoreAsciiCase(STR_UID)) { theFieldName=pFields[i]; break; @@ -1490,13 +1489,12 @@ void BibDataManager::RemoveMeAsUidListener() Sequence< OUString > aFields(xFields->getElementNames()); const OUString* pFields = aFields.getConstArray(); sal_Int32 nCount=aFields.getLength(); - OUString StrUID(STR_UID); OUString theFieldName; for( sal_Int32 i=0; i<nCount; i++ ) { const OUString& rName = pFields[i]; - if (rName.equalsIgnoreAsciiCase(StrUID)) + if (rName.equalsIgnoreAsciiCase(STR_UID)) { theFieldName=pFields[i]; break; diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 6d4d476c173c..8bf34931d91a 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -155,11 +155,10 @@ namespace dbp const OUString* pItems = _rItems.getConstArray(); const OUString* pEnd = pItems + _rItems.getLength(); ::svt::WizardTypes::WizardState nPos; - sal_Int32 nIndex = 0; for (;pItems < pEnd; ++pItems) { nPos = _rList.InsertEntry(*pItems); - _rList.SetEntryData(nPos, reinterpret_cast<void*>(nIndex)); + _rList.SetEntryData(nPos, reinterpret_cast<void*>(0)); } } @@ -637,9 +636,8 @@ namespace dbp // the only thing we have at the moment is the label try { - OUString sLabelPropertyName("Label"); Reference< XPropertySetInfo > xInfo = m_aContext.xObjectModel->getPropertySetInfo(); - if (xInfo.is() && xInfo->hasPropertyByName(sLabelPropertyName)) + if (xInfo.is() && xInfo->hasPropertyByName("Label")) { OUString sControlLabel(_pSettings->sControlLabel); m_aContext.xObjectModel->setPropertyValue( diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx index b8c90319b4c9..c79359461233 100644 --- a/extensions/source/dbpilots/optiongrouplayouter.cxx +++ b/extensions/source/dbpilots/optiongrouplayouter.cxx @@ -75,8 +75,6 @@ namespace dbp // no. of buttons to create sal_Int32 nRadioButtons = _rSettings.aLabels.size(); - sal_Int32 nTopSpace = 0; - // the shape of the groupbox css::awt::Size aControlShapeSize = _rContext.xObjectShape->getSize(); // maybe need to adjust the size if the control shapes @@ -112,7 +110,7 @@ namespace dbp StringArray::const_iterator aValueIter = _rSettings.aValues.begin(); for (sal_Int32 i=0; i<nRadioButtons; ++i, ++aLabelIter, ++aValueIter) { - aButtonPosition.Y = aShapePosition.Y + (i+1) * nTempHeight + nTopSpace; + aButtonPosition.Y = aShapePosition.Y + (i+1) * nTempHeight; Reference< XPropertySet > xRadioModel( xDocFactory->createInstance("com.sun.star.form.component.RadioButton"), diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index 32c9cb680780..e345381733e9 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -268,7 +268,7 @@ namespace pcr // for Issue 69452 if (AllSettings::GetLayoutRTL()) { - sal_Unicode cRTL_mark = 0x200F; + sal_Unicode const cRTL_mark = 0x200F; aText.append( OUString(cRTL_mark) ); } @@ -284,7 +284,7 @@ namespace pcr // for Issue 69452 if (AllSettings::GetLayoutRTL()) { - sal_Unicode cRTL_mark = 0x200F; + sal_Unicode const cRTL_mark = 0x200F; sDisplayName = comphelper::string::stripEnd(sDisplayName, cRTL_mark); } |