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 /svx/source/svdraw/svdedtv.cxx | |
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 'svx/source/svdraw/svdedtv.cxx')
-rw-r--r-- | svx/source/svdraw/svdedtv.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index ebbbf88b5aea..cdb208e571eb 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -197,11 +197,10 @@ void SdrEditView::DeleteLayer(const OUString& rName) { SdrLayerAdmin& rLA = mpModel->GetLayerAdmin(); SdrLayer* pLayer = rLA.GetLayer(rName); - sal_uInt16 nLayerNum(rLA.GetLayerPos(pLayer)); - if(SDRLAYER_NOTFOUND != nLayerNum) + if(pLayer) { - + sal_uInt16 nLayerNum(rLA.GetLayerPos(pLayer)); SdrLayerID nDelID = pLayer->GetID(); const bool bUndo = IsUndoEnabled(); @@ -955,7 +954,7 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInser { if (nOptions & SdrInsertFlags::SETDEFLAYER) { SdrLayerID nLayer=rPV.GetPage()->GetLayerAdmin().GetLayerID(maActualLayer); - if (nLayer==SDRLAYER_NOTFOUND) nLayer=0; + if (nLayer==SDRLAYER_NOTFOUND) nLayer=SdrLayerID(0); if (rPV.GetLockedLayers().IsSet(nLayer) || !rPV.GetVisibleLayers().IsSet(nLayer)) { SdrObject::Free( pObj ); // Layer locked or invisible return false; |