diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-10 13:52:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-12 09:54:23 +0200 |
commit | a651dbcfca9e198b5c2561076961504586bc6bea (patch) | |
tree | 812eee16af9bc3c4c75b8b45a4c126f99ad1bab3 /sc/source/ui/Accessibility | |
parent | 9b5ce4023d35c4cc82f7b17e79b8fedbcb1367dd (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/Accessibility')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocument.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 42 |
2 files changed, 23 insertions, 31 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 791747d0eae5..2fbabe9efa36 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -122,16 +122,16 @@ struct ScShapeDataLess { switch (rLayerID) { - case SC_LAYER_FRONT: + case sal_uInt8(SC_LAYER_FRONT): rLayerID = 1; break; - case SC_LAYER_BACK: + case sal_uInt8(SC_LAYER_BACK): rLayerID = 0; break; - case SC_LAYER_INTERN: + case sal_uInt8(SC_LAYER_INTERN): rLayerID = 2; break; - case SC_LAYER_CONTROLS: + case sal_uInt8(SC_LAYER_CONTROLS): rLayerID = 3; break; } @@ -146,7 +146,7 @@ struct ScShapeDataLess sal_Int16 nLayerID = 0; if( (aPropAny >>= nLayerID) ) { - if (nLayerID == SC_LAYER_BACK) + if (SdrLayerID(nLayerID) == SC_LAYER_BACK) bResult = true; } } @@ -1230,7 +1230,7 @@ void ScChildrenShapes::AddShape(const uno::Reference<drawing::XShape>& xShape, b sal_Int16 nLayerID = 0; if( aPropAny >>= nLayerID ) { - if( (nLayerID == SC_LAYER_INTERN) || (nLayerID == SC_LAYER_HIDDEN) ) + if( (SdrLayerID(nLayerID) == SC_LAYER_INTERN) || (SdrLayerID(nLayerID) == SC_LAYER_HIDDEN) ) pShape->bSelectable = false; else pShape->bSelectable = true; 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."); } } } |