From a651dbcfca9e198b5c2561076961504586bc6bea Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 10 May 2017 13:52:51 +0200 Subject: convert SdrLayerId to strong_int Also - rename SetOfByte to SdrLayerIDSet - add asserts in SdrLayerAdmin::GetUniqueLayerID so that we don't allocate overlapping SdrLayerID values - add a new constant SDRLAYERPOS_NOTFOUND to be returned from SdrLayerAdmin::GetLayerPos Change-Id: I3bb3489f9338e3d02c4040bcbd811744699941c8 Reviewed-on: https://gerrit.libreoffice.org/37467 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../AccessibleDocumentPagePreview.cxx | 42 +++++++++------------- 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx') diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index ec81ed09dd42..21e84ddaaca7 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1060,32 +1060,24 @@ void ScShapeChildren::FillShapes(const tools::Rectangle& aPixelPaintRect, const ScShapeChild aShape; aShape.mxShape = xShape; aShape.mnRangeId = nRangeId; - switch (pObj->GetLayer()) + if (pObj->GetLayer().anyOf(SC_LAYER_INTERN, SC_LAYER_FRONT)) { - case SC_LAYER_INTERN: - case SC_LAYER_FRONT: - { - maShapeRanges[nRangeId].maForeShapes.push_back(aShape); - bForeAdded = true; - } - break; - case SC_LAYER_BACK: - { - maShapeRanges[nRangeId].maBackShapes.push_back(aShape); - bBackAdded = true; - } - break; - case SC_LAYER_CONTROLS: - { - maShapeRanges[nRangeId].maControls.push_back(aShape); - bControlAdded = true; - } - break; - default: - { - OSL_FAIL("I don't know this layer."); - } - break; + maShapeRanges[nRangeId].maForeShapes.push_back(aShape); + bForeAdded = true; + } + else if (pObj->GetLayer() == SC_LAYER_BACK) + { + maShapeRanges[nRangeId].maBackShapes.push_back(aShape); + bBackAdded = true; + } + else if (pObj->GetLayer() == SC_LAYER_CONTROLS) + { + maShapeRanges[nRangeId].maControls.push_back(aShape); + bControlAdded = true; + } + else + { + OSL_FAIL("I don't know this layer."); } } } -- cgit