summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-11-18 15:02:17 +0100
committerJulien Nabet <serval2412@yahoo.fr>2023-11-18 18:38:46 +0100
commit597ba50a18ad9101cb5fa506b200fea12b580aa6 (patch)
treecfdbc4993aba5e131085298fbe9b108dbec04604 /oox/source
parent4bbd9853afde9456c1c5bc16eca3b775e53a01fe (diff)
c++20: use std::erase(_if) instead of std::remove(_if)+erase (part 5)
Change-Id: I373e5185e53ce88fba36d69d0fc20c29bb89d184 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159625 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/diagram/diagram.cxx5
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx14
2 files changed, 8 insertions, 11 deletions
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index 7927b7aa6945..ce8a7cfb1db4 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -90,13 +90,12 @@ static void removeUnneededGroupShapes(const ShapePtr& pShape)
{
std::vector<ShapePtr>& rChildren = pShape->getChildren();
- rChildren.erase(std::remove_if(rChildren.begin(), rChildren.end(),
+ std::erase_if(rChildren,
[](const ShapePtr& aChild) {
return aChild->getServiceName()
== "com.sun.star.drawing.GroupShape"
&& aChild->getChildren().empty();
- }),
- rChildren.end());
+ });
for (const auto& pChild : rChildren)
{
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index f9fce3b1f837..6ee4b88322d0 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -1125,13 +1125,12 @@ void AlgAtom::layoutShape(const ShapePtr& rShape, const std::vector<Constraint>&
if (mnType != XML_lin)
{
// TODO Handle spacing from constraints for non-lin algorithms as well.
- rShape->getChildren().erase(
- std::remove_if(rShape->getChildren().begin(), rShape->getChildren().end(),
+ std::erase_if(
+ rShape->getChildren(),
[](const ShapePtr& aChild) {
return aChild->getServiceName() == "com.sun.star.drawing.GroupShape"
&& aChild->getChildren().empty();
- }),
- rShape->getChildren().end());
+ });
}
switch(mnType)
@@ -1541,14 +1540,13 @@ void AlgAtom::layoutShape(const ShapePtr& rShape, const std::vector<Constraint>&
else
{
// TODO Handle spacing from constraints without rules as well.
- rShape->getChildren().erase(
- std::remove_if(rShape->getChildren().begin(), rShape->getChildren().end(),
+ std::erase_if(
+ rShape->getChildren(),
[](const ShapePtr& aChild) {
return aChild->getServiceName()
== "com.sun.star.drawing.GroupShape"
&& aChild->getChildren().empty();
- }),
- rShape->getChildren().end());
+ });
fCount = rShape->getChildren().size();
}
awt::Size aChildSize = rShape->getSize();