summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-12 16:39:03 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-18 07:37:31 +0000
commit789055bc2acb4c71483fd60ea258d158bd5aec10 (patch)
tree7849de841a71f667a30b2a971ad0c3d406110396 /extensions
parent150ac9cf05ed9da6a2af5bc3f820280fd853e519 (diff)
clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/bibload.cxx10
-rw-r--r--extensions/source/bibliography/toolbar.cxx3
-rw-r--r--extensions/source/propctrlr/eformspropertyhandler.cxx2
-rw-r--r--extensions/source/propctrlr/stringrepresentation.cxx13
-rw-r--r--extensions/source/resource/oooresourceloader.cxx3
5 files changed, 13 insertions, 18 deletions
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 4c6929fe7b40..d60e21bf2af2 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -228,8 +228,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString
m_pBibMod = OpenBibModul();
- OUString aURLStr( rURL );
- OUString aPartName = aURLStr.getToken( 1, '/' );
+ OUString aPartName = rURL.getToken( 1, '/' );
Reference<XPropertySet> xPrSet(rFrame, UNO_QUERY);
if(xPrSet.is())
{
@@ -459,11 +458,10 @@ Any BibliographyLoader::getByName(const OUString& rName) throw
if (!xColumns.is())
return aRet;
- OUString sIdentifierMapping = pDatMan->GetIdentifierMapping();
- OUString sId = sIdentifierMapping;
+ const OUString sIdentifierMapping = pDatMan->GetIdentifierMapping();
Reference< sdb::XColumn > xColumn;
- if (xColumns->hasByName(sId))
- xColumn.set(*static_cast<Reference< XInterface > const *>(xColumns->getByName(sId).getValue()), UNO_QUERY);
+ if (xColumns->hasByName(sIdentifierMapping))
+ xColumn.set(*static_cast<Reference< XInterface > const *>(xColumns->getByName(sIdentifierMapping).getValue()), UNO_QUERY);
if (xColumn.is())
{
do
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index e2eb753e4f30..109c05b69816 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -481,8 +481,7 @@ IMPL_LINK_NOARG_TYPED( BibToolBar, SendSelHdl, Idle*, void )
PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
pPropertyVal[0].Name = "DataSourceName";
OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource->GetSelectEntry() ) );
- OUString aSelection = aEntry;
- pPropertyVal[0].Value <<= aSelection;
+ pPropertyVal[0].Value <<= aEntry;
SendDispatch(nTBC_LB_SOURCE, aPropVal);
}
diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx
index d4870a456f99..b63e96b0a2b2 100644
--- a/extensions/source/propctrlr/eformspropertyhandler.cxx
+++ b/extensions/source/propctrlr/eformspropertyhandler.cxx
@@ -501,7 +501,7 @@ namespace pcr
// the binding for the dialog to work with
Reference< XPropertySet > xBinding( m_pHelper->getCurrentBinding() );
// the aspect of the binding which the dialog should modify
- OUString sFacetName( _rPropertyName );
+ const OUString& sFacetName( _rPropertyName );
OSL_ENSURE( xModel.is() && xBinding.is() && !sFacetName.isEmpty(),
"EFormsPropertyHandler::onInteractivePropertySelection: something is missing for the dialog initialization!" );
diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx
index 8c0c9dfc0985..c570ef989549 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -527,48 +527,47 @@ bool StringRepresentation::convertStringToGenericValue( const OUString& _rString
{
uno::Type aElementType = ::comphelper::getSequenceElementType( _rTargetType );
- OUString aStr( _rStringRep );
switch ( aElementType.getTypeClass() )
{
case uno::TypeClass_STRING:
{
Sequence< OUString > aElements;
- splitComposedStringToSequence( aStr, aElements, StringIdentity() );
+ splitComposedStringToSequence( _rStringRep, aElements, StringIdentity() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_SHORT:
{
Sequence< sal_Int16 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_UNSIGNED_SHORT:
{
Sequence< sal_uInt16 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_LONG:
{
Sequence< sal_Int32 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_UNSIGNED_LONG:
{
Sequence< sal_uInt32 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_BYTE:
{
Sequence< sal_Int8 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
diff --git a/extensions/source/resource/oooresourceloader.cxx b/extensions/source/resource/oooresourceloader.cxx
index a79bfc4484e4..cc41be8f571c 100644
--- a/extensions/source/resource/oooresourceloader.cxx
+++ b/extensions/source/resource/oooresourceloader.cxx
@@ -177,8 +177,7 @@ namespace extensions { namespace resource
:m_aLocale( _rLocale )
,m_pResourceManager( nullptr )
{
- OUString sBaseName( _rBaseName );
- m_pResourceManager = new SimpleResMgr( OUStringToOString( sBaseName, RTL_TEXTENCODING_UTF8 ).getStr(),
+ m_pResourceManager = new SimpleResMgr( OUStringToOString( _rBaseName, RTL_TEXTENCODING_UTF8 ).getStr(),
LanguageTag( m_aLocale) );
if ( !m_pResourceManager->IsValid() )