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

Revert "clang-tidy performance-move-const-arg"

This reverts commit 3d604d1c.

comments from sberg:

I assume dropping the std::move from aCurSel(std::move(aSel)) is caused
by performance-move-const-arg's warning "if std::move() is called with
an argument of a trivially-copyable type"
(<https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html>).

For my taste, that approach is too tightly tied to a class's current
implementation details, something that may change over time.  Imagine a
trivially copyable class C with a raw pointer member (where the
lifecycle of the pointed-to object is tracked by some higher-level,
likely broken protocol).  Now, that protocol is fixed and the raw
pointer member is replaced with a std::shared_ptr.  C is no longer
trivially copyable, and the dropped std::move would turn out to be
beneficial again.

(Also, if Clang and clang-tidy did implement the fixed rules for
trivially copyable classes from CWG1734/C++17, where a subset of a
trivially copyable class's copy/move members may be deleted, the above
rule to warn "if std::move() is called with an argument of a
trivially-copyable type" would no longer make sense as written; consider
a trivially copyable class whose copy ctor has been deleted.)

Change-Id: Icb91610e50ed98b8f55fe6323bdfa48c8cb9b4b9
Reviewed-on: https://gerrit.libreoffice.org/60166
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 161a7105
......@@ -116,11 +116,11 @@ VDataSeriesGroup::VDataSeriesGroup( std::unique_ptr<VDataSeries> pSeries )
m_aSeriesVector[0] = std::move(pSeries);
}
VDataSeriesGroup::VDataSeriesGroup(VDataSeriesGroup&& other)
: m_aSeriesVector(std::move(other.m_aSeriesVector))
, m_bMaxPointCountDirty(other.m_bMaxPointCountDirty)
, m_nMaxPointCount(other.m_nMaxPointCount)
, m_aListOfCachedYValues(std::move(other.m_aListOfCachedYValues))
VDataSeriesGroup::VDataSeriesGroup( VDataSeriesGroup&& other )
: m_aSeriesVector( std::move(other.m_aSeriesVector) )
, m_bMaxPointCountDirty( other.m_bMaxPointCountDirty )
, m_nMaxPointCount( std::move(other.m_nMaxPointCount) )
, m_aListOfCachedYValues( std::move(other.m_aListOfCachedYValues) )
{
}
......
......@@ -62,14 +62,14 @@ RtfImportInfo::~RtfImportInfo()
{
}
EditRTFParser::EditRTFParser(SvStream& rIn, EditSelection aSel, SfxItemPool& rAttrPool,
EditEngine* pEditEngine)
: SvxRTFParser(rAttrPool, rIn)
, aCurSel(aSel)
, mpEditEngine(pEditEngine)
, aRTFMapMode(MapUnit::MapTwip)
, nDefFont(0)
, bLastActionInsertParaBreak(false)
EditRTFParser::EditRTFParser(
SvStream& rIn, EditSelection aSel, SfxItemPool& rAttrPool, EditEngine* pEditEngine) :
SvxRTFParser(rAttrPool, rIn),
aCurSel(std::move(aSel)),
mpEditEngine(pEditEngine),
aRTFMapMode(MapUnit::MapTwip),
nDefFont(0),
bLastActionInsertParaBreak(false)
{
SetInsPos(EditPosition(mpEditEngine, &aCurSel));
......
......@@ -3236,15 +3236,15 @@ SvxBrushItem::SvxBrushItem(const SvxBrushItem& rItem)
}
SvxBrushItem::SvxBrushItem(SvxBrushItem&& rItem)
: SfxPoolItem(rItem)
, aColor(rItem.aColor)
, nShadingValue(rItem.nShadingValue)
: SfxPoolItem(std::move(rItem))
, aColor(std::move(rItem.aColor))
, nShadingValue(std::move(rItem.nShadingValue))
, xGraphicObject(std::move(rItem.xGraphicObject))
, nGraphicTransparency(rItem.nGraphicTransparency)
, nGraphicTransparency(std::move(rItem.nGraphicTransparency))
, maStrLink(std::move(rItem.maStrLink))
, maStrFilter(std::move(rItem.maStrFilter))
, eGraphicPos(rItem.eGraphicPos)
, bLoadAgain(rItem.bLoadAgain)
, eGraphicPos(std::move(rItem.eGraphicPos))
, bLoadAgain(std::move(rItem.bLoadAgain))
{
}
......@@ -3514,14 +3514,14 @@ SvxBrushItem& SvxBrushItem::operator=(const SvxBrushItem& rItem)
SvxBrushItem& SvxBrushItem::operator=(SvxBrushItem&& rItem)
{
aColor = rItem.aColor;
nShadingValue = rItem.nShadingValue;
aColor = std::move(rItem.aColor);
nShadingValue = std::move(rItem.nShadingValue);
xGraphicObject = std::move(rItem.xGraphicObject);
nGraphicTransparency = rItem.nGraphicTransparency;
nGraphicTransparency = std::move(rItem.nGraphicTransparency);
maStrLink = std::move(rItem.maStrLink);
maStrFilter = std::move(rItem.maStrFilter);
eGraphicPos = rItem.eGraphicPos;
bLoadAgain = rItem.bLoadAgain;
eGraphicPos = std::move(rItem.eGraphicPos);
bLoadAgain = std::move(rItem.bLoadAgain);
return *this;
}
......
......@@ -287,7 +287,7 @@ void SvxUnoTextRangeBase::attachField( std::unique_ptr<SvxFieldData> pData ) thr
if( pForwarder )
{
SvxFieldItem aField( std::move(pData), EE_FEATURE_FIELD );
pForwarder->QuickInsertField(aField, maSelection);
pForwarder->QuickInsertField( std::move(aField), maSelection );
}
}
......
......@@ -287,7 +287,7 @@ PoEntry& PoEntry::operator=(const PoEntry& rPo)
PoEntry& PoEntry::operator=(PoEntry&& rPo)
{
m_pGenPo = std::move(rPo.m_pGenPo);
m_bIsInitialized = rPo.m_bIsInitialized;
m_bIsInitialized = std::move(rPo.m_bIsInitialized);
return *this;
}
......
......@@ -43,7 +43,7 @@ namespace oox { namespace ppt {
LayoutFragmentHandler::LayoutFragmentHandler(XmlFilterBase& rFilter, const OUString& rFragmentPath,
const SlidePersistPtr& pMasterPersistPtr)
: SlideFragmentHandler(rFilter, rFragmentPath, pMasterPersistPtr, Layout)
: SlideFragmentHandler(rFilter, rFragmentPath, std::move(pMasterPersistPtr), Layout)
{
}
......
......@@ -296,7 +296,7 @@ void SwWrtShell::PopMode()
LeaveBlockMode();
m_bIns = m_pModeStack->bIns;
m_pModeStack = m_pModeStack->pNext;
m_pModeStack = std::move(m_pModeStack->pNext);
}
// Two methods for setting cursors: the first maps at the
......
......@@ -97,7 +97,7 @@ namespace utl
, m_xDirectAccess(std::move(_rSource.m_xDirectAccess))
, m_xReplaceAccess(std::move(_rSource.m_xReplaceAccess))
, m_xContainerAccess(std::move(_rSource.m_xContainerAccess))
, m_bEscapeNames(_rSource.m_bEscapeNames)
, m_bEscapeNames(std::move(_rSource.m_bEscapeNames))
{
Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
if (xConfigNodeComp.is())
......@@ -129,7 +129,7 @@ namespace utl
m_xDirectAccess = std::move(_rSource.m_xDirectAccess);
m_xContainerAccess = std::move(_rSource.m_xContainerAccess);
m_xReplaceAccess = std::move(_rSource.m_xReplaceAccess);
m_bEscapeNames = _rSource.m_bEscapeNames;
m_bEscapeNames = std::move(_rSource.m_bEscapeNames);
Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
if (xConfigNodeComp.is())
......
......@@ -221,7 +221,7 @@ Bitmap& Bitmap::operator=( const Bitmap& rBitmap )
Bitmap& Bitmap::operator=( Bitmap&& rBitmap )
{
maPrefSize = rBitmap.maPrefSize;
maPrefSize = std::move(rBitmap.maPrefSize);
maPrefMapMode = std::move(rBitmap.maPrefMapMode);
mxSalBmp = std::move(rBitmap.mxSalBmp);
......
......@@ -212,8 +212,8 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
}
ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic)
: maMetaFile(rImpGraphic.maMetaFile)
, maEx(rImpGraphic.maEx)
: maMetaFile(std::move(rImpGraphic.maMetaFile))
, maEx(std::move(rImpGraphic.maEx))
, maSwapInfo(std::move(rImpGraphic.maSwapInfo))
, mpAnimation(std::move(rImpGraphic.mpAnimation))
, mpContext(std::move(rImpGraphic.mpContext))
......@@ -226,8 +226,8 @@ ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic)
, maVectorGraphicData(std::move(rImpGraphic.maVectorGraphicData))
, mpPdfData(std::move(rImpGraphic.mpPdfData))
, maGraphicExternalLink(rImpGraphic.maGraphicExternalLink)
, maLastUsed(std::chrono::high_resolution_clock::now())
, mbPrepared(rImpGraphic.mbPrepared)
, maLastUsed (std::chrono::high_resolution_clock::now())
, mbPrepared (rImpGraphic.mbPrepared)
, mnPageNumber(rImpGraphic.mnPageNumber)
{
rImpGraphic.ImplClear();
......@@ -360,7 +360,7 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic)
{
sal_Int64 aOldSizeBytes = mnSizeBytes;
maMetaFile = rImpGraphic.maMetaFile;
maMetaFile = std::move(rImpGraphic.maMetaFile);
meType = rImpGraphic.meType;
mnSizeBytes = rImpGraphic.mnSizeBytes;
maSwapInfo = std::move(rImpGraphic.maSwapInfo);
......@@ -368,7 +368,7 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic)
mbDummyContext = rImpGraphic.mbDummyContext;
mnPageNumber = rImpGraphic.mnPageNumber;
mpAnimation = std::move(rImpGraphic.mpAnimation);
maEx = rImpGraphic.maEx;
maEx = std::move(rImpGraphic.maEx);
mbSwapOut = rImpGraphic.mbSwapOut;
mpSwapFile = std::move(rImpGraphic.mpSwapFile);
mpGfxLink = std::move(rImpGraphic.mpGfxLink);
......
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