Kaydet (Commit) edc85fb5 authored tarafından Noel Grandin's avatar Noel Grandin

clang-tidy performance-unnecessary-copy-init in idl..reportdesign

Change-Id: I4b2eda375bbfe1ba35a45168515d885935adcb76
Reviewed-on: https://gerrit.libreoffice.org/62217
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 86cce134
......@@ -284,7 +284,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
if( rTok.IsIdentifier() )
{
OString aName = rTok.GetString();
const OString& aName = rTok.GetString();
for( const auto& aType : GetTypeList() )
{
if( aType->GetName() == aName )
......
......@@ -733,9 +733,8 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
}
if(nCmp == 1) // cur > next
{
rtl::Reference<VendorBase> less = next;
vec.at(j-1)= cur;
vec.at(j)= less;
vec.at(j)= next;
}
}
++cIter;
......
......@@ -45,7 +45,7 @@ static void checkStyleNames(const OString& aLanguage)
if( !aPoEntry.isFuzzy() && aPoEntry.getMsgCtxt().startsWith("STR_POOLCOLL") )
{
OString aMsgStr = aPoEntry.getMsgStr();
const OString& aMsgStr = aPoEntry.getMsgStr();
if( aMsgStr.isEmpty() )
continue;
if( aLocalizedStyleNames.find(aMsgStr) == aLocalizedStyleNames.end() )
......@@ -57,7 +57,7 @@ static void checkStyleNames(const OString& aLanguage)
}
if( !aPoEntry.isFuzzy() && aPoEntry.getMsgCtxt().startsWith("STR_POOLNUMRULE") )
{
OString aMsgStr = aPoEntry.getMsgStr();
const OString& aMsgStr = aPoEntry.getMsgStr();
if( aMsgStr.isEmpty() )
continue;
if( aLocalizedNumStyleNames.find(aMsgStr) == aLocalizedNumStyleNames.end() )
......@@ -163,7 +163,7 @@ static void checkFunctionNames(const OString& aLanguage)
break;
if( !aPoEntry.isFuzzy() && aPoEntry.getMsgCtxt() == "RID_STRLIST_FUNCTION_NAMES" )
{
OString aMsgStr = aPoEntry.getMsgStr();
const OString& aMsgStr = aPoEntry.getMsgStr();
if( aMsgStr.isEmpty() )
continue;
if( aLocalizedCoreFunctionNames.find(aMsgStr) == aLocalizedCoreFunctionNames.end() )
......
......@@ -405,12 +405,11 @@ void XRMResMerge::WorkOnDesc(
OString sDescFilename = GetAttribute ( rOpenTag, "xlink:href" );
for( size_t n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
OString sContent;
OString sText;
if ( !sCur.equalsIgnoreAsciiCase("en-US") &&
( pEntrys->GetText( sContent, sCur, true )) &&
!sContent.isEmpty())
( pEntrys->GetText( sText, sCur, true )) &&
!sText.isEmpty())
{
OString sText( sContent );
OString sAdditionalLine( "\n " );
sAdditionalLine += rOpenTag;
OString sSearch = sLangAttribute;
......@@ -498,7 +497,7 @@ void XRMResMerge::EndOfText(
!sContent.isEmpty() &&
helper::isWellFormedXML( sContent ))
{
OString sText( sContent );
const OString& sText( sContent );
OString sAdditionalLine( "\n " );
sAdditionalLine += rOpenTag;
OString sSearch = sLangAttribute;
......
......@@ -112,7 +112,7 @@ static void GetOldStyleDicsInDir(
continue;
// Thus we first get the language of the dictionary
OUString aLocaleName(aLangTag.getBcp47());
const OUString& aLocaleName(aLangTag.getBcp47());
if (aDicLangInUse.insert(aLocaleName).second)
{
......
......@@ -329,9 +329,8 @@ void ConvDicXMLExport::ExportContent_()
for (auto const& elem : rDic.aFromLeft)
aKeySet.insert( elem.first );
for (auto const& elem : aKeySet)
for (const OUString& aLeftText : aKeySet)
{
OUString aLeftText(elem);
AddAttribute( XML_NAMESPACE_TCD, "left-text", aLeftText );
if (rDic.pConvPropType) // property-type list available?
{
......@@ -348,10 +347,10 @@ void ConvDicXMLExport::ExportContent_()
"entry" , true, true );
pair< ConvMap::iterator, ConvMap::iterator > aRange =
rDic.aFromLeft.equal_range(elem);
rDic.aFromLeft.equal_range(aLeftText);
for (auto aIt = aRange.first; aIt != aRange.second; ++aIt)
{
DBG_ASSERT( elem == (*aIt).first, "key <-> entry mismatch" );
DBG_ASSERT( aLeftText == (*aIt).first, "key <-> entry mismatch" );
OUString aRightText( (*aIt).second );
SvXMLElementExport aEntryRightText( *this, XML_NAMESPACE_TCD,
"right-text" , true, false );
......
......@@ -220,7 +220,7 @@ void ShapeTemplateVisitor::visit(ShapeAtom& rAtom)
return;
}
ShapePtr pCurrShape(rAtom.getShapeTemplate());
const ShapePtr& pCurrShape(rAtom.getShapeTemplate());
// TODO(F3): cloned shape shares all properties by reference,
// don't change them!
......
......@@ -666,7 +666,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
XFastAttributeListRef(pAttrListSignatureLine));
// Get signature line graphic
const uno::Reference<graphic::XGraphic> xGraphic
const uno::Reference<graphic::XGraphic>& xGraphic
= pSdrGrafObj->getSignatureLineUnsignedGraphic();
Graphic aGraphic(xGraphic);
......
......@@ -105,7 +105,7 @@ static void ResolveTextFields( XmlFilterBase const & rFilter )
const oox::core::TextFieldStack& rTextFields = rFilter.getTextFieldStack();
if ( !rTextFields.empty() )
{
Reference< frame::XModel > xModel( rFilter.getModel() );
const Reference< frame::XModel >& xModel( rFilter.getModel() );
for (auto const& textField : rTextFields)
{
const OUString sURL = "URL";
......
......@@ -71,7 +71,7 @@ OptValue< double > lclDecodeOpacity( const AttributeList& rAttribs, sal_Int32 nT
if( oValue.has() )
{
const OUString aString(oValue.get());
const OUString& aString(oValue.get());
const sal_Int32 nLength(aString.getLength());
if(nLength > 0)
......
......@@ -75,7 +75,7 @@ uno::Reference< drawing::XShape > OReportDrawPage::CreateShape( SdrObject *pObj
if ( xFactory.is() )
{
bool bChangeOrientation = false;
OUString sServiceName = pBaseObj->getServiceName();
const OUString& sServiceName = pBaseObj->getServiceName();
OSL_ENSURE(!sServiceName.isEmpty(),"No Service Name given!");
if (dynamic_cast< const OUnoObject* >(pObj) != nullptr)
......
......@@ -404,7 +404,7 @@ void OObjectBase::SetPropsFromRect(const tools::Rectangle& _rRect)
OReportPage* pPage = dynamic_cast<OReportPage*>(GetImplPage());
if ( pPage && !_rRect.IsEmpty() )
{
uno::Reference<report::XSection> xSection = pPage->getSection();
const uno::Reference<report::XSection>& xSection = pPage->getSection();
assert(_rRect.getHeight() >= 0);
const sal_uInt32 newHeight( ::std::max(0l, _rRect.getHeight()+_rRect.Top()) );
if ( xSection.is() && ( newHeight > xSection->getHeight() ) )
......
......@@ -86,7 +86,7 @@ namespace rptui
bool bSet = true;
if ( aFormula.getType() == ReportFormula::Field )
{
const OUString sColumnName = aFormula.getFieldName();
const OUString& sColumnName = aFormula.getFieldName();
OUString sLabel = m_rReportController.getColumnLabel_throw(sColumnName);
if ( !sLabel.isEmpty() )
{
......
......@@ -716,7 +716,7 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,
{
bOnlyOnce = true;
OReportSection* pReportSection = aRectIter->second.second->getReportSection();
const uno::Reference< report::XSection> xSection = pReportSection->getSection();
const uno::Reference< report::XSection>& xSection = pReportSection->getSection();
try
{
uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
......
......@@ -446,7 +446,7 @@ void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj)
OObjectBase* pObj = dynamic_cast<OObjectBase*>(_pOverlappedObj);
if ( pObj )
{
uno::Reference<report::XReportComponent> xComponent = pObj->getReportComponent();
const uno::Reference<report::XReportComponent>& xComponent = pObj->getReportComponent();
if (xComponent.is() && xComponent != m_xOverlappingObj)
{
OReportModel& rRptModel(static_cast< OReportModel& >(_pOverlappedObj->getSdrModelFromSdrObject()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment