cid#1546354 COPY_INSTEAD_OF_MOVE

and

cid#1546319 COPY_INSTEAD_OF_MOVE
cid#1546286 COPY_INSTEAD_OF_MOVE
cid#1546283 COPY_INSTEAD_OF_MOVE
cid#1546191 COPY_INSTEAD_OF_MOVE
cid#1545953 COPY_INSTEAD_OF_MOVE
cid#1545874 COPY_INSTEAD_OF_MOVE
cid#1545857 COPY_INSTEAD_OF_MOVE
cid#1545781 COPY_INSTEAD_OF_MOVE
cid#1545765 COPY_INSTEAD_OF_MOVE
cid#1545546 COPY_INSTEAD_OF_MOVE
cid#1545338 COPY_INSTEAD_OF_MOVE
cid#1545190 COPY_INSTEAD_OF_MOVE
cid#1545272 COPY_INSTEAD_OF_MOVE
cid#1545242 COPY_INSTEAD_OF_MOVE
cid#1545229 COPY_INSTEAD_OF_MOVE

Change-Id: I88813d9dbd87ce10375db8198028f8b70e23f0fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162027
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2024-01-13 22:53:50 +01:00
parent d396391854
commit 0cfb4aa262
14 changed files with 57 additions and 48 deletions
+12 -9
View File
@@ -159,17 +159,20 @@ ChartModel::ChartModel( const ChartModel & rOther )
if (rOther.m_xDiagram.is())
xNewDiagram = new ::chart::Diagram( *rOther.m_xDiagram );
rtl::Reference< ::chart::PageBackground > xNewPageBackground = new PageBackground( *rOther.m_xPageBackground );
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager; // does not implement XCloneable
rtl::Reference< ::chart::NameContainer > xXMLNamespaceMap = new NameContainer( *rOther.m_xXMLNamespaceMap );
{
MutexGuard aGuard( m_aModelMutex );
xListener = this;
m_xTitle = xNewTitle;
m_xDiagram = xNewDiagram;
m_xPageBackground = xNewPageBackground;
m_xChartTypeManager = xChartTypeManager;
m_xXMLNamespaceMap = xXMLNamespaceMap;
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager; // does not implement XCloneable
rtl::Reference< ::chart::NameContainer > xXMLNamespaceMap = new NameContainer( *rOther.m_xXMLNamespaceMap );
{
MutexGuard aGuard( m_aModelMutex );
xListener = this;
m_xTitle = xNewTitle;
m_xDiagram = xNewDiagram;
m_xPageBackground = std::move(xNewPageBackground);
m_xChartTypeManager = std::move(xChartTypeManager);
m_xXMLNamespaceMap = std::move(xXMLNamespaceMap);
}
}
ModifyListenerHelper::addListener( xNewTitle, xListener );
+2 -2
View File
@@ -1098,11 +1098,11 @@ static bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
std::vector< rtl::Reference< DataSeries > > aOtherSeriesList = xOtherChartType->getDataSeries2();
if( !aOtherSeriesList.empty() )
{
rtl::Reference< DataSeries > xExchangeSeries( aOtherSeriesList[0] );
rtl::Reference<DataSeries> xExchangeSeries(aOtherSeriesList[0]);
aOtherSeriesList[0] = xGivenDataSeries;
xOtherChartType->setDataSeries(aOtherSeriesList);
aSeriesList[nOldSeriesIndex]=xExchangeSeries;
aSeriesList[nOldSeriesIndex] = std::move(xExchangeSeries);
xCurrentChartType->setDataSeries(aSeriesList);
}
}
@@ -200,9 +200,7 @@ void CandleStickChart::createShapes()
drawing::Position3D aPosMiddleMinimum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Min ,0 ,true ) );
drawing::Position3D aPosMiddleMaximum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Max ,0 ,true ) );
rtl::Reference<SvxShapeGroupAnyD> xLossGainTarget( xGainTarget );
if(bBlack)
xLossGainTarget = xLossTarget;
rtl::Reference<SvxShapeGroupAnyD> xLossGainTarget(bBlack ? xLossTarget : xGainTarget);
uno::Reference< beans::XPropertySet > xPointProp( pSeries->getPropertiesOfPoint( nIndex ));
rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes;
@@ -591,8 +591,8 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const OUString& _rU
{
const OUString sDriverFactoryName = m_aDriverConfig.getDriverFactoryName(_rURL);
EqualDriverAccessToName aEqual(sDriverFactoryName);
DriverAccessArray::const_iterator aFind = std::find_if(m_aDriversBS.begin(),m_aDriversBS.end(),aEqual);
DriverAccessArray::const_iterator aFind = std::find_if(m_aDriversBS.begin(), m_aDriversBS.end(),
EqualDriverAccessToName(sDriverFactoryName));
if ( aFind == m_aDriversBS.end() )
{
// search all bootstrapped drivers
+10 -8
View File
@@ -800,15 +800,17 @@ void SAL_CALL XFrameImpl::initialize( const css::uno::Reference< css::awt::XWind
// create progress helper
css::uno::Reference< css::frame::XFrame > xThis (this);
css::uno::Reference< css::task::XStatusIndicatorFactory > xIndicatorFactory =
css::task::StatusIndicatorFactory::createWithFrame(m_xContext, xThis,
false/*DisableReschedule*/, true/*AllowParentShow*/ );
{
css::uno::Reference< css::task::XStatusIndicatorFactory > xIndicatorFactory =
css::task::StatusIndicatorFactory::createWithFrame(m_xContext, xThis,
false/*DisableReschedule*/, true/*AllowParentShow*/ );
// SAFE -> ----------------------------------
aWriteLock.reset();
m_xIndicatorFactoryHelper = xIndicatorFactory;
aWriteLock.clear();
// <- SAFE ----------------------------------
// SAFE -> ----------------------------------
aWriteLock.reset();
m_xIndicatorFactoryHelper = std::move(xIndicatorFactory);
aWriteLock.clear();
// <- SAFE ----------------------------------
}
// Start listening for events after setting it on helper class ...
// So superfluous messages are filtered to NULL :-)
+3 -3
View File
@@ -58,9 +58,9 @@ public:
skips all elements that are empty references. */
template< typename FunctorType >
void forEach( FunctorType aFunctor ) const
{
::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) );
}
{
std::for_each(this->begin(), this->end(), ForEachFunctor<FunctorType>(std::move(aFunctor)));
}
/** Calls the passed member function of ObjType on every contained object,
automatically skips all elements that are empty references. */
+2 -2
View File
@@ -162,11 +162,11 @@ bool VbaProject::importVbaProject( StorageBase& rVbaPrjStrg )
Reference< css::frame::XController > xController = mxDocModel->getCurrentController();
xFrame = xController.is() ? xController->getFrame() : nullptr;
}
StorageRef noStorage;
// if the GraphicHelper tries to use noStorage it will of course crash
// but... this shouldn't happen as there is no reason for GraphicHelper
// to do that when importing VBA projects
GraphicHelper grfHlp( mxContext, xFrame, noStorage );
GraphicHelper grfHlp(mxContext, xFrame, StorageRef());
importVbaProject( rVbaPrjStrg, grfHlp );
// return true if something has been imported
return (mxBasicLib.is() && mxBasicLib->hasElements()) ||
+5 -3
View File
@@ -2374,15 +2374,17 @@ bool ScColumn::UpdateReference( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc
// Check the row positions at which the group must be split per relative
// references.
UpdateRefGroupBoundChecker aBoundChecker(rCxt, aBounds);
std::for_each(maCells.begin(), maCells.end(), aBoundChecker);
{
UpdateRefGroupBoundChecker aBoundChecker(rCxt, aBounds);
std::for_each(maCells.begin(), maCells.end(), std::move(aBoundChecker));
}
// If expand reference edges is on, splitting groups may happen anywhere
// where a reference points to an adjacent row of the insertion.
if (rCxt.mnRowDelta > 0 && rCxt.mrDoc.IsExpandRefs())
{
UpdateRefExpandGroupBoundChecker aExpandChecker(rCxt, aBounds);
std::for_each(maCells.begin(), maCells.end(), aExpandChecker);
std::for_each(maCells.begin(), maCells.end(), std::move(aExpandChecker));
}
// Do the actual splitting.
+8 -4
View File
@@ -1043,8 +1043,10 @@ void ScTable::SortReorderByColumn(
// once.
std::sort(aListeners.begin(), aListeners.end());
aListeners.erase(std::unique(aListeners.begin(), aListeners.end()), aListeners.end());
ReorderNotifier<sc::RefColReorderHint, sc::ColRowReorderMapType, SCCOL> aFunc(aColMap, nTab, nRow1, nRow2);
std::for_each(aListeners.begin(), aListeners.end(), aFunc);
{
ReorderNotifier<sc::RefColReorderHint, sc::ColRowReorderMapType, SCCOL> aFunc(aColMap, nTab, nRow1, nRow2);
std::for_each(aListeners.begin(), aListeners.end(), std::move(aFunc));
}
// Re-start area listeners on the reordered columns.
{
@@ -1474,8 +1476,10 @@ void ScTable::SortReorderByRowRefUpdate(
}
// Notify the listeners to update their references.
ReorderNotifier<sc::RefRowReorderHint, sc::ColRowReorderMapType, SCROW> aFunc(aRowMap, nTab, nCol1, nCol2);
std::for_each(aListeners.begin(), aListeners.end(), aFunc);
{
ReorderNotifier<sc::RefRowReorderHint, sc::ColRowReorderMapType, SCROW> aFunc(aRowMap, nTab, nCol1, nCol2);
std::for_each(aListeners.begin(), aListeners.end(), std::move(aFunc));
}
// Re-group formulas in affected columns.
for (const auto& [rTab, rCols] : rGroupTabs)
+1 -1
View File
@@ -1830,7 +1830,7 @@ void SAL_CALL PersistentPropertySet::setPropertyValues(
aEvt.PropertyName = rNewValue.Name;
aEvt.PropertyHandle = rNewValue.Handle;
aEvt.Further = false;
aEvt.OldValue = aOldValue;
aEvt.OldValue = std::move(aOldValue);
aEvt.NewValue = rNewValue.Value;
aEvents.push_back( aEvt );
+3 -3
View File
@@ -169,10 +169,10 @@ public:
void flush() { mpIdleNotify->Invoke(); }
protected:
void initializeSender(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
const OUString& sTypeOfJSON)
void initializeSender(const VclPtr<vcl::Window>& rNotifierWindow,
const VclPtr<vcl::Window>& rContentWindow, const OUString& rTypeOfJSON)
{
mpIdleNotify.reset(new JSDialogNotifyIdle(aNotifierWindow, aContentWindow, sTypeOfJSON));
mpIdleNotify.reset(new JSDialogNotifyIdle(rNotifierWindow, rContentWindow, rTypeOfJSON));
}
};
@@ -1138,9 +1138,10 @@ void DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag
}
OUString sParaStyleName;
rParaProp.m_rPropertySet->getPropertyValue("ParaStyleName") >>= sParaStyleName;
StyleSheetEntryPtr pEntry = m_rDMapper_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(sParaStyleName);
bool bDocDefault;
uno::Any aParaStyle = m_rDMapper_Impl.GetPropertyFromStyleSheet(eId, pEntry, true, true, &bDocDefault);
uno::Any aParaStyle = m_rDMapper_Impl.GetPropertyFromStyleSheet(eId,
m_rDMapper_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(sParaStyleName),
true, true, &bDocDefault);
// A very strange compatibility rule says that the DEFAULT style's specified fontsize of 11 or 12
// or a specified left justify will always be overridden by the table-style.
// Normally this rule is applied, so always do this unless a compatSetting indicates otherwise.
@@ -336,13 +336,13 @@ void OOXMLDocumentImpl::resolveComment(Stream & rStream,
OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet
(const OUString & rId)
{
OOXMLStream::Pointer_t pStream
OOXMLStream::Pointer_t xStream
(OOXMLDocumentFactory::createStream(mpStream, rId));
writerfilter::Reference<BinaryObj>::Pointer_t pPicture
(new OOXMLBinaryObjectReference(pStream));
writerfilter::Reference<BinaryObj>::Pointer_t xPicture
(new OOXMLBinaryObjectReference(std::move(xStream)));
OOXMLValue::Pointer_t pPayloadValue(new OOXMLBinaryValue(pPicture));
OOXMLValue::Pointer_t pPayloadValue(new OOXMLBinaryValue(std::move(xPicture)));
OOXMLPropertySet::Pointer_t pBlipSet(new OOXMLPropertySet);
@@ -789,8 +789,7 @@ KeywordInfo* Databases::getKeyword( const OUString& Database,
// sorting
Reference<XCollator> xCollator = getCollator(aGuard, Language);
KeywordElementComparator aComparator( xCollator );
std::sort(aVector.begin(),aVector.end(),aComparator);
std::sort(aVector.begin(), aVector.end(), KeywordElementComparator(xCollator));
it->second.reset(new KeywordInfo( aVector ));
}