cid#1545370 COPY_INSTEAD_OF_MOVE

and

cid#1545364 COPY_INSTEAD_OF_MOVE
cid#1545363 COPY_INSTEAD_OF_MOVE
cid#1545344 COPY_INSTEAD_OF_MOVE
cid#1545299 COPY_INSTEAD_OF_MOVE
cid#1545287 COPY_INSTEAD_OF_MOVE
cid#1545267 COPY_INSTEAD_OF_MOVE
cid#1545256 COPY_INSTEAD_OF_MOVE
cid#1545226 COPY_INSTEAD_OF_MOVE
cid#1545500 COPY_INSTEAD_OF_MOVE
cid#1545538 COPY_INSTEAD_OF_MOVE
cid#1545618 COPY_INSTEAD_OF_MOVE
cid#1545681 COPY_INSTEAD_OF_MOVE
cid#1545750 COPY_INSTEAD_OF_MOVE
cid#1545778 COPY_INSTEAD_OF_MOVE
cid#1545785 COPY_INSTEAD_OF_MOVE
cid#1545799 COPY_INSTEAD_OF_MOVE
cid#1545847 COPY_INSTEAD_OF_MOVE
cid#1545958 COPY_INSTEAD_OF_MOVE
cid#1545963 COPY_INSTEAD_OF_MOVE
cid#1545990 COPY_INSTEAD_OF_MOVE
cid#1546013 COPY_INSTEAD_OF_MOVE
cid#1546029 COPY_INSTEAD_OF_MOVE
cid#1546079 COPY_INSTEAD_OF_MOVE
cid#1546104 COPY_INSTEAD_OF_MOVE
cid#1546127 COPY_INSTEAD_OF_MOVE
cid#1546133 COPY_INSTEAD_OF_MOVE
cid#1546155 COPY_INSTEAD_OF_MOVE
cid#1546190 COPY_INSTEAD_OF_MOVE
cid#1546216 COPY_INSTEAD_OF_MOVE
cid#1546273 COPY_INSTEAD_OF_MOVE
cid#1546315 COPY_INSTEAD_OF_MOVE
cid#1546326 COPY_INSTEAD_OF_MOVE
cid#1546387 COPY_INSTEAD_OF_MOVE

accept some reasonable suggestions

Change-Id: I7b004086d490c7618d8fe7a21a53cfa8ac1f8408
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161748
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara 2024-01-07 16:24:23 +00:00
parent 7413b4ad50
commit 6342aa6c66
28 changed files with 54 additions and 56 deletions

View File

@ -65,7 +65,7 @@ void UndoElement::impl_toggleModelState()
// apply the previous snapshot to our model
m_pModelClone->applyToModel( m_xDocumentModel );
// remember the new snapshot, for the next toggle
m_pModelClone = pNewClone;
m_pModelClone = std::move(pNewClone);
}
void SAL_CALL UndoElement::undo( )

View File

@ -974,7 +974,7 @@ void VclProcessor2D::RenderTransparencePrimitive2D(
process(rTransCandidate.getTransparence());
// back to old color stack
maBColorModifierStack = aLastBColorModifierStack;
maBColorModifierStack = std::move(aLastBColorModifierStack);
// back to old OutDev
mpOutputDevice = pLastOutputDevice;

View File

@ -269,7 +269,7 @@ namespace drawinglayer::processor3d
// restore values
mbModulate = bOldModulate;
mbFilter = bOldFilter;
mpGeoTexSvx = pOldTex;
mpGeoTexSvx = std::move(pOldTex);
}
void DefaultProcessor3D::impRenderModifiedColorPrimitive3D(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate)

View File

@ -1322,7 +1322,7 @@ namespace emfio
void MtfTools::DrawRectWithBGColor(const tools::Rectangle& rRect)
{
WinMtfFillStyle aFillStyleBackup = maFillStyle;
bool aTransparentBackup = maLineStyle.bTransparent;
bool bTransparentBackup = maLineStyle.bTransparent;
BackgroundMode mnBkModeBackup = mnBkMode;
const tools::Polygon aPoly( rRect );
@ -1332,8 +1332,8 @@ namespace emfio
ImplSetNonPersistentLineColorTransparenz();
DrawPolygon(aPoly, false);
mnBkMode = mnBkModeBackup; // The rectangle needs to be always drawned even if mode is transparent
maFillStyle = aFillStyleBackup;
maLineStyle.bTransparent = aTransparentBackup;
maFillStyle = std::move(aFillStyleBackup);
maLineStyle.bTransparent = bTransparentBackup;
}
void MtfTools::DrawRect( const tools::Rectangle& rRect, bool bEdge )

View File

@ -1092,7 +1092,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
basegfx::B2DPolyPolygon aPolyPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLength, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
rSet.Put( XLineStartWidthItem( nArrowWidth ) );
rSet.Put( XLineStartItem( aArrowName, aPolyPoly) );
rSet.Put( XLineStartItem( std::move(aArrowName), std::move(aPolyPoly)) );
rSet.Put( XLineStartCenterItem( bArrowCenter ) );
}

View File

@ -121,7 +121,7 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
mpCurrentNode = pNewNode;
// set new parent for children
ShapePtr pPreviousParent(mpParentShape);
ShapePtr xPreviousParent(mpParentShape);
mpParentShape = pCurrParent;
// process children
@ -133,7 +133,7 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
meLookFor = LAYOUT_NODE;
// restore parent
mpParentShape = pPreviousParent;
mpParentShape = std::move(xPreviousParent);
mpCurrentNode = pPreviousNode;
}

View File

@ -456,13 +456,15 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange ) const
// present we assume the permission to edit is not granted. Until we
// actually can evaluate the descriptors...
auto lIsEditable = [rRange](const ScEnhancedProtection& rEnhancedProtection) {
return !rEnhancedProtection.hasSecurityDescriptor()
&& rEnhancedProtection.maRangeList.is() && rEnhancedProtection.maRangeList->Contains( rRange)
&& !rEnhancedProtection.hasPassword(); // Range is editable if no password is assigned.
};
if (std::any_of(maEnhancedProtection.begin(), maEnhancedProtection.end(), lIsEditable))
return true;
{
auto lIsEditable = [rRange](const ScEnhancedProtection& rEnhancedProtection) {
return !rEnhancedProtection.hasSecurityDescriptor()
&& rEnhancedProtection.maRangeList.is() && rEnhancedProtection.maRangeList->Contains( rRange)
&& !rEnhancedProtection.hasPassword(); // Range is editable if no password is assigned.
};
if (std::any_of(maEnhancedProtection.begin(), maEnhancedProtection.end(), std::move(lIsEditable)))
return true;
}
// For a single address, a simple check with single ranges was sufficient.
if (rRange.aStart == rRange.aEnd)

View File

@ -1330,11 +1330,8 @@ bool ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r
rDesc.pDefArgFlags[nArg].bOptional = pArgs[nArg].bOptional;
// no empty names...
if ( rDesc.maDefArgNames[nArg].isEmpty() )
{
OUString aDefName = "arg" + OUString::number( nArg+1 );
rDesc.maDefArgNames[nArg] = aDefName;
}
if (rDesc.maDefArgNames[nArg].isEmpty())
rDesc.maDefArgNames[nArg] = "arg" + OUString::number(nArg + 1);
// last argument repeated?
if ( nArg+1 == nArgCount && ( pArgs[nArg].eType == SC_ADDINARG_VARARGS ) )

View File

@ -2596,7 +2596,8 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
pSet->Put( SfxUInt16Item( SID_UPDATEDOCMODE, css::document::UpdateDocMode::FULL_UPDATE));
}
unique_ptr<SfxMedium> pMedium(new SfxMedium(aFile, StreamMode::STD_READ, pFilter, std::move(pSet)));
unique_ptr<SfxMedium> pMedium(new SfxMedium(aFile, StreamMode::STD_READ,
std::move(pFilter), std::move(pSet)));
if (pMedium->GetErrorIgnoreWarning() != ERRCODE_NONE)
return nullptr;

View File

@ -1214,8 +1214,7 @@ void ScDBFunc::GroupDataPilot()
}
OUString aGroupDimName = pGroupDimension->GetGroupDimName();
OUString aGroupName = pGroupDimension->CreateGroupName(ScResId(STR_PIVOT_GROUP));
ScDPSaveGroupItem aGroup( aGroupName );
ScDPSaveGroupItem aGroup(pGroupDimension->CreateGroupName(ScResId(STR_PIVOT_GROUP)));
for (const OUString& aEntryName : aEntries)
{
if ( pBaseGroupDim )

View File

@ -167,9 +167,8 @@ bool SdGRFFilter::Import()
}
for (size_t nPageIndex = 0; nPageIndex < nImages; ++nPageIndex)
{
Graphic pGraphic = aAnim.Get(nPageIndex).maBitmapEx;
SdPage* pPage = mrDocument.GetSdPage(nPageIndex, PageKind::Standard);
InsertSdrGrafObj(pGraphic, pPage);
InsertSdrGrafObj(aAnim.Get(nPageIndex).maBitmapEx,
mrDocument.GetSdPage(nPageIndex, PageKind::Standard));
}
}
else

View File

@ -489,7 +489,7 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
}
}
maDocShellRef = aOldRef;
maDocShellRef = std::move(aOldRef);
}
else if( nFormat == SotClipboardFormatId::GDIMETAFILE )
{

View File

@ -2713,7 +2713,8 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
// create a medium as a copy; this medium is only for writing, because it
// uses the same name as the original one writing is done through a copy,
// that will be transferred to the target (of course after calling HandsOff)
SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pFilter, std::move(pSet) );
SfxMedium* pMediumTmp = new SfxMedium(pRetrMedium->GetName(), pRetrMedium->GetOpenMode(),
std::move(pFilter), std::move(pSet));
pMediumTmp->SetInCheckIn( pRetrMedium->IsInCheckIn( ) );
pMediumTmp->SetLongName( pRetrMedium->GetLongName() );
if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE )

View File

@ -191,9 +191,9 @@ void AccessibilityIssue::gotoIssue() const
SwPosition aMark(*pContentNode, TempIssueObject.m_nEnd);
pWrtShell->StartAllAction();
SwPaM* pPaM = pWrtShell->GetCursor();
*pPaM->GetPoint() = aPoint;
*pPaM->GetPoint() = std::move(aPoint);
pPaM->SetMark();
*pPaM->GetMark() = aMark;
*pPaM->GetMark() = std::move(aMark);
pWrtShell->EndAllAction();
// bring issue to attention

View File

@ -618,7 +618,7 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
}
OUString aStr = rRuby.GetText().copy( sal_Int32(nOffs) );
SwFieldPortion *pField = new SwFieldPortion( aStr, std::move(pRubyFont) );
SwFieldPortion *pField = new SwFieldPortion( std::move(aStr), std::move(pRubyFont) );
pField->SetNextOffset( nOffs );
pField->SetFollow( true );

View File

@ -2365,7 +2365,7 @@ bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
m_pTableCursor->GetPoint() : m_pTableCursor->GetMark();
if (pPos)
{
*pPos = aNewPos;
*pPos = std::move(aNewPos);
}
else {
OSL_FAIL( "neither point nor mark available for change" );

View File

@ -1167,7 +1167,7 @@ SwXParagraph::setPropertyToDefault(const OUString& rPropertyName)
}
pTemp->SetMark();
*pTemp->GetPoint() = aEnd;
*pTemp->GetPoint() = std::move(aEnd);
SwUnoCursorHelper::SelectPam(*pTemp, true);

View File

@ -3761,9 +3761,9 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
}
SwAttrSet aEmptySet(m_pDocShell->GetDoc()->GetAttrPool(), pRange);
auto pSet = PropValuesToAutoStyleItemSet(*m_pDocShell->GetDoc(), m_eFamily, Values, aEmptySet);
auto xSet = PropValuesToAutoStyleItemSet(*m_pDocShell->GetDoc(), m_eFamily, Values, aEmptySet);
uno::Reference<style::XAutoStyle> xRet = new SwXAutoStyle(m_pDocShell->GetDoc(), pSet, m_eFamily);
uno::Reference<style::XAutoStyle> xRet = new SwXAutoStyle(m_pDocShell->GetDoc(), std::move(xSet), m_eFamily);
return xRet;
}

View File

@ -1171,7 +1171,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
spawned from within the VML & DML block and alter
the contents.
*/
ww8::WW8TableInfo::Pointer_t pOldTableInfo = m_rExport.m_pTableInfo;
ww8::WW8TableInfo::Pointer_t xOldTableInfo = m_rExport.m_pTableInfo;
//Reset the table infos after saving.
m_rExport.m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
@ -1198,7 +1198,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
DocxTableExportContext aVMLTableExportContext(*this);
m_rExport.SdrExporter().writeVMLTextFrame(&aFrame);
}
m_rExport.m_pTableInfo = pOldTableInfo;
m_rExport.m_pTableInfo = std::move(xOldTableInfo);
m_pSerializer->endElementNS(XML_mc, XML_Fallback);
m_pSerializer->endElementNS(XML_mc, XML_AlternateContent);

View File

@ -1962,7 +1962,7 @@ void RtfAttributeOutput::WriteHeaderFooter_Impl(const SwFrameFormat& rFormat, bo
m_aSectionHeaders.append('}');
m_aSectionBreaks = aSectionBreaks;
m_aRun = aRun;
m_aRun = std::move(aRun);
}
namespace
@ -3061,7 +3061,7 @@ void RtfAttributeOutput::TextFootnote_Impl(const SwFormatFootnote& rFootnote)
m_bBufferSectionHeaders = false;
m_bInRun = bInRunOrig;
m_bSingleEmptyRun = bSingleEmptyRunOrig;
m_aRun = aRun;
m_aRun = std::move(aRun);
m_aRun->append(m_aSectionHeaders);
m_aSectionHeaders.setLength(0);

View File

@ -2310,7 +2310,7 @@ void SwWW8ImplReader::Read_HdFtText(WW8_CP nStart, WW8_CP nLen, SwFrameFormat co
Read_HdFtFootnoteText(pSttIdx, nStart, nLen - 1, MAN_HDFT);
*m_pPaM->GetPoint() = aTmpPos;
*m_pPaM->GetPoint() = std::move(aTmpPos);
}
bool SwWW8ImplReader::isValid_HdFt_CP(WW8_CP nHeaderCP) const
@ -4573,7 +4573,7 @@ void wwSectionManager::InsertSegments()
// create a new following page style
SwFormatPageDesc aFollow(SetSwFormatPageDesc(aIter, aStart, bIgnoreCols));
// restore any contents of aIter trashed by SetSwFormatPageDesc
*aIter = aTmpSection;
*aIter = std::move(aTmpSection);
// Handle the section break
UseOnPage eUseOnPage = UseOnPage::Left;

View File

@ -309,9 +309,9 @@ sal_uInt16 SwWW8ImplReader::End_Footnote()
}
}
*m_pPaM->GetPoint() = aTmpPos; // restore Cursor
*m_pPaM->GetPoint() = std::move(aTmpPos); // restore Cursor
m_xPlcxMan = xOldPlcxMan; // Restore attributes
m_xPlcxMan = std::move(xOldPlcxMan); // Restore attributes
m_xPlcxMan->RestoreAllPLCFx( aSave );
}
@ -1058,7 +1058,7 @@ void SwWW8ImplReader::StopAnlToRestart(sal_uInt8 nNewType, bool bGoBack)
SwPosition aTmpPos(*m_pPaM->GetPoint());
m_pPaM->Move(fnMoveBackward, GoInContent);
m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE);
*m_pPaM->GetPoint() = aTmpPos;
*m_pPaM->GetPoint() = std::move(aTmpPos);
}
else
m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE);

View File

@ -88,7 +88,7 @@ void SwFieldEditDlg::EnsureSelection(SwField *pCurField, SwFieldMgr &rMgr)
if (bSelectionFailed)
{
pCursor->DeleteMark();
*pCursor->GetPoint() = aOrigPos;
*pCursor->GetPoint() = std::move(aOrigPos);
}
}

View File

@ -252,7 +252,7 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow )
pClient.disposeAndClear();
}
pChild = pNextChild;
pChild = std::move(pNextChild);
}
// find system windows...
@ -271,7 +271,7 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow )
xComp->dispose();
}
pOverlap = pNextOverlap;
pOverlap = std::move(pNextOverlap);
}
}
@ -308,11 +308,10 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow )
VclPtr< vcl::Window > pNextTopChild = pTopWindowChild->GetWindow( GetWindowType::NextTopWindowSibling );
pTopWindowChild.disposeAndClear();
pTopWindowChild = pNextTopChild;
pTopWindowChild = std::move(pNextTopChild);
}
}
css::uno::Reference< css::accessibility::XAccessible > UnoWrapper::CreateAccessible( Menu* pMenu, bool bIsMenuBar )
{
return maAccessibleFactoryAccess.getFactory().createAccessible( pMenu, bIsMenuBar );

View File

@ -1151,7 +1151,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt
// restore orig font settings
pSalLayout->InitFont();
rLayoutArgs.maRuns = aLayoutRuns;
rLayoutArgs.maRuns = std::move(aLayoutRuns);
return pSalLayout;
}

View File

@ -116,7 +116,7 @@ void OOXMLDocumentImpl::resolveFastSubStream(Stream & rStreamHandler,
}
}
mpStream = savedStream;
mpStream = std::move(savedStream);
}
void OOXMLDocumentImpl::resolveFastSubStreamWithId(Stream & rStream,
@ -248,7 +248,8 @@ OOXMLDocumentImpl::getSubStream(const OUString & rId)
OOXMLDocumentImpl * pTemp;
// Do not pass status indicator to sub-streams: they are typically marginal in size, so we just track the main document for now.
writerfilter::Reference<Stream>::Pointer_t pRet( pTemp = new OOXMLDocumentImpl(pStream, uno::Reference<task::XStatusIndicator>(), mbSkipImages, maMediaDescriptor));
writerfilter::Reference<Stream>::Pointer_t pRet( pTemp =
new OOXMLDocumentImpl(std::move(pStream), uno::Reference<task::XStatusIndicator>(), mbSkipImages, maMediaDescriptor));
pTemp->setModel(mxModel);
pTemp->setDrawPage(mxDrawPage);
pTemp->mbIsSubstream = true;

View File

@ -1203,9 +1203,8 @@ OOXMLFastContextHandlerPropertyTable::~OOXMLFastContextHandlerPropertyTable()
void OOXMLFastContextHandlerPropertyTable::lcl_endFastElement
(Token_t /*Element*/)
{
OOXMLPropertySet::Pointer_t pPropSet(mpPropertySet->clone());
OOXMLTable::ValuePointer_t pTmpVal
(new OOXMLPropertySetValue(pPropSet));
(new OOXMLPropertySetValue(mpPropertySet->clone()));
mTable.add(pTmpVal);

View File

@ -1784,7 +1784,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, RTFSprms* const pSprms,
m_aStates.top().getShape() = std::get<1>(aTuple)->getShape();
m_pSdrImport->resolve(std::get<1>(aTuple)->getShape(), true, RTFSdrImport::SHAPE);
m_aStates.top().getShape() = aShape;
m_aStates.top().getShape() = std::move(aShape);
m_aStates.top().setCurrentBuffer(pCurrentBuffer);
}
else if (std::get<0>(aTuple) == BUFFER_ENDSHAPE)