diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 08:54:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 09:42:55 +0200 |
commit | 9c5c905680f7cb58eb3d0fbf25725a50c17896da (patch) | |
tree | d15a5bade5d44301a6292649a23ff65e219a8adb /forms/source | |
parent | ba7492ebe6f943976fc41274672ec41c035b4fbb (diff) |
clang-tidy modernize-use-emplace in editeng..framework
Change-Id: I7739c4f77c856d34f8484754244df13d8fef840e
Reviewed-on: https://gerrit.libreoffice.org/42151
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 24 | ||||
-rw-r--r-- | forms/source/component/ListBox.cxx | 4 | ||||
-rw-r--r-- | forms/source/solar/control/navtoolbar.cxx | 2 | ||||
-rw-r--r-- | forms/source/xforms/binding.cxx | 8 |
4 files changed, 18 insertions, 20 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 1aae5d88aa39..4c2b039442cc 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -570,7 +570,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc // <name>=<label> OUString aLabel; xComponentSet->getPropertyValue( PROPERTY_LABEL ) >>= aLabel; - rList.push_back( HtmlSuccessfulObj(aName, aLabel) ); + rList.emplace_back(aName, aLabel ); } } } break; @@ -594,7 +594,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc aLhs.append(".x"); else aLhs.append("x"); - rList.push_back( HtmlSuccessfulObj(aLhs.makeStringAndClear(), aRhs) ); + rList.emplace_back(aLhs.makeStringAndClear(), aRhs ); aLhs.append(aName); aRhs = OUString::number( MouseEvt.Y ); @@ -602,7 +602,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc aLhs.append(".y"); else aLhs.append("y"); - rList.push_back( HtmlSuccessfulObj(aLhs.makeStringAndClear(), aRhs) ); + rList.emplace_back(aLhs.makeStringAndClear(), aRhs ); } } } break; @@ -623,7 +623,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc if( hasProperty(PROPERTY_REFVALUE, xComponentSet) ) xComponentSet->getPropertyValue( PROPERTY_REFVALUE ) >>= aStrValue; - rList.push_back( HtmlSuccessfulObj(aName, aStrValue) ); + rList.emplace_back(aName, aStrValue ); } break; // Edit @@ -669,7 +669,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc else xComponentSet->getPropertyValue( PROPERTY_TEXT ) >>= sText; - rList.push_back( HtmlSuccessfulObj(aName, sText) ); + rList.emplace_back(aName, sText ); } break; // ComboBox, Patternfield @@ -681,7 +681,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc { OUString aText; xComponentSet->getPropertyValue( PROPERTY_TEXT ) >>= aText; - rList.push_back( HtmlSuccessfulObj(aName, aText) ); + rList.emplace_back(aName, aText ); } } break; case FormComponentType::CURRENCYFIELD: @@ -701,7 +701,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc xComponentSet->getPropertyValue( PROPERTY_DECIMAL_ACCURACY ) >>= nScale; aText = ::rtl::math::doubleToUString(aDoubleVal, rtl_math_StringFormat_F, nScale, '.', true); } - rList.push_back( HtmlSuccessfulObj(aName, aText) ); + rList.emplace_back(aName, aText ); } } break; case FormComponentType::DATEFIELD: @@ -724,7 +724,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc appendDigits( aDate.GetYear(), 4, aBuffer ); aText = aBuffer.makeStringAndClear(); } - rList.push_back( HtmlSuccessfulObj(aName, aText) ); + rList.emplace_back(aName, aText ); } } break; case FormComponentType::TIMEFIELD: @@ -747,7 +747,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc appendDigits( aTime.GetSec(), 2, aBuffer ); aText = aBuffer.makeStringAndClear(); } - rList.push_back( HtmlSuccessfulObj(aName, aText) ); + rList.emplace_back(aName, aText ); } } break; @@ -760,7 +760,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc { OUString aText; xComponentSet->getPropertyValue( PROPERTY_HIDDEN_VALUE ) >>= aText; - rList.push_back( HtmlSuccessfulObj(aName, aText) ); + rList.emplace_back(aName, aText ); } } break; @@ -773,7 +773,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc OUString aText; xComponentSet->getPropertyValue( PROPERTY_TEXT ) >>= aText; - rList.push_back( HtmlSuccessfulObj(aName, aText, SUCCESSFUL_REPRESENT_FILE) ); + rList.emplace_back(aName, aText, SUCCESSFUL_REPRESENT_FILE ); } } break; @@ -831,7 +831,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc { aSubValue = pStrings[nSelPos]; } - rList.push_back( HtmlSuccessfulObj(aName, aSubValue) ); + rList.emplace_back(aName, aSubValue ); } } break; case FormComponentType::GRIDCONTROL: diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 4da790559b6b..b8bd02146cd5 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -944,7 +944,7 @@ namespace frm while ( xListCursor->next() && ( entryPos++ < SHRT_MAX ) ) // SHRT_MAX is the maximum number of entries { aStr = aValueFormatter.getFormattedValue(); - aDisplayList.push_back( aStr ); + aDisplayList.emplace_back(aStr ); if(*aBoundColumn >= 0) aBoundValue.fill( *aBoundColumn + 1, m_nBoundColumnType, xCursorRow ); @@ -980,7 +980,7 @@ namespace frm // the type of i matters! It will be the type of the ORowSetValue pushed to aValueList! for(size_t i=0; i < aDisplayList.size(); ++i) { - aValueList.push_back(ORowSetValue(sal_Int16(i))); + aValueList.emplace_back(sal_Int16(i)); } } else diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index 981a711d085e..14ea335570d4 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -308,7 +308,7 @@ namespace frm pItemWindow->SetBackground(); pItemWindow->SetPaintTransparent(true); } - m_aChildWins.push_back( pItemWindow ); + m_aChildWins.emplace_back(pItemWindow ); switch ( pSupportedFeatures->nId ) { diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index cb045441cd97..247286ad643d 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -532,8 +532,7 @@ static void lcl_removeListenerFromNode( const Reference<XNode>& xNode, OSL_ENSURE( aIter->is(), "no node?" ); // create proper evaluation context for this MIP - aVector.push_back( EvaluationContext( *aIter, getModel(), - getBindingNamespaces() ) ); + aVector.emplace_back( *aIter, getModel(), getBindingNamespaces() ); } return aVector; } @@ -590,9 +589,8 @@ void Binding::bind( bool bForceRebind ) ++aIter ) maEventNodes.push_back( *aIter ); else - maEventNodes.push_back( - Reference<XNode>( aContext.mxContextNode->getOwnerDocument(), - UNO_QUERY_THROW ) ); + maEventNodes.emplace_back( aContext.mxContextNode->getOwnerDocument(), + UNO_QUERY_THROW ); for( PathExpression::NodeVector_t::iterator aIter2 = maEventNodes.begin(); aIter2 != maEventNodes.end(); ++aIter2 ) |