diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-01 14:02:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-01 19:36:39 +0200 |
commit | 9bac19e37f5a432375d24e8f210bb58de9c31bd8 (patch) | |
tree | 5b48512eeef519279895381c90f0e247ee365628 /connectivity/source/commontools | |
parent | a2d3b5721fc723608cea13a78ce09f959d0b9b9f (diff) |
loplugin:reducevarscope in comphelper,connectivity
Change-Id: Ia70d4963fb892120cc8f79597b46a8fe67b540a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103762
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/ParameterSubstitution.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/commontools/TSkipDeletedSet.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 30 |
3 files changed, 18 insertions, 18 deletions
diff --git a/connectivity/source/commontools/ParameterSubstitution.cxx b/connectivity/source/commontools/ParameterSubstitution.cxx index 3a58fed70b09..ca96cf331406 100644 --- a/connectivity/source/commontools/ParameterSubstitution.cxx +++ b/connectivity/source/commontools/ParameterSubstitution.cxx @@ -66,11 +66,11 @@ namespace connectivity { OSQLParser aParser( m_xContext ); OUString sErrorMessage; - OUString sNewSql; std::unique_ptr<OSQLParseNode> pNode = aParser.parseTree(sErrorMessage,_sText); if(pNode) { // special handling for parameters OSQLParseNode::substituteParameterNames(pNode.get()); + OUString sNewSql; pNode->parseNodeToStr( sNewSql, xConnection ); sRet = sNewSql; } diff --git a/connectivity/source/commontools/TSkipDeletedSet.cxx b/connectivity/source/commontools/TSkipDeletedSet.cxx index d3ae392f7a09..701bd743f6c0 100644 --- a/connectivity/source/commontools/TSkipDeletedSet.cxx +++ b/connectivity/source/commontools/TSkipDeletedSet.cxx @@ -171,7 +171,7 @@ bool OSkipDeletedSet::moveAbsolute(sal_Int32 _nPos,bool _bRetrieveData) { // bookmark isn't known yet // start at the last known position - sal_Int32 nCurPos = 0,nLastBookmark = 1; + sal_Int32 nCurPos = 0; if ( m_aBookmarksPositions.empty() ) { bDataFound = m_pHelper->move(IResultSetHelper::FIRST, 0, _bRetrieveData ); @@ -185,7 +185,7 @@ bool OSkipDeletedSet::moveAbsolute(sal_Int32 _nPos,bool _bRetrieveData) } // if ( m_aBookmarksPositions.empty() ) else { - nLastBookmark = (*m_aBookmarksPositions.rbegin())/*->first*/; + sal_Int32 nLastBookmark = *m_aBookmarksPositions.rbegin()/*->first*/; nCurPos = /*(**/m_aBookmarksPositions.size()/*->second*/; nNewPos = nNewPos - nCurPos; bDataFound = m_pHelper->move(IResultSetHelper::BOOKMARK, nLastBookmark, _bRetrieveData); diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 7f2e418601e9..a94a99a6327c 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -917,7 +917,7 @@ Reference< XNumberFormatsSupplier> getNumberFormats( // ask the parent of the connection (should be a DatabaseAccess) Reference< XNumberFormatsSupplier> xReturn; Reference< XChild> xConnAsChild(_rxConn, UNO_QUERY); - OUString sPropFormatsSupplier( "NumberFormatsSupplier" ); + static const OUStringLiteral sPropFormatsSupplier( u"NumberFormatsSupplier" ); if (xConnAsChild.is()) { Reference< XPropertySet> xConnParentProps(xConnAsChild->getParent(), UNO_QUERY); @@ -952,20 +952,20 @@ try Property* pNewProps = aNewProperties.getArray(); - OUString sPropFormatsSupplier("FormatsSupplier"); - OUString sPropCurrencySymbol("CurrencySymbol"); - OUString sPropDecimals("Decimals"); - OUString sPropEffectiveMin("EffectiveMin"); - OUString sPropEffectiveMax("EffectiveMax"); - OUString sPropEffectiveDefault("EffectiveDefault"); - OUString sPropDefaultText("DefaultText"); - OUString sPropDefaultDate("DefaultDate"); - OUString sPropDefaultTime("DefaultTime"); - OUString sPropValueMin("ValueMin"); - OUString sPropValueMax("ValueMax"); - OUString sPropDecimalAccuracy("DecimalAccuracy"); - OUString sPropClassId("ClassId"); - OUString sFormattedServiceName( "com.sun.star.form.component.FormattedField" ); + static const OUStringLiteral sPropFormatsSupplier(u"FormatsSupplier"); + static const OUStringLiteral sPropCurrencySymbol(u"CurrencySymbol"); + static const OUStringLiteral sPropDecimals(u"Decimals"); + static const OUStringLiteral sPropEffectiveMin(u"EffectiveMin"); + static const OUStringLiteral sPropEffectiveMax(u"EffectiveMax"); + static const OUStringLiteral sPropEffectiveDefault(u"EffectiveDefault"); + static const OUStringLiteral sPropDefaultText(u"DefaultText"); + static const OUStringLiteral sPropDefaultDate(u"DefaultDate"); + static const OUStringLiteral sPropDefaultTime(u"DefaultTime"); + static const OUStringLiteral sPropValueMin(u"ValueMin"); + static const OUStringLiteral sPropValueMax(u"ValueMax"); + static const OUStringLiteral sPropDecimalAccuracy(u"DecimalAccuracy"); + static const OUStringLiteral sPropClassId(u"ClassId"); + static const OUStringLiteral sFormattedServiceName( u"com.sun.star.form.component.FormattedField" ); for (const Property& rOldProp : aOldProperties) { |