summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-19 11:10:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-19 12:23:46 +0200
commit2ee60f02c456f39a80edb2dbfed48c3e0147a7f7 (patch)
treeca4b9c95c2c1f28dcfd4ecb3307015c7f82603b9 /drawinglayer/source/processor2d/objectinfoextractor2d.cxx
parent9df2821e61979dab32390d5c64dd49bee868adbb (diff)
loplugin:flatten in drawinglayer
Change-Id: Ieb5f682ec627c8d8ddfc286ec0e4422104b4d847 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92494 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source/processor2d/objectinfoextractor2d.cxx')
-rw-r--r--drawinglayer/source/processor2d/objectinfoextractor2d.cxx50
1 files changed, 25 insertions, 25 deletions
diff --git a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
index d15fc36523be..552406d53f68 100644
--- a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
+++ b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
@@ -27,37 +27,37 @@ namespace drawinglayer::processor2d
{
void ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
{
- if(!mpFound)
+ if(mpFound)
+ return;
+
+ switch(rCandidate.getPrimitive2DID())
{
- switch(rCandidate.getPrimitive2DID())
+ case PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D :
+ {
+ mpFound = dynamic_cast< const primitive2d::ObjectInfoPrimitive2D* >(&rCandidate);
+ break;
+ }
+ default :
{
- case PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D :
+ // we look for an encapsulated primitive, so do not decompose primitives
+ // based on GroupPrimitive2D, just visit their children. It may be that more
+ // group-like primitives need to be added here, but all primitives with
+ // grouping functionality should be implemented based on the GroupPrimitive2D
+ // class and have their main content accessible as children
+ const primitive2d::GroupPrimitive2D* pGroupPrimitive2D = dynamic_cast< const primitive2d::GroupPrimitive2D* >(&rCandidate);
+
+ if(pGroupPrimitive2D)
{
- mpFound = dynamic_cast< const primitive2d::ObjectInfoPrimitive2D* >(&rCandidate);
- break;
+ // process group children recursively
+ process(pGroupPrimitive2D->getChildren());
}
- default :
+ else
{
- // we look for an encapsulated primitive, so do not decompose primitives
- // based on GroupPrimitive2D, just visit their children. It may be that more
- // group-like primitives need to be added here, but all primitives with
- // grouping functionality should be implemented based on the GroupPrimitive2D
- // class and have their main content accessible as children
- const primitive2d::GroupPrimitive2D* pGroupPrimitive2D = dynamic_cast< const primitive2d::GroupPrimitive2D* >(&rCandidate);
-
- if(pGroupPrimitive2D)
- {
- // process group children recursively
- process(pGroupPrimitive2D->getChildren());
- }
- else
- {
- // do not process recursively, we *only* want to find existing
- // ObjectInfoPrimitive2D entries
- }
-
- break;
+ // do not process recursively, we *only* want to find existing
+ // ObjectInfoPrimitive2D entries
}
+
+ break;
}
}
}