Merge branch 'move' into 'master'

Move local variables in GUI code

See merge request OpenMW/openmw!3758
pull/3233/head
psi29a 12 months ago
commit a0890259e1

@ -395,8 +395,10 @@ namespace MWGui
{ {
std::string suggestedName = mAlchemy->suggestPotionName(); std::string suggestedName = mAlchemy->suggestPotionName();
if (suggestedName != mSuggestedPotionName) if (suggestedName != mSuggestedPotionName)
{
mNameEdit->setCaptionWithReplacing(suggestedName); mNameEdit->setCaptionWithReplacing(suggestedName);
mSuggestedPotionName = suggestedName; mSuggestedPotionName = std::move(suggestedName);
}
mSortModel->clearDragItems(); mSortModel->clearDragItems();

@ -1065,7 +1065,7 @@ namespace MWGui
{ {
createActiveFormats(newBook); createActiveFormats(newBook);
mBook = newBook; mBook = std::move(newBook);
setPage(newPage); setPage(newPage);
if (newPage < mBook->mPages.size()) if (newPage < mBook->mPages.size())

@ -440,7 +440,7 @@ namespace MWGui
// If new search term reset position, otherwise continue from current position // If new search term reset position, otherwise continue from current position
if (newSearchTerm != mCurrentSearchTerm) if (newSearchTerm != mCurrentSearchTerm)
{ {
mCurrentSearchTerm = newSearchTerm; mCurrentSearchTerm = std::move(newSearchTerm);
mCurrentOccurrenceIndex = std::string::npos; mCurrentOccurrenceIndex = std::string::npos;
} }

@ -221,7 +221,7 @@ namespace MWGui::Formatting
} }
} }
mAttributes[key] = value; mAttributes[key] = std::move(value);
} }
} }

@ -472,7 +472,7 @@ namespace MWGui
ESM::EffectList effectList; ESM::EffectList effectList;
effectList.mList = mEffects; effectList.mList = mEffects;
mSpell.mEffects = effectList; mSpell.mEffects = std::move(effectList);
mSpell.mData.mCost = int(y); mSpell.mData.mCost = int(y);
mSpell.mData.mType = ESM::Spell::ST_Spell; mSpell.mData.mType = ESM::Spell::ST_Spell;
mSpell.mData.mFlags = 0; mSpell.mData.mFlags = 0;

@ -172,7 +172,7 @@ namespace MWGui
w += 16; w += 16;
ToolTipInfo* tooltipInfo = image->getUserData<ToolTipInfo>(); ToolTipInfo* tooltipInfo = image->getUserData<ToolTipInfo>();
tooltipInfo->text = sourcesDescription; tooltipInfo->text = std::move(sourcesDescription);
// Fade out // Fade out
if (totalDuration >= fadeTime && fadeTime > 0.f) if (totalDuration >= fadeTime && fadeTime > 0.f)

@ -251,7 +251,7 @@ namespace MWGui
if (!cost.empty() && cost != "0") if (!cost.empty() && cost != "0")
info.text info.text
+= MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}"); += MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}");
info.effects = effects; info.effects = std::move(effects);
tooltipSize = createToolTip(info); tooltipSize = createToolTip(info);
} }
else if (type == "Layout") else if (type == "Layout")

Loading…
Cancel
Save