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 --- basctl/source/dlged/dlgedview.cxx | 2 +- basctl/source/inc/dlgedview.hxx | 2 +- filter/source/msfilter/escherex.cxx | 2 +- filter/source/msfilter/eschesdo.cxx | 4 +- include/filter/msfilter/escherex.hxx | 7 +-- include/svx/sdr/contact/displayinfo.hxx | 6 +-- include/svx/sdr/contact/objectcontact.hxx | 2 +- include/svx/sdr/contact/viewcontact.hxx | 2 +- include/svx/sdr/contact/viewcontactofe3dscene.hxx | 4 +- .../svx/sdr/contact/viewobjectcontactofsdrobj.hxx | 4 +- include/svx/sdrhittesthelper.hxx | 6 +-- include/svx/sdrmasterpagedescriptor.hxx | 6 +-- include/svx/svdlayer.hxx | 8 ++-- include/svx/svdmrkv.hxx | 6 +-- include/svx/svdobj.hxx | 8 ++-- include/svx/svdpage.hxx | 8 ++-- include/svx/svdpagv.hxx | 22 ++++----- include/svx/svdsob.hxx | 26 +++++------ include/svx/svdtypes.hxx | 11 +++-- include/svx/svdundo.hxx | 4 +- include/svx/svdviter.hxx | 2 +- reportdesign/inc/RptDef.hxx | 6 +-- reportdesign/source/core/api/ReportDefinition.cxx | 6 +-- reportdesign/source/ui/inc/SectionView.hxx | 2 +- reportdesign/source/ui/report/ReportSection.cxx | 2 +- reportdesign/source/ui/report/SectionView.cxx | 9 ++-- sc/inc/global.hxx | 14 +++--- sc/source/core/data/drwlayer.cxx | 10 ++-- sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 10 ++-- sc/source/filter/xml/XMLTableShapeImportHelper.hxx | 3 +- sc/source/filter/xml/xmlexprt.cxx | 4 +- sc/source/ui/Accessibility/AccessibleDocument.cxx | 12 ++--- .../AccessibleDocumentPagePreview.cxx | 42 +++++++---------- sc/source/ui/drawfunc/drawsh2.cxx | 2 +- sc/source/ui/inc/drawsh.hxx | 3 +- sc/source/ui/inc/drawview.hxx | 2 +- sc/source/ui/inc/gridwin.hxx | 2 +- sc/source/ui/inc/output.hxx | 8 ++-- sc/source/ui/view/drawview.cxx | 4 +- sc/source/ui/view/gridwin3.cxx | 4 +- sc/source/ui/view/output3.cxx | 4 +- sd/source/core/drawdoc2.cxx | 12 ++--- sd/source/core/sdpage.cxx | 8 ++-- sd/source/filter/ppt/pptin.cxx | 2 +- sd/source/ui/dlg/LayerTabBar.cxx | 10 ++-- sd/source/ui/func/fudraw.cxx | 2 +- sd/source/ui/func/fuexpand.cxx | 2 +- sd/source/ui/func/fusel.cxx | 2 +- sd/source/ui/func/fusumry.cxx | 2 +- sd/source/ui/inc/DrawViewShell.hxx | 4 +- sd/source/ui/inc/FrameView.hxx | 18 ++++---- sd/source/ui/inc/OutlineView.hxx | 4 +- sd/source/ui/inc/SlideSorterViewShell.hxx | 4 +- sd/source/ui/inc/View.hxx | 6 +-- sd/source/ui/inc/ViewShell.hxx | 4 +- sd/source/ui/sidebar/LayoutMenu.cxx | 6 +-- .../ui/slidesorter/controller/SlsClipboard.cxx | 6 +-- .../ui/slidesorter/controller/SlsSlotManager.cxx | 6 +-- .../ui/slidesorter/inc/controller/SlsClipboard.hxx | 6 +-- .../ui/slidesorter/shell/SlideSorterViewShell.cxx | 4 +- sd/source/ui/unoidl/unolayer.cxx | 2 +- sd/source/ui/unoidl/unomodel.cxx | 10 ++-- sd/source/ui/unoidl/unopage.cxx | 8 ++-- sd/source/ui/view/DocumentRenderer.cxx | 28 ++++++------ sd/source/ui/view/ViewShellImplementation.cxx | 12 ++--- sd/source/ui/view/drviews1.cxx | 32 ++++++------- sd/source/ui/view/drviews2.cxx | 4 +- sd/source/ui/view/drviews7.cxx | 6 +-- sd/source/ui/view/drviewsa.cxx | 2 +- sd/source/ui/view/drviewsb.cxx | 6 +-- sd/source/ui/view/frmview.cxx | 18 ++++---- sd/source/ui/view/outlview.cxx | 4 +- sd/source/ui/view/sdview2.cxx | 4 +- sd/source/ui/view/sdview3.cxx | 8 ++-- sd/source/ui/view/unmodpg.cxx | 18 ++++---- sd/source/ui/view/viewshe2.cxx | 4 +- sd/source/ui/view/viewshe3.cxx | 6 +-- svx/inc/sdr/contact/viewobjectcontactofgroup.hxx | 2 +- svx/inc/sxlayitm.hxx | 4 +- svx/source/sdr/contact/displayinfo.cxx | 2 +- svx/source/sdr/contact/viewcontactofe3dscene.cxx | 10 ++-- .../sdr/contact/viewobjectcontactofe3dscene.cxx | 2 +- .../sdr/contact/viewobjectcontactofgroup.cxx | 6 +-- .../viewobjectcontactofmasterpagedescriptor.cxx | 8 ++-- .../sdr/contact/viewobjectcontactofsdrobj.cxx | 2 +- svx/source/svdraw/sdrhittesthelper.cxx | 4 +- svx/source/svdraw/sdrmasterpagedescriptor.cxx | 2 +- svx/source/svdraw/sdrpagewindow.cxx | 4 +- svx/source/svdraw/svdattr.cxx | 2 +- svx/source/svdraw/svdcrtv.cxx | 4 +- svx/source/svdraw/svdedtv.cxx | 7 ++- svx/source/svdraw/svdedtv1.cxx | 3 +- svx/source/svdraw/svdetc.cxx | 6 +-- svx/source/svdraw/svdlayer.cxx | 53 ++++++++++------------ svx/source/svdraw/svdmrkv.cxx | 8 ++-- svx/source/svdraw/svdobj.cxx | 7 ++- svx/source/svdraw/svdoedge.cxx | 2 +- svx/source/svdraw/svdogrp.cxx | 2 +- svx/source/svdraw/svdpage.cxx | 4 +- svx/source/svdraw/svdpagv.cxx | 8 ++-- svx/source/svdraw/svdviter.cxx | 8 ++-- svx/source/svdraw/svdxcgv.cxx | 8 ++-- svx/source/uitest/sdrobject.cxx | 2 +- svx/source/unodraw/unoshape.cxx | 6 +-- sw/inc/fesh.hxx | 2 +- sw/source/core/draw/dview.cxx | 2 +- sw/source/core/frmedt/feshview.cxx | 33 ++++++-------- sw/source/core/inc/UndoInsert.hxx | 5 +- sw/source/core/inc/dview.hxx | 2 +- sw/source/core/layout/fly.cxx | 4 +- sw/source/core/text/txtfly.cxx | 4 +- sw/source/core/undo/unins.cxx | 2 +- sw/source/core/unocore/unodraw.cxx | 6 +++ sw/source/filter/ww8/writerhelper.hxx | 3 +- sw/source/uibase/shells/drawsh.cxx | 6 +-- sw/source/uibase/shells/drwbassh.cxx | 2 +- 116 files changed, 409 insertions(+), 409 deletions(-) diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx index d05ceb1d9a70..afb76e242f71 100644 --- a/basctl/source/dlged/dlgedview.cxx +++ b/basctl/source/dlged/dlgedview.cxx @@ -168,7 +168,7 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt return pRetval; } -SdrObject* DlgEdView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay) const +SdrObject* DlgEdView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const { // call parent SdrObject* pRetval = SdrView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay); diff --git a/basctl/source/inc/dlgedview.hxx b/basctl/source/inc/dlgedview.hxx index a370d48e16b4..511abfc841e3 100644 --- a/basctl/source/inc/dlgedview.hxx +++ b/basctl/source/inc/dlgedview.hxx @@ -48,7 +48,7 @@ public: protected: /// override to handle HitTest for some objects specially using SdrView::CheckSingleSdrObjectHit; - virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay) const override; + virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const override; }; } // namespace basctl diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index ee786573f1a0..cf83e13057d6 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4934,7 +4934,7 @@ EscherEx::EscherEx(const std::shared_ptr& rxGlobal, SvStream* pO , mnCurrentDg(0) , mnCountOfs(0) , mnGroupLevel(0) - , mnHellLayerId(USHRT_MAX) + , mnHellLayerId(SDRLAYER_NOTFOUND) , mbEscherSpgr(false) , mbEscherDg(false) , mbOOXML(bOOXML) diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index ce1f7b792fce..a6dcda3a010c 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -645,9 +645,9 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, } aPropOpt.CreateShadowProperties( rObj.mXPropSet ); - if( USHRT_MAX != mpEscherEx->GetHellLayerId() && + if( SDRLAYER_NOTFOUND != mpEscherEx->GetHellLayerId() && rObj.ImplGetPropertyValue( OUString( "LayerID" ) ) && - *o3tl::doAccess(rObj.GetUsrAny()) == mpEscherEx->GetHellLayerId() ) + *o3tl::doAccess(rObj.GetUsrAny()) == sal_uInt8(mpEscherEx->GetHellLayerId()) ) { aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x200020 ); } diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index 9e46ca662927..4486ceb34e58 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1036,7 +1037,7 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable sal_uInt32 mnCountOfs; sal_uInt32 mnGroupLevel; - sal_uInt16 mnHellLayerId; + SdrLayerID mnHellLayerId; bool mbEscherSpgr; bool mbEscherDg; @@ -1184,8 +1185,8 @@ public: static const SdrObject* GetSdrObject( const css::uno::Reference< css::drawing::XShape >& rXShape ); - void SetHellLayerId( sal_uInt16 nId ) { mnHellLayerId = nId; } - sal_uInt16 GetHellLayerId() const { return mnHellLayerId; } + void SetHellLayerId( SdrLayerID nId ) { mnHellLayerId = nId; } + SdrLayerID GetHellLayerId() const { return mnHellLayerId; } private: EscherEx( const EscherEx& ) = delete; diff --git a/include/svx/sdr/contact/displayinfo.hxx b/include/svx/sdr/contact/displayinfo.hxx index b4981808f023..486399ab16c4 100644 --- a/include/svx/sdr/contact/displayinfo.hxx +++ b/include/svx/sdr/contact/displayinfo.hxx @@ -32,7 +32,7 @@ namespace sdr class SVX_DLLPUBLIC DisplayInfo final { // The Layers which shall be processed (visible) - SetOfByte maProcessLayers; + SdrLayerIDSet maProcessLayers; // The redraw area, in logical coordinates of OutputDevice. If Region // is empty, everything needs to be redrawn @@ -74,8 +74,8 @@ namespace sdr ~DisplayInfo(); // access to ProcessLayers - void SetProcessLayers(const SetOfByte& rSet); - const SetOfByte& GetProcessLayers() const { return maProcessLayers; } + void SetProcessLayers(const SdrLayerIDSet& rSet); + const SdrLayerIDSet& GetProcessLayers() const { return maProcessLayers; } // access to RedrawArea void SetRedrawArea(const vcl::Region& rRegion); diff --git a/include/svx/sdr/contact/objectcontact.hxx b/include/svx/sdr/contact/objectcontact.hxx index a2429eca7af6..7185aa20132b 100644 --- a/include/svx/sdr/contact/objectcontact.hxx +++ b/include/svx/sdr/contact/objectcontact.hxx @@ -24,7 +24,7 @@ #include #include -class SetOfByte; +class SdrLayerIDSet; namespace tools { class Rectangle; } class SdrPageView; class OutputDevice; diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx index 20347120ed6c..0912d47dbf90 100644 --- a/include/svx/sdr/contact/viewcontact.hxx +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -24,7 +24,7 @@ #include #include -class SetOfByte; +class SdrLayerIDSet; class SdrPage; class SdrObject; diff --git a/include/svx/sdr/contact/viewcontactofe3dscene.hxx b/include/svx/sdr/contact/viewcontactofe3dscene.hxx index a802db8384a5..5e0b8ec91d0d 100644 --- a/include/svx/sdr/contact/viewcontactofe3dscene.hxx +++ b/include/svx/sdr/contact/viewcontactofe3dscene.hxx @@ -65,8 +65,8 @@ public: const drawinglayer::attribute::SdrLightingAttribute& getSdrLightingAttribute() const; // scene primitive creators. If pLayerVisibility is given, a visibility test with the LayerID and the - // given SetOfByte is done. - drawinglayer::primitive2d::Primitive2DContainer createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const; + // given SdrLayerIDSet is done. + drawinglayer::primitive2d::Primitive2DContainer createScenePrimitive2DSequence(const SdrLayerIDSet* pLayerVisibility) const; // helpers to get the sequence of all contained 3D primitives and its range, // regardless of layer or visibility constraints and using a neutral ViewInformation3D diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx index 93332d41c917..cb7773c716f3 100644 --- a/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx +++ b/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx @@ -24,7 +24,7 @@ #include class SdrObject; -class SetOfByte; +class SdrLayerIDSet; class OutputDevice; namespace sdr { namespace contact { @@ -37,7 +37,7 @@ class SVX_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact that have subparts which can be on different layers (that is, SdrObjGroup .-) */ - virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const; + virtual bool isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const; protected: const SdrObject& getSdrObject() const; diff --git a/include/svx/sdrhittesthelper.hxx b/include/svx/sdrhittesthelper.hxx index 2943c42a22c9..b8da54c7d839 100644 --- a/include/svx/sdrhittesthelper.hxx +++ b/include/svx/sdrhittesthelper.hxx @@ -28,7 +28,7 @@ class SdrObject; class SdrPageView; -class SetOfByte; +class SdrLayerIDSet; class SdrObjList; namespace sdr { namespace contact { class ViewObjectContact; }} namespace basegfx { class B2DPoint; } @@ -41,7 +41,7 @@ SVX_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit( const Point& rPnt, sal_uInt16 nTol, const SdrPageView& rSdrPageView, - const SetOfByte* pVisiLayer, + const SdrLayerIDSet* pVisiLayer, bool bTextOnly); SVX_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit( @@ -49,7 +49,7 @@ SVX_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit( const Point& rPnt, sal_uInt16 nTol, const SdrPageView& rSdrPageView, - const SetOfByte* pVisiLayer, + const SdrLayerIDSet* pVisiLayer, bool bTextOnly); diff --git a/include/svx/sdrmasterpagedescriptor.hxx b/include/svx/sdrmasterpagedescriptor.hxx index 39777f96456b..f719bca5322e 100644 --- a/include/svx/sdrmasterpagedescriptor.hxx +++ b/include/svx/sdrmasterpagedescriptor.hxx @@ -42,7 +42,7 @@ namespace sdr private: SdrPage& maOwnerPage; SdrPage& maUsedPage; - SetOfByte maVisibleLayers; + SdrLayerIDSet maVisibleLayers; // ViewContact part sdr::contact::ViewContact* mpViewContact; @@ -68,8 +68,8 @@ namespace sdr SdrPage& GetOwnerPage() const { return maOwnerPage; } // member access to VisibleLayers - const SetOfByte& GetVisibleLayers() const { return maVisibleLayers; } - void SetVisibleLayers(const SetOfByte& rNew); + const SdrLayerIDSet& GetVisibleLayers() const { return maVisibleLayers; } + void SetVisibleLayers(const SdrLayerIDSet& rNew); const SdrPageProperties* getCorrectSdrPageProperties() const; }; diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx index 13354503a42c..1a60d8b24946 100644 --- a/include/svx/svdlayer.hxx +++ b/include/svx/svdlayer.hxx @@ -88,8 +88,10 @@ public: void SetStandardLayer(); }; -// When Changing the layer data you currently have to set the Modify flag manually #define SDRLAYER_MAXCOUNT 255 +#define SDRLAYERPOS_NOTFOUND 0xffff + +// When Changing the layer data you currently have to set the Modify flag manually class SVX_DLLPUBLIC SdrLayerAdmin { friend class SdrView; friend class SdrModel; @@ -145,8 +147,8 @@ public: SdrLayer* GetLayer(const OUString& rName); const SdrLayer* GetLayer(const OUString& rName) const; SdrLayerID GetLayerID(const OUString& rName) const; - SdrLayer* GetLayerPerID(sal_uInt16 nID) { return const_cast(const_cast(this)->GetLayerPerID(nID)); } - const SdrLayer* GetLayerPerID(sal_uInt16 nID) const; + SdrLayer* GetLayerPerID(SdrLayerID nID) { return const_cast(const_cast(this)->GetLayerPerID(nID)); } + const SdrLayer* GetLayerPerID(SdrLayerID nID) const; void SetControlLayerName(const OUString& rNewName); const OUString& GetControlLayerName() const { return maControlLayerName; } diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index d2142ded5040..2a049fc5288e 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -153,9 +153,9 @@ protected: void ForceRefToMarked(); void ForceUndirtyMrkPnt() const { if (mbMrkPntDirty) UndirtyMrkPnt(); } - virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay) const; - SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const; - SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const; + virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const; + SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj) const; + SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const; bool ImpIsFrameHandles() const; void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, ImpTakeDescriptionOptions nOpt=ImpTakeDescriptionOptions::NONE) const; diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 9f8ef8f95422..8c1e4b59d278 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -69,7 +69,7 @@ class SdrObjUserDataList; class SdrObjPlusData; class SdrGluePoint; class SdrGluePointList; -class SetOfByte; +class SdrLayerIDSet; class OutputDevice; class Fraction; @@ -182,7 +182,7 @@ public: Point aPos; Point aDownPos; VclPtr pOut; - const SetOfByte* pVisiLayer; + const SdrLayerIDSet* pVisiLayer; const SdrPageView* pPageView; sal_uInt16 nTol; bool bDown; @@ -341,8 +341,8 @@ public: virtual SdrLayerID GetLayer() const; virtual void NbcSetLayer(SdrLayerID nLayer); virtual void SetLayer(SdrLayerID nLayer); - // renaming GetLayerSet -> getMergedHierarchyLayerSet to make clear what happens here. rSet needs to be empty. - void getMergedHierarchyLayerSet(SetOfByte& rSet) const; + // renaming GetSdrLayerIDSet -> getMergedHierarchySdrLayerIDSet to make clear what happens here. rSet needs to be empty. + void getMergedHierarchySdrLayerIDSet(SdrLayerIDSet& rSet) const; void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle& rBoundRect) const; diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index 987acd87aa16..a348c2c75e1f 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -48,7 +48,7 @@ class SdrModel; class SfxItemPool; class SdrPageView; class SdrLayerAdmin; -class SetOfByte; +class SdrLayerIDSet; class Color; class SfxStyleSheet; class SvxUnoDrawPagesAccess; @@ -405,7 +405,7 @@ protected: // new MasterPageDescriptorVector sdr::MasterPageDescriptor* mpMasterPageDescriptor; - SetOfByte aPrefVisiLayers; + SdrLayerIDSet aPrefVisiLayers; sal_uInt16 nPageNum; bool mbMaster : 1; // flag if this is a MasterPage @@ -469,8 +469,8 @@ public: void TRG_SetMasterPage(SdrPage& rNew); void TRG_ClearMasterPage(); SdrPage& TRG_GetMasterPage() const; - const SetOfByte& TRG_GetMasterPageVisibleLayers() const; - void TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew); + const SdrLayerIDSet& TRG_GetMasterPageVisibleLayers() const; + void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet& rNew); sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const; protected: diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx index 44a0000beb86..b068ecea8875 100644 --- a/include/svx/svdpagv.hxx +++ b/include/svx/svdpagv.hxx @@ -69,9 +69,9 @@ private: bool mbHasMarked; bool mbVisible; - SetOfByte aLayerVisi; // Set of visible Layers - SetOfByte aLayerLock; // Set of non-editable Layers - SetOfByte aLayerPrn; // Set of printable Layers + SdrLayerIDSet aLayerVisi; // Set of visible Layers + SdrLayerIDSet aLayerLock; // Set of non-editable Layers + SdrLayerIDSet aLayerPrn; // Set of printable Layers SdrObjList* pAktList; // Current List, usually the Page SdrObject* pAktGroup; // Current Group; nullptr means none @@ -110,8 +110,8 @@ public: private: void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const; - void SetLayer(const OUString& rName, SetOfByte& rBS, bool bJa); - bool IsLayer(const OUString& rName, const SetOfByte& rBS) const; + void SetLayer(const OUString& rName, SdrLayerIDSet& rBS, bool bJa); + bool IsLayer(const OUString& rName, const SdrLayerIDSet& rBS) const; /// Let's see if the current Group (pAktGroup) is still inserted void CheckAktGroup(); @@ -210,12 +210,12 @@ public: void LogicToPagePos(tools::Rectangle& rRect) const { rRect.Move(-aPgOrg.X(),-aPgOrg.Y()); } void PagePosToLogic(Point& rPnt) const { rPnt+=aPgOrg; } - void SetVisibleLayers(const SetOfByte& rSet) { aLayerVisi=rSet; } - const SetOfByte& GetVisibleLayers() const { return aLayerVisi; } - void SetPrintableLayers(const SetOfByte& rSet) { aLayerPrn=rSet; } - const SetOfByte& GetPrintableLayers() const { return aLayerPrn; } - void SetLockedLayers(const SetOfByte& rSet) { aLayerLock=rSet; } - const SetOfByte& GetLockedLayers() const { return aLayerLock; } + void SetVisibleLayers(const SdrLayerIDSet& rSet) { aLayerVisi=rSet; } + const SdrLayerIDSet& GetVisibleLayers() const { return aLayerVisi; } + void SetPrintableLayers(const SdrLayerIDSet& rSet) { aLayerPrn=rSet; } + const SdrLayerIDSet& GetPrintableLayers() const { return aLayerPrn; } + void SetLockedLayers(const SdrLayerIDSet& rSet) { aLayerLock=rSet; } + const SdrLayerIDSet& GetLockedLayers() const { return aLayerLock; } const SdrHelpLineList& GetHelpLines() const { return aHelpLines; } void SetHelpLines(const SdrHelpLineList& rHLL); diff --git a/include/svx/svdsob.hxx b/include/svx/svdsob.hxx index 510087c1914a..ac84a9bada1b 100644 --- a/include/svx/svdsob.hxx +++ b/include/svx/svdsob.hxx @@ -23,40 +23,40 @@ #include #include +#include /* - Declaration of a static set type. The set can collect elements - from 0 to 255 and it takes always 32 Bytes. + Stores a bitfield of the layer values that have been set. */ -class SVX_DLLPUBLIC SetOfByte +class SVX_DLLPUBLIC SdrLayerIDSet { protected: sal_uInt8 aData[32]; public: - explicit SetOfByte(bool bInitVal = false) + explicit SdrLayerIDSet(bool bInitVal = false) { memset(aData, bInitVal ? 0xFF : 0x00, sizeof(aData)); } - bool operator!=(const SetOfByte& rCmpSet) const + bool operator!=(const SdrLayerIDSet& rCmpSet) const { return (memcmp(aData, rCmpSet.aData, sizeof(aData))!=0); } - void Set(sal_uInt8 a) + void Set(SdrLayerID a) { - aData[a/8] |= 1< +#include // commands for EndCreate() enum class SdrCreateCmd @@ -52,13 +53,15 @@ enum class SdrDragMode /* * Layer */ -// If there is no layer when it should be identified, then -// drLayerAdmin::GetLayerID(const String&) returns a value. -#define SDRLAYER_NOTFOUND 0xFF // You can use this value in the methods of SdrLayerSet, but false is returned // every time or the method does nothing. // type declaration for Layer-IDs -typedef sal_uInt8 SdrLayerID; +struct SdrLayerIDTag {}; +typedef o3tl::strong_int SdrLayerID; + +// If there is no layer when it should be identified, then +// SdrLayerAdmin::GetLayerID(const String&) returns a value. +constexpr SdrLayerID SDRLAYER_NOTFOUND(0xff); /* * Page + ObjList diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 2653ba8569e8..3e434f8e64bd 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -678,7 +678,7 @@ class SdrUndoPageMasterPage : public SdrUndoPage { protected: bool mbOldHadMasterPage; - SetOfByte maOldSet; + SdrLayerIDSet maOldSet; sal_uInt16 maOldMasterPageNumber; protected: @@ -713,7 +713,7 @@ class SVX_DLLPUBLIC SdrUndoPageChangeMasterPage : public SdrUndoPageMasterPage { protected: bool mbNewHadMasterPage; - SetOfByte maNewSet; + SdrLayerIDSet maNewSet; sal_uInt16 maNewMasterPageNumber; public: diff --git a/include/svx/svdviter.hxx b/include/svx/svdviter.hxx index 7f903c440c73..76d0ca49662c 100644 --- a/include/svx/svdviter.hxx +++ b/include/svx/svdviter.hxx @@ -59,7 +59,7 @@ class SdrPageView; class SdrModel; class SdrPage; class SdrObject; -class SetOfByte; +class SdrLayerIDSet; class SVX_DLLPUBLIC SdrViewIter { diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx index 0007bedd9c1a..01cea68a878c 100644 --- a/reportdesign/inc/RptDef.hxx +++ b/reportdesign/inc/RptDef.hxx @@ -44,9 +44,9 @@ namespace com { namespace sun { namespace star { namespace rptui { // not all used at the moment -#define RPT_LAYER_FRONT 0 -#define RPT_LAYER_BACK 1 -#define RPT_LAYER_HIDDEN 2 +constexpr SdrLayerID RPT_LAYER_FRONT (0); +constexpr SdrLayerID RPT_LAYER_BACK (1); +constexpr SdrLayerID RPT_LAYER_HIDDEN (2); diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 620951d2088e..9f853f677626 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -590,9 +590,9 @@ void OReportDefinition::init() m_pImpl->m_pReportModel->GetItemPool().FreezeIdRanges(); m_pImpl->m_pReportModel->SetScaleUnit( MapUnit::Map100thMM ); SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin(); - rAdmin.NewStandardLayer(RPT_LAYER_FRONT); - rAdmin.NewLayer("back", RPT_LAYER_BACK); - rAdmin.NewLayer("HiddenLayer", RPT_LAYER_HIDDEN); + rAdmin.NewStandardLayer(sal_uInt8(RPT_LAYER_FRONT)); + rAdmin.NewLayer("back", sal_uInt8(RPT_LAYER_BACK)); + rAdmin.NewLayer("HiddenLayer", sal_uInt8(RPT_LAYER_HIDDEN)); m_pImpl->m_pUndoManager = new ::dbaui::UndoManager( *this, m_aMutex ); m_pImpl->m_pReportModel->SetSdrUndoManager( &m_pImpl->m_pUndoManager->GetSfxUndoManager() ); diff --git a/reportdesign/source/ui/inc/SectionView.hxx b/reportdesign/source/ui/inc/SectionView.hxx index 1035a8a7ef5f..c5c48661c059 100644 --- a/reportdesign/source/ui/inc/SectionView.hxx +++ b/reportdesign/source/ui/inc/SectionView.hxx @@ -59,7 +59,7 @@ public: /* returns the common layer id of the marked objects, otherwise -1 will be returned. */ - short GetLayerIdOfMarkedObjects() const; + SdrLayerID GetLayerIdOfMarkedObjects() const; // returns true if objects at Drag & Drop is resize not move bool IsDragResize() const; diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 580c228ccb56..88171c364b60 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -163,7 +163,7 @@ void OReportSection::Paint( vcl::RenderContext& rRenderContext, const tools::Rec // do paint (unbuffered) and mark repaint end if(pPgView) { - pPgView->DrawLayer(0, &rRenderContext); + pPgView->DrawLayer(RPT_LAYER_FRONT, &rRenderContext); pPgView->GetView().EndDrawLayers(*pTargetPaintWindow, true); } diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index 1c5ba21f4865..d94fe0deb51d 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -229,23 +229,20 @@ bool OSectionView::IsDragResize() const } -short OSectionView::GetLayerIdOfMarkedObjects() const +SdrLayerID OSectionView::GetLayerIdOfMarkedObjects() const { - short nRet = SHRT_MAX; + SdrLayerID nRet = SDRLAYER_NOTFOUND; const SdrMarkList &rMrkList = GetMarkedObjectList(); for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); - if ( nRet == SHRT_MAX ) + if ( nRet == SDRLAYER_NOTFOUND ) nRet = pObj->GetLayer(); else if ( nRet != pObj->GetLayer() ) { - nRet = -1; break; } } - if ( nRet == SHRT_MAX ) - nRet = -1; return nRet; } diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 00f87cac0e35..1c67775099cb 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -22,6 +22,7 @@ #include "address.hxx" #include +#include #include #include #include "scdllapi.h" @@ -204,12 +205,13 @@ namespace o3tl { #define EMPTY_OUSTRING ScGlobal::GetEmptyOUString() - // layer id's for drawing -#define SC_LAYER_FRONT 0 -#define SC_LAYER_BACK 1 -#define SC_LAYER_INTERN 2 -#define SC_LAYER_CONTROLS 3 -#define SC_LAYER_HIDDEN 4 +// Layer id's for drawing. +// These are both id's and positions. +constexpr SdrLayerID SC_LAYER_FRONT (0); +constexpr SdrLayerID SC_LAYER_BACK (1); +constexpr SdrLayerID SC_LAYER_INTERN (2); +constexpr SdrLayerID SC_LAYER_CONTROLS(3); +constexpr SdrLayerID SC_LAYER_HIDDEN (4); // link tables enum class ScLinkMode { diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 2591334b6cfc..47d397c0d2b0 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -284,11 +284,11 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const OUString& rName ) : rPool.FreezeIdRanges(); // the pool is also used directly SdrLayerAdmin& rAdmin = GetLayerAdmin(); - rAdmin.NewLayer("vorne", SC_LAYER_FRONT); - rAdmin.NewLayer("hinten", SC_LAYER_BACK); - rAdmin.NewLayer("intern", SC_LAYER_INTERN); - rAdmin.NewLayer("Controls", SC_LAYER_CONTROLS); - rAdmin.NewLayer("hidden", SC_LAYER_HIDDEN); + rAdmin.NewLayer("vorne", sal_uInt8(SC_LAYER_FRONT)); + rAdmin.NewLayer("hinten", sal_uInt8(SC_LAYER_BACK)); + rAdmin.NewLayer("intern", sal_uInt8(SC_LAYER_INTERN)); + rAdmin.NewLayer("Controls", sal_uInt8(SC_LAYER_CONTROLS)); + rAdmin.NewLayer("hidden", sal_uInt8(SC_LAYER_HIDDEN)); // "Controls" is new - must also be created when loading // Set link for URL-Fields diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index 36922cd04326..ce39ad48f2a9 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -52,15 +52,15 @@ XMLTableShapeImportHelper::~XMLTableShapeImportHelper() { } -void XMLTableShapeImportHelper::SetLayer(uno::Reference& rShape, sal_Int16 nLayerID, const OUString& sType) +void XMLTableShapeImportHelper::SetLayer(uno::Reference& rShape, SdrLayerID nLayerID, const OUString& sType) { if ( sType == "com.sun.star.drawing.ControlShape" ) nLayerID = SC_LAYER_CONTROLS; - if (nLayerID != -1) + if (nLayerID != SDRLAYER_NOTFOUND) { uno::Reference< beans::XPropertySet > xShapeProp( rShape, uno::UNO_QUERY ); if( xShapeProp.is() ) - xShapeProp->setPropertyValue( SC_LAYERID, uno::makeAny(nLayerID) ); + xShapeProp->setPropertyValue( SC_LAYERID, uno::makeAny(sal_uInt8(nLayerID)) ); } } @@ -97,7 +97,7 @@ void XMLTableShapeImportHelper::finishShape( sal_Int32 nEndY(-1); sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; std::unique_ptr xRangeList; - sal_Int16 nLayerID(-1); + SdrLayerID nLayerID = SDRLAYER_NOTFOUND; for( sal_Int16 i=0; i < nAttrCount; ++i ) { const OUString& rAttrName(xAttrList->getNameByIndex( i )); @@ -215,7 +215,7 @@ void XMLTableShapeImportHelper::finishShape( } } sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0); - sal_Int16 nLayerID(-1); + SdrLayerID nLayerID = SDRLAYER_NOTFOUND; for( sal_Int16 i=0; i < nAttrCount; ++i ) { const OUString& rAttrName(xAttrList->getNameByIndex( i )); diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.hxx b/sc/source/filter/xml/XMLTableShapeImportHelper.hxx index 397f07dcb4b9..b0312049ed07 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.hxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SC_SOURCE_FILTER_XML_XMLTABLESHAPEIMPORTHELPER_HXX #include +#include #include "address.hxx" class ScXMLImport; @@ -37,7 +38,7 @@ public: explicit XMLTableShapeImportHelper( ScXMLImport& rImp ); virtual ~XMLTableShapeImportHelper() override; - static void SetLayer(css::uno::Reference& rShape, sal_Int16 nLayerID, const OUString& sType); + static void SetLayer(css::uno::Reference& rShape, SdrLayerID nLayerID, const OUString& sType); virtual void finishShape(css::uno::Reference< css::drawing::XShape >& rShape, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes >& rShapes) override; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 625564e7d13a..f84eaea6488d 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -316,7 +316,7 @@ void ScXMLShapeExport::onExport( const uno::Reference < drawing::XShape >& xShap if( xShapeProp.is() ) { sal_Int16 nLayerID = 0; - if( (xShapeProp->getPropertyValue( SC_LAYERID ) >>= nLayerID) && (nLayerID == SC_LAYER_BACK) ) + if( (xShapeProp->getPropertyValue( SC_LAYERID ) >>= nLayerID) && (SdrLayerID(nLayerID) == SC_LAYER_BACK) ) GetExport().AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE_BACKGROUND, XML_TRUE); } } @@ -529,7 +529,7 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) if (!bExtracted) continue; - if ((nLayerID == SC_LAYER_INTERN) || (nLayerID == SC_LAYER_HIDDEN)) + if ((SdrLayerID(nLayerID) == SC_LAYER_INTERN) || (SdrLayerID(nLayerID) == SC_LAYER_HIDDEN)) { CollectInternalShape(xShape); continue; 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& 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."); } } } diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index a92397a112f5..02215b8e1093 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -373,7 +373,7 @@ void ScDrawShell::GetAttrFuncState(SfxItemSet &rSet) rSet.DisableItem( SID_ATTRIBUTES_AREA ); } -bool ScDrawShell::AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList& rMark) +bool ScDrawShell::AreAllObjectsOnLayer(SdrLayerID nLayerNo,const SdrMarkList& rMark) { bool bResult=true; const size_t nCount = rMark.GetMarkCount(); diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx index 0da1b1532f05..b1955160e734 100644 --- a/sc/source/ui/inc/drawsh.hxx +++ b/sc/source/ui/inc/drawsh.hxx @@ -24,6 +24,7 @@ #include "shellids.hxx" #include #include +#include #include #include @@ -84,7 +85,7 @@ public: ScDrawView* GetDrawView(); - static bool AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList& rMark); + static bool AreAllObjectsOnLayer(SdrLayerID nLayerNo,const SdrMarkList& rMark); void GetDrawAttrStateForIFBX( SfxItemSet& rSet ); ::rtl::OUString GetSidebarContextName(); diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index f60d99d83e28..b747207d5e2b 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -84,7 +84,7 @@ public: void MarkDropObj( SdrObject* pObj ); - void SetMarkedToLayer( sal_uInt8 nLayerNo ); + void SetMarkedToLayer( SdrLayerID nLayerNo ); void InvalidateAttribs(); void InvalidateDrawTextAttrs(); diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 289640098e6b..ac90b1a14287 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -255,7 +255,7 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou SdrObject* GetEditObject(); bool IsMyModel(SdrEditView* pSdrView); - void DrawRedraw( ScOutputData& rOutputData, sal_uLong nLayer ); + void DrawRedraw( ScOutputData& rOutputData, SdrLayerID nLayer ); void DrawSdrGrid( const tools::Rectangle& rDrawingRect, OutputDevice* pContentDev ); void DrawAfterScroll(); tools::Rectangle GetListValButtonRect( const ScAddress& rButtonPos ); diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index 26dad1add045..c5bc27d82e86 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -314,12 +314,12 @@ public: void DrawClear(); // #i72502# printer only command set - Point PrePrintDrawingLayer(long nLogStX, long nLogStY ); - void PostPrintDrawingLayer(const Point& rMMOffset); // #i74768# need offset for FormLayer - void PrintDrawingLayer(const sal_uInt16 nLayer, const Point& rMMOffset); + Point PrePrintDrawingLayer(long nLogStX, long nLogStY ); + void PostPrintDrawingLayer(const Point& rMMOffset); // #i74768# need offset for FormLayer + void PrintDrawingLayer(SdrLayerID nLayer, const Point& rMMOffset); // only screen: - void DrawSelectiveObjects(const sal_uInt16 nLayer); + void DrawSelectiveObjects(SdrLayerID nLayer); bool SetChangedClip(); // sal_False = not vcl::Region GetChangedAreaRegion(); diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 1758f7d8a062..e8b2e064bd85 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -209,7 +209,7 @@ void ScDrawView::InvalidateDrawTextAttrs() rBindings.Invalidate( SID_ALIGN_ANY_JUSTIFIED ); } -void ScDrawView::SetMarkedToLayer( sal_uInt8 nLayerNo ) +void ScDrawView::SetMarkedToLayer( SdrLayerID nLayerNo ) { if (AreObjectsMarked()) { @@ -224,7 +224,7 @@ void ScDrawView::SetMarkedToLayer( sal_uInt8 nLayerNo ) SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj(); if ( dynamic_cast( pObj) == nullptr && (pObj->GetLayer() != SC_LAYER_INTERN) ) { - AddUndo( new SdrUndoObjectLayerChange( *pObj, pObj->GetLayer(), (SdrLayerID)nLayerNo) ); + AddUndo( new SdrUndoObjectLayerChange( *pObj, pObj->GetLayer(), nLayerNo) ); pObj->SetLayer( nLayerNo ); } } diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index cb15a6a40476..3383f18d0720 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -185,7 +185,7 @@ bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt) return false; } -void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, sal_uLong nLayer ) +void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, SdrLayerID nLayer ) { const ScViewOptions& rOpts = pViewData->GetOptions(); @@ -206,7 +206,7 @@ void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, sal_uLong nLayer ) pDrView->setHideFormControl(!bDrawDraw); } - rOutputData.DrawSelectiveObjects((sal_uInt16)nLayer); + rOutputData.DrawSelectiveObjects(nLayer); } } diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 55f2aad1fa5f..168879acaed5 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -131,7 +131,7 @@ void ScOutputData::PostPrintDrawingLayer(const Point& rMMOffset) // #i74768# } // #i72502# -void ScOutputData::PrintDrawingLayer(const sal_uInt16 nLayer, const Point& rMMOffset) +void ScOutputData::PrintDrawingLayer(SdrLayerID nLayer, const Point& rMMOffset) { bool bHideAllDrawingLayer(false); @@ -166,7 +166,7 @@ void ScOutputData::PrintDrawingLayer(const sal_uInt16 nLayer, const Point& rMMOf } } -void ScOutputData::DrawSelectiveObjects(const sal_uInt16 nLayer) +void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer) { ScDrawLayer* pModel = mpDoc->GetDrawLayer(); if (!pModel) diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 3431ba90b026..baa71139cce2 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -1346,9 +1346,9 @@ sal_uInt16 SdDrawDocument::DuplicatePage (sal_uInt16 nPageNum) // Get background flags SdrLayerAdmin& rLayerAdmin = GetLayerAdmin(); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); - SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerIDSet aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers(); return DuplicatePage ( pActualPage, ePageKind, @@ -1490,9 +1490,9 @@ void SdDrawDocument::SetupNewPage ( if (pPreviousPage != nullptr) { SdrLayerAdmin& rLayerAdmin = GetLayerAdmin(); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); - SetOfByte aVisibleLayers = pPreviousPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerIDSet aVisibleLayers = pPreviousPage->TRG_GetMasterPageVisibleLayers(); aVisibleLayers.Set(aBckgrnd, bIsPageBack); aVisibleLayers.Set(aBckgrndObj, bIsPageObj); pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index d0220f6b631f..f334f155d2e3 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1691,13 +1691,13 @@ void SdPage::NbcInsertObject(SdrObject* pObj, size_t nPos) SdrLayerID nId = pObj->GetLayer(); if( mbMaster ) { - if( nId == 0 ) - pObj->NbcSetLayer( 2 ); // wrong layer. corrected to BackgroundObj layer + if( nId == SdrLayerID(0) ) + pObj->NbcSetLayer( SdrLayerID(2) ); // wrong layer. corrected to BackgroundObj layer } else { - if( nId == 2 ) - pObj->NbcSetLayer( 0 ); // wrong layer. corrected to layout layer + if( nId == SdrLayerID(2) ) + pObj->NbcSetLayer( SdrLayerID(0) ); // wrong layer. corrected to layout layer } } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 8af77d0965f8..0101a5243034 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1519,7 +1519,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations { if(pPage->TRG_HasMasterPage()) { - SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); aVisibleLayers.Set(mnBackgroundObjectsLayerID, false); pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); } diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 3d77b676884b..a62a59603403 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -128,9 +128,9 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt ) if( !pDrViewSh->GetDocSh()->IsReadOnly() ) { - sal_uInt16 nPageId = SDRPAGE_NOTFOUND; - Point aPos( PixelToLogic( rEvt.maPosPixel ) ); - sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID( + sal_uInt16 nPageId = SDRPAGE_NOTFOUND; + Point aPos( PixelToLogic( rEvt.maPosPixel ) ); + SdrLayerID nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID( GetPageText( GetPageId( aPos ) ) ); nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, nPageId, nLayerId ); @@ -146,8 +146,8 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt ) */ sal_Int8 LayerTabBar::ExecuteDrop( const ExecuteDropEvent& rEvt ) { - sal_uInt16 nPageId = SDRPAGE_NOTFOUND; - sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID( + sal_uInt16 nPageId = SDRPAGE_NOTFOUND; + SdrLayerID nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID( GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ) ); sal_Int8 nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, nPageId, nLayerId ); diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 404b3be53d65..d82d59beca5f 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -603,7 +603,7 @@ bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos) if (bAnimationInfo || bImageMapInfo) { - const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers(); + const SdrLayerIDSet* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers(); sal_uInt16 nHitLog(sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width())); long n2HitLog(nHitLog * 2); Point aHitPosR(rPos); diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx index f49a3885a844..c89b10289879 100644 --- a/sd/source/ui/func/fuexpand.cxx +++ b/sd/source/ui/func/fuexpand.cxx @@ -99,7 +99,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) pOutl->SetDefTab( mpDoc->GetDefaultTabulator() ); pOutl->SetStyleSheetPool(static_cast(mpDoc->GetStyleSheetPool())); - SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers(); sal_uInt16 nActualPageNum = pActualPage->GetPageNum(); SdPage* pActualNotesPage = static_cast(mpDoc->GetPage(nActualPageNum + 1)); SdrTextObj* pActualOutline = static_cast(pActualPage->GetPresObj(PRESOBJ_OUTLINE)); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 846b2e208cc5..29e0e4490ce7 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -1202,7 +1202,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) bFilled = rFillStyle.GetValue() != drawing::FillStyle_NONE; } - const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers(); + const SdrLayerIDSet* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers(); sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() ); const long n2HitLog = nHitLog * 2; Point aHitPosR(rPos); diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx index e6a63b0f654e..e6377d7d1b1d 100644 --- a/sd/source/ui/func/fusumry.cxx +++ b/sd/source/ui/func/fusumry.cxx @@ -116,7 +116,7 @@ void FuSummaryPage::DoExecute( SfxRequest& ) bBegUndo = true; } - SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers(); // page with title & structuring! pSummaryPage = mpDoc->AllocSdPage(false); diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index d42b514753d3..3b5377deb9f4 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -283,9 +283,9 @@ public: bool IsLayerModeActive() const { return mbIsLayerModeActive;} virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper, - ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer ) override; + ::sd::Window* pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer ) override; virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper, - ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer ) override; + ::sd::Window* pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer ) override; virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >&, bool bBrowse ) override; virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >&, bool bBrowse ) override; diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx index 4ae22cc04c2d..6186a363f146 100644 --- a/sd/source/ui/inc/FrameView.hxx +++ b/sd/source/ui/inc/FrameView.hxx @@ -55,17 +55,17 @@ public: { maHandoutHelpLines = rHelpLines; } const SdrHelpLineList& GetHandoutHelpLines() { return maHandoutHelpLines; } - void SetVisibleLayers(const SetOfByte& rVisibleLayers) + void SetVisibleLayers(const SdrLayerIDSet& rVisibleLayers) { maVisibleLayers = rVisibleLayers; } - const SetOfByte& GetVisibleLayers() { return maVisibleLayers; } + const SdrLayerIDSet& GetVisibleLayers() { return maVisibleLayers; } - void SetLockedLayers(const SetOfByte& rLockedLayers) + void SetLockedLayers(const SdrLayerIDSet& rLockedLayers) { maLockedLayers = rLockedLayers; } - const SetOfByte& GetLockedLayers() { return maLockedLayers; } + const SdrLayerIDSet& GetLockedLayers() { return maLockedLayers; } - void SetPrintableLayers(const SetOfByte& rPrintableLayers) + void SetPrintableLayers(const SdrLayerIDSet& rPrintableLayers) { maPrintableLayers = rPrintableLayers; } - const SetOfByte& GetPrintableLayers() { return maPrintableLayers; } + const SdrLayerIDSet& GetPrintableLayers() { return maPrintableLayers; } void SetRuler(const bool bRulerOn) { mbRuler = bRulerOn; } @@ -171,9 +171,9 @@ public: private: sal_uInt16 mnRefCount; bool mbRuler; - SetOfByte maVisibleLayers; - SetOfByte maLockedLayers; - SetOfByte maPrintableLayers; + SdrLayerIDSet maVisibleLayers; + SdrLayerIDSet maLockedLayers; + SdrLayerIDSet maPrintableLayers; SdrHelpLineList maStandardHelpLines; SdrHelpLineList maNotesHelpLines; SdrHelpLineList maHandoutHelpLines; diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx index 27a17bb07a81..7bbd68a47510 100644 --- a/sd/source/ui/inc/OutlineView.hxx +++ b/sd/source/ui/inc/OutlineView.hxx @@ -128,12 +128,12 @@ public: DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) override; + SdrLayerID nLayer) override; virtual sal_Int8 ExecuteDrop ( const ExecuteDropEvent& rEvt, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) override; + SdrLayerID nLayer) override; // Re-implement GetScriptType for this view to get correct results virtual SvtScriptType GetScriptType() const override; diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx index c29b295bfb16..5f3e4c284756 100644 --- a/sd/source/ui/inc/SlideSorterViewShell.hxx +++ b/sd/source/ui/inc/SlideSorterViewShell.hxx @@ -140,13 +140,13 @@ public: DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer ) override; + SdrLayerID nLayer ) override; virtual sal_Int8 ExecuteDrop ( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) override; + SdrLayerID nLayer) override; typedef ::std::vector PageSelection; diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 58915b3e5149..d1fda4c1d417 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -102,12 +102,12 @@ public: DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer); + SdrLayerID nLayer); virtual sal_Int8 ExecuteDrop ( const ExecuteDropEvent& rEvt, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer); + SdrLayerID nLayer); css::uno::Reference CreateClipboardDataObject (); @@ -135,7 +135,7 @@ public: bool InsertData( const TransferableDataHelper& rDataHelper, const Point& rPos, sal_Int8& rDnDAction, bool bDrag, SotClipboardFormatId nFormat = SotClipboardFormatId::NONE, - sal_uInt16 nPage = SDRPAGE_NOTFOUND, sal_uInt16 nLayer = SDRLAYER_NOTFOUND ); + sal_uInt16 nPage = SDRPAGE_NOTFOUND, SdrLayerID nLayer = SDRLAYER_NOTFOUND ); /** gets the metafile from the given transferable helper and insert it as a graphic shape. @param bOptimize if set to true, the metafile is analyzed and if only one bitmap action is present, then is inserted as a single graphic. diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 7fcc96cdff92..e736bb1982d9 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -273,9 +273,9 @@ public: void GetMenuState(SfxItemSet& rSet); virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper, - ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer ); + ::sd::Window* pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer ); virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper, - ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer ); + ::sd::Window* pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer ); virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >&, bool bBrowse ); virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >&, bool bBrowse ); diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 51ec16651ba1..93159a16beae 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -467,9 +467,9 @@ SfxRequest LayoutMenu::CreateRequest ( do { SdrLayerAdmin& rLayerAdmin (mrBase.GetDocument()->GetLayerAdmin()); - sal_uInt8 aBackground (rLayerAdmin.GetLayerID( + SdrLayerID aBackground (rLayerAdmin.GetLayerID( SD_RESSTR(STR_LAYER_BCKGRND))); - sal_uInt8 aBackgroundObject (rLayerAdmin.GetLayerID( + SdrLayerID aBackgroundObject (rLayerAdmin.GetLayerID( SD_RESSTR(STR_LAYER_BCKGRNDOBJ))); ViewShell* pViewShell = mrBase.GetMainViewShell().get(); if (pViewShell == nullptr) @@ -478,7 +478,7 @@ SfxRequest LayoutMenu::CreateRequest ( if (pPage == nullptr) break; - SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers()); + SdrLayerIDSet aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers()); aRequest.AppendItem( SfxStringItem (ID_VAL_PAGENAME, OUString()));//pPage->GetName())); diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index d69a340e67d0..4f3d4d23e5c8 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -632,7 +632,7 @@ sal_Int8 Clipboard::AcceptDrop ( DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { sal_Int8 nAction (DND_ACTION_NONE); @@ -700,7 +700,7 @@ sal_Int8 Clipboard::ExecuteDrop ( DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { sal_Int8 nResult = DND_ACTION_NONE; mxUndoContext.reset(); @@ -886,7 +886,7 @@ sal_Int8 Clipboard::ExecuteOrAcceptShapeDrop ( DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { sal_Int8 nResult = 0; diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index b4dfa803e5db..aef29161a600 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -946,9 +946,9 @@ bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUStri // Undo SdPage* pUndoPage = pPageToRename; SdrLayerAdmin & rLayerAdmin = pDocument->GetLayerAdmin(); - sal_uInt8 nBackground = rLayerAdmin.GetLayerID( SD_RESSTR( STR_LAYER_BCKGRND ) ); - sal_uInt8 nBgObj = rLayerAdmin.GetLayerID( SD_RESSTR( STR_LAYER_BCKGRNDOBJ ) ); - SetOfByte aVisibleLayers = pPageToRename->TRG_GetMasterPageVisibleLayers(); + SdrLayerID nBackground = rLayerAdmin.GetLayerID( SD_RESSTR( STR_LAYER_BCKGRND ) ); + SdrLayerID nBgObj = rLayerAdmin.GetLayerID( SD_RESSTR( STR_LAYER_BCKGRNDOBJ ) ); + SdrLayerIDSet aVisibleLayers = pPageToRename->TRG_GetMasterPageVisibleLayers(); // (#67720#) ModifyPageUndoAction* pAction = new ModifyPageUndoAction( diff --git a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx index bc0ce0836174..03d981e3c957 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx @@ -92,14 +92,14 @@ public: DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer ); + SdrLayerID nLayer ); sal_Int8 ExecuteDrop ( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer ); + SdrLayerID nLayer ); void Abort(); @@ -215,7 +215,7 @@ private: DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer); + SdrLayerID nLayer); /** Return whether the insertion defined by the transferable is trivial, ie would not change either source nor target document. diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 1f015f1ae9bc..ef7d146c8d9d 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -643,7 +643,7 @@ sal_Int8 SlideSorterViewShell::AcceptDrop ( DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { OSL_ASSERT(mpSlideSorter.get()!=nullptr); return mpSlideSorter->GetController().GetClipboard().AcceptDrop ( @@ -659,7 +659,7 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop ( DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { OSL_ASSERT(mpSlideSorter.get()!=nullptr); return mpSlideSorter->GetController().GetClipboard().ExecuteDrop ( diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 3ce581a80ef7..aa2d98380918 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -351,7 +351,7 @@ void SdLayer::set( LayerAttribute what, bool flag ) throw() if(pFrameView) { - SetOfByte aNewLayers; + SdrLayerIDSet aNewLayers; switch(what) { case VISIBLE: aNewLayers = pFrameView->GetVisibleLayers(); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index b86bb4f8b30e..b5c478e549f1 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -468,8 +468,8 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) { sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PageKind::Standard ); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); SdPage* pStandardPage = nullptr; @@ -486,7 +486,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) { // here we determine the page after which we should insert SdPage* pPreviousStandardPage = mpDoc->GetSdPage( std::min( (sal_uInt16)(nPageCount - 1), nPage ), PageKind::Standard ); - SetOfByte aVisibleLayers = pPreviousStandardPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPreviousStandardPage->TRG_GetMasterPageVisibleLayers(); bool bIsPageBack = aVisibleLayers.IsSet( aBckgrnd ); bool bIsPageObj = aVisibleLayers.IsSet( aBckgrndObj ); @@ -1824,7 +1824,7 @@ bool ImplRenderPaintProc::IsVisible( const SdrObject* pObj ) const SdrLayerID nLayerId = pObj->GetLayer(); if( pSdrPageView ) { - const SdrLayer* pSdrLayer = rLayerAdmin.GetLayer( nLayerId ); + const SdrLayer* pSdrLayer = rLayerAdmin.GetLayerPerID( nLayerId ); if ( pSdrLayer ) { OUString aLayerName = pSdrLayer->GetName(); @@ -1839,7 +1839,7 @@ bool ImplRenderPaintProc::IsPrintable( const SdrObject* pObj ) const SdrLayerID nLayerId = pObj->GetLayer(); if( pSdrPageView ) { - const SdrLayer* pSdrLayer = rLayerAdmin.GetLayer( nLayerId ); + const SdrLayer* pSdrLayer = rLayerAdmin.GetLayerPerID( nLayerId ); if ( pSdrLayer ) { OUString aLayerName = pSdrLayer->GetName(); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index d865abc448e4..72a4025470e7 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -792,7 +792,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); - SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); aVisibleLayers.Set(rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)), bVisible); pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); } @@ -812,7 +812,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); - SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); aVisibleLayers.Set(rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)), bVisible); pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); } @@ -1217,7 +1217,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); - SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); aAny <<= aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND))); } else @@ -1236,7 +1236,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); - SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); aAny <<= aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ))); } else diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index f1c6d3186a0d..9d29bcac5c99 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -292,8 +292,8 @@ namespace { SdPage& rPage, View* pView, const bool bPrintMarkedOnly, - const SetOfByte& rVisibleLayers, - const SetOfByte& rPrintableLayers) + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) { rPrintView.ShowSdrPage(&rPage); @@ -698,8 +698,8 @@ namespace { ViewShell& rViewShell, View* pView, DrawView& rPrintView, - const SetOfByte& rVisibleLayers, - const SetOfByte& rPrintableLayers) const = 0; + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const = 0; DrawModeFlags GetDrawMode() const { return mnDrawMode; } Orientation GetOrientation() const { return meOrientation; } @@ -744,8 +744,8 @@ namespace { ViewShell& rViewShell, View* pView, DrawView& rPrintView, - const SetOfByte& rVisibleLayers, - const SetOfByte& rPrintableLayers) const override + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const override { (void)rViewShell; SdPage* pPageToPrint = rDocument.GetSdPage(mnPageIndex, mePageKind); @@ -795,8 +795,8 @@ namespace { ViewShell& rViewShell, View* pView, DrawView& rPrintView, - const SetOfByte& rVisibleLayers, - const SetOfByte& rPrintableLayers) const override + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const override { (void)rViewShell; SdPage* pPageToPrint = rDocument.GetSdPage(mnPageIndex, mePageKind); @@ -878,8 +878,8 @@ namespace { ViewShell& rViewShell, View* pView, DrawView& rPrintView, - const SetOfByte& rVisibleLayers, - const SetOfByte& rPrintableLayers) const override + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const override { (void)rViewShell; MapMode aMap (maMap); @@ -948,8 +948,8 @@ namespace { ViewShell& rViewShell, View* pView, DrawView& rPrintView, - const SetOfByte& rVisibleLayers, - const SetOfByte& rPrintableLayers) const override + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const override { SdPage& rHandoutPage (*rDocument.GetSdPage(0, PageKind::Handout)); @@ -1094,8 +1094,8 @@ namespace { ViewShell& rViewShell, View* pView, DrawView& rPrintView, - const SetOfByte& rVisibleLayers, - const SetOfByte& rPrintableLayers) const override + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const override { (void)rViewShell; (void)pView; diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 581c182049e3..5a9fca237af6 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -93,7 +93,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( { SdDrawDocument* pDocument = mrViewShell.GetDoc(); SdrLayerAdmin& rLayerAdmin = pDocument->GetLayerAdmin(); - SetOfByte aVisibleLayers; + SdrLayerIDSet aVisibleLayers; bool bHandoutMode = false; SdPage* pHandoutMPage = nullptr; OUString aNewName; @@ -198,8 +198,8 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( pCurrentPage->SetAutoLayout(aNewAutoLayout, true); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); aVisibleLayers.Set(aBckgrnd, bBVisible); aVisibleLayers.Set(aBckgrndObj, bBObjsVisible); pCurrentPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); @@ -259,10 +259,10 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind eP // Transform the given request into the four argument form that is // understood by ProcessModifyPageSlot(). SdrLayerAdmin& rLayerAdmin (mrViewShell.GetViewShellBase().GetDocument()->GetLayerAdmin()); - sal_uInt8 aBackground (rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND))); - sal_uInt8 aBackgroundObject (rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ))); + SdrLayerID aBackground (rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND))); + SdrLayerID aBackgroundObject (rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ))); - SetOfByte aVisibleLayers; + SdrLayerIDSet aVisibleLayers; if( pPage->GetPageKind() == PageKind::Handout ) aVisibleLayers.SetAll(); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 2ea8063470ab..5007bfff0f52 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -1140,7 +1140,7 @@ void DrawViewShell::ResetActualLayer() // this is needed when one layer is renamed to // restore current layer sal_uInt16 nOldLayerCnt = pLayerBar->GetPageCount(); - sal_uInt16 nOldLayerId = pLayerBar->GetCurPageId(); + sal_uInt16 nOldLayerPos = pLayerBar->GetCurPageId(); /** * Update for LayerTab @@ -1154,17 +1154,17 @@ void DrawViewShell::ResetActualLayer() OUString aLayoutLayer = SD_RESSTR(STR_LAYER_LAYOUT); OUString aControlsLayer = SD_RESSTR(STR_LAYER_CONTROLS); OUString aMeasureLinesLayer = SD_RESSTR(STR_LAYER_MEASURELINES); - sal_uInt16 nActiveLayer = SDRLAYER_NOTFOUND; + sal_uInt16 nActiveLayerPos = SDRLAYERPOS_NOTFOUND; SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount(); - for ( sal_uInt16 nLayer = 0; nLayer < nLayerCnt; nLayer++ ) + for ( sal_uInt16 nLayerPos = 0; nLayerPos < nLayerCnt; nLayerPos++ ) { - aName = rLayerAdmin.GetLayer(nLayer)->GetName(); + aName = rLayerAdmin.GetLayer(nLayerPos)->GetName(); if ( aName == aActiveLayer ) { - nActiveLayer = nLayer; + nActiveLayerPos = nLayerPos; } if ( aName != aBackgroundLayer ) @@ -1176,7 +1176,7 @@ void DrawViewShell::ResetActualLayer() aName != aControlsLayer && aName != aMeasureLinesLayer) { - pLayerBar->InsertPage(nLayer+1, aName); + pLayerBar->InsertPage(nLayerPos+1, aName); TabBarPageBits nBits = 0; SdrPageView* pPV = mpDrawView->GetSdrPageView(); @@ -1187,7 +1187,7 @@ void DrawViewShell::ResetActualLayer() nBits = TPB_SPECIAL; } - pLayerBar->SetPageBits(nLayer+1, nBits); + pLayerBar->SetPageBits(nLayerPos+1, nBits); } } else @@ -1195,7 +1195,7 @@ void DrawViewShell::ResetActualLayer() // don't show masterpage layer onto the page if ( aName != aBackgroundObjLayer ) { - pLayerBar->InsertPage(nLayer+1, aName); + pLayerBar->InsertPage(nLayerPos+1, aName); TabBarPageBits nBits = 0; @@ -1205,27 +1205,27 @@ void DrawViewShell::ResetActualLayer() nBits = TPB_SPECIAL; } - pLayerBar->SetPageBits(nLayer+1, nBits); + pLayerBar->SetPageBits(nLayerPos+1, nBits); } } } } - if ( nActiveLayer == SDRLAYER_NOTFOUND ) + if ( nActiveLayerPos == SDRLAYERPOS_NOTFOUND ) { if( nOldLayerCnt == pLayerBar->GetPageCount() ) { - nActiveLayer = nOldLayerId - 1; + nActiveLayerPos = nOldLayerPos - 1; } else { - nActiveLayer = ( meEditMode == EditMode::MasterPage ) ? 2 : 0; + nActiveLayerPos = ( meEditMode == EditMode::MasterPage ) ? 2 : 0; } - mpDrawView->SetActiveLayer( pLayerBar->GetPageText(nActiveLayer + 1) ); + mpDrawView->SetActiveLayer( pLayerBar->GetPageText(nActiveLayerPos + 1) ); } - pLayerBar->SetCurPageId(nActiveLayer + 1); + pLayerBar->SetCurPageId(nActiveLayerPos + 1); GetViewFrame()->GetBindings().Invalidate( SID_MODIFYLAYER ); GetViewFrame()->GetBindings().Invalidate( SID_DELETE_LAYER ); } @@ -1240,7 +1240,7 @@ sal_Int8 DrawViewShell::AcceptDrop ( DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer ) + SdrLayerID nLayer ) { if( nPage != SDRPAGE_NOTFOUND ) nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum(); @@ -1260,7 +1260,7 @@ sal_Int8 DrawViewShell::ExecuteDrop ( DropTargetHelper& /*rTargetHelper*/, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { if( nPage != SDRPAGE_NOTFOUND ) nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum(); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 3e1a597c4e7f..1ea7eae77139 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2864,9 +2864,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if (pPage != nullptr && GetDoc() != nullptr) { - SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); - sal_uInt8 aLayerId; + SdrLayerID aLayerId; if (nSId == SID_DISPLAY_MASTER_BACKGROUND) aLayerId = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); else diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index c71a0641b227..9e9c3bbee364 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1520,10 +1520,10 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) SdPage* pPage = GetActualPage(); if (pPage != nullptr && GetDoc() != nullptr) { - SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); - sal_uInt8 aBackgroundId = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aObjectId = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerID aBackgroundId = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aObjectId = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); rSet.Put(SfxBoolItem(SID_DISPLAY_MASTER_BACKGROUND, aVisibleLayers.IsSet(aBackgroundId))); rSet.Put(SfxBoolItem(SID_DISPLAY_MASTER_OBJECTS, diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index c623adcb6517..3a97a1b183ed 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -668,7 +668,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) if (IsLayerModeActive()) { SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); - SdrLayerID nLayer = 0, nOldLayer = 0; + SdrLayerID nLayer(0), nOldLayer(0); SdrObject* pObj = nullptr; const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); const size_t nMarkCount = rMarkList.GetMarkCount(); diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index 8c6a43d8a8dc..a9a60fb35408 100644 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -81,9 +81,9 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const OUString & rName ) // Undo SdPage* pUndoPage = pPageToRename; SdrLayerAdmin & rLayerAdmin = GetDoc()->GetLayerAdmin(); - sal_uInt8 nBackground = rLayerAdmin.GetLayerID( SD_RESSTR(STR_LAYER_BCKGRND) ); - sal_uInt8 nBgObj = rLayerAdmin.GetLayerID( SD_RESSTR(STR_LAYER_BCKGRNDOBJ) ); - SetOfByte aVisibleLayers = mpActualPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerID nBackground = rLayerAdmin.GetLayerID( SD_RESSTR(STR_LAYER_BCKGRND) ); + SdrLayerID nBgObj = rLayerAdmin.GetLayerID( SD_RESSTR(STR_LAYER_BCKGRNDOBJ) ); + SdrLayerIDSet aVisibleLayers = mpActualPage->TRG_GetMasterPageVisibleLayers(); ::svl::IUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager(); ModifyPageUndoAction* pAction = new ModifyPageUndoAction( diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index e64042487324..7572c368074c 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -859,21 +859,21 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr } else if (!bImpress && pValue->Name == sUNO_View_VisibleLayers ) { - SetOfByte aSetOfBytes; - aSetOfBytes.PutValue( pValue->Value ); - SetVisibleLayers( aSetOfBytes ); + SdrLayerIDSet aSdrLayerIDSets; + aSdrLayerIDSets.PutValue( pValue->Value ); + SetVisibleLayers( aSdrLayerIDSets ); } else if (!bImpress && pValue->Name == sUNO_View_PrintableLayers ) { - SetOfByte aSetOfBytes; - aSetOfBytes.PutValue( pValue->Value ); - SetPrintableLayers( aSetOfBytes ); + SdrLayerIDSet aSdrLayerIDSets; + aSdrLayerIDSets.PutValue( pValue->Value ); + SetPrintableLayers( aSdrLayerIDSets ); } else if (!bImpress && pValue->Name == sUNO_View_LockedLayers ) { - SetOfByte aSetOfBytes; - aSetOfBytes.PutValue( pValue->Value ); - SetLockedLayers( aSetOfBytes ); + SdrLayerIDSet aSdrLayerIDSets; + aSdrLayerIDSets.PutValue( pValue->Value ); + SetLockedLayers( aSdrLayerIDSets ); } } diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 3a859aa68662..2a4ce761c013 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1361,12 +1361,12 @@ void OutlineView::ResetLinks() const mrOutliner.SetEndPasteOrDropHdl(Link()); } -sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, sal_uInt16) +sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, SdrLayerID) { return DND_ACTION_NONE; } -sal_Int8 OutlineView::ExecuteDrop( const ExecuteDropEvent&, ::sd::Window*, sal_uInt16, sal_uInt16) +sal_Int8 OutlineView::ExecuteDrop( const ExecuteDropEvent&, ::sd::Window*, sal_uInt16, SdrLayerID) { return DND_ACTION_NONE; } diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 76af9466f9d4..41b935b4aa0d 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -438,7 +438,7 @@ void View::DragFinished( sal_Int8 nDropAction ) } sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper, - ::sd::Window*, sal_uInt16, sal_uInt16 nLayer ) + ::sd::Window*, sal_uInt16, SdrLayerID nLayer ) { OUString aLayerName = GetActiveLayer(); SdrPageView* pPV = GetSdrPageView(); @@ -615,7 +615,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge } sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, - ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer ) + ::sd::Window* pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer ) { SdrPageView* pPV = GetSdrPageView(); OUString aActiveLayer = GetActiveLayer(); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 26deaffc2e23..d5129135d8ac 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -259,7 +259,7 @@ bool View::InsertMetaFile( TransferableDataHelper& rDataHelper, const Point& rPo bool View::InsertData( const TransferableDataHelper& rDataHelper, const Point& rPos, sal_Int8& rDnDAction, bool bDrag, - SotClipboardFormatId nFormat, sal_uInt16 nPage, sal_uInt16 nLayer ) + SotClipboardFormatId nFormat, sal_uInt16 nPage, SdrLayerID nLayer ) { maDropPos = rPos; mnAction = rDnDAction; @@ -411,11 +411,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( IsUndoEnabled() ) { BegUndo(SD_RESSTR(STR_MODIFYLAYER)); - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectLayerChange(*pO, pO->GetLayer(), (SdrLayerID)nLayer)); + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectLayerChange(*pO, pO->GetLayer(), nLayer)); EndUndo(); } - pO->SetLayer( (SdrLayerID) nLayer ); + pO->SetLayer( nLayer ); } } @@ -1351,7 +1351,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Point aHitPosL( rPos ); Point aHitPosT( rPos ); Point aHitPosB( rPos ); - const SetOfByte* pVisiLayer = &GetSdrPageView()->GetVisibleLayers(); + const SdrLayerIDSet* pVisiLayer = &GetSdrPageView()->GetVisibleLayers(); aHitPosR.X() += n2HitLog; aHitPosL.X() -= n2HitLog; diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx index 3716eb566b7a..b852eb58644c 100644 --- a/sd/source/ui/view/unmodpg.cxx +++ b/sd/source/ui/view/unmodpg.cxx @@ -58,9 +58,9 @@ ModifyPageUndoAction::ModifyPageUndoAction( { maOldName = mpPage->GetName(); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); - SetOfByte aVisibleLayers = mpPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerIDSet aVisibleLayers = mpPage->TRG_GetMasterPageVisibleLayers(); mbOldBckgrndVisible = aVisibleLayers.IsSet(aBckgrnd); mbOldBckgrndObjsVisible = aVisibleLayers.IsSet(aBckgrndObj); @@ -104,9 +104,9 @@ void ModifyPageUndoAction::Undo() } SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); - SetOfByte aVisibleLayers; + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerIDSet aVisibleLayers; aVisibleLayers.Set(aBckgrnd, mbOldBckgrndVisible); aVisibleLayers.Set(aBckgrndObj, mbOldBckgrndObjsVisible); mpPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); @@ -147,9 +147,9 @@ void ModifyPageUndoAction::Redo() } SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); - SetOfByte aVisibleLayers; + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerIDSet aVisibleLayers; aVisibleLayers.Set(aBckgrnd, mbNewBckgrndVisible); aVisibleLayers.Set(aBckgrndObj, mbNewBckgrndObjsVisible); mpPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 7d409d7021bf..4ed63c6f5387 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -944,7 +944,7 @@ sal_Int8 ViewShell::AcceptDrop ( DropTargetHelper& rTargetHelper, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { ::sd::View* pView = GetView(); return( pView ? pView->AcceptDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer ) : DND_ACTION_NONE ); @@ -955,7 +955,7 @@ sal_Int8 ViewShell::ExecuteDrop ( DropTargetHelper& /*rTargetHelper*/, ::sd::Window* pTargetWindow, sal_uInt16 nPage, - sal_uInt16 nLayer) + SdrLayerID nLayer) { ::sd::View* pView = GetView(); return pView ? pView->ExecuteDrop( rEvt, pTargetWindow, nPage, nLayer ) : DND_ACTION_NONE; diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index aa83468634c6..c24307a678de 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -202,9 +202,9 @@ SdPage* ViewShell::CreateOrDuplicatePage ( sal_uInt16 nSId = rRequest.GetSlot(); SdDrawDocument* pDocument = GetDoc(); SdrLayerAdmin& rLayerAdmin = pDocument->GetLayerAdmin(); - sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); - sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); - SetOfByte aVisibleLayers; + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND)); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ)); + SdrLayerIDSet aVisibleLayers; // Determine the page from which to copy some values, such as layers, // size, master page, to the new page. This is usually the given page. // When the given page is NULL then use the first page of the document. diff --git a/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx index 416ca0fb633b..af2dd6644998 100644 --- a/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx +++ b/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx @@ -37,7 +37,7 @@ namespace sdr virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override; private: - virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const override; + virtual bool isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const override; }; } // end of namespace contact } // end of namespace sdr diff --git a/svx/inc/sxlayitm.hxx b/svx/inc/sxlayitm.hxx index 47fba3a9b616..9516f4efb9de 100644 --- a/svx/inc/sxlayitm.hxx +++ b/svx/inc/sxlayitm.hxx @@ -26,8 +26,8 @@ class SdrLayerIdItem: public SfxUInt16Item { public: - SdrLayerIdItem(sal_uInt16 nId=0): SfxUInt16Item(SDRATTR_LAYERID,nId) {} - SdrLayerID GetValue() const { return (SdrLayerID)SfxUInt16Item::GetValue(); } + SdrLayerIdItem(SdrLayerID nId): SfxUInt16Item(SDRATTR_LAYERID,sal_uInt8(nId)) {} + SdrLayerID GetValue() const { return SdrLayerID(SfxUInt16Item::GetValue()); } virtual SfxPoolItem* Clone(SfxItemPool* pPool=nullptr) const override; }; diff --git a/svx/source/sdr/contact/displayinfo.cxx b/svx/source/sdr/contact/displayinfo.cxx index c3a219724d24..6a70a879fb88 100644 --- a/svx/source/sdr/contact/displayinfo.cxx +++ b/svx/source/sdr/contact/displayinfo.cxx @@ -39,7 +39,7 @@ namespace sdr } // Access to LayerInfos (which layers to process) - void DisplayInfo::SetProcessLayers(const SetOfByte& rSet) + void DisplayInfo::SetProcessLayers(const SdrLayerIDSet& rSet) { maProcessLayers = rSet; } diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx index 75292d9b860f..f3e2a366a0f2 100644 --- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx @@ -42,7 +42,7 @@ void createSubPrimitive3DVector( const sdr::contact::ViewContact& rCandidate, drawinglayer::primitive3d::Primitive3DContainer& o_rAllTarget, drawinglayer::primitive3d::Primitive3DContainer* o_pVisibleTarget, - const SetOfByte* pVisibleLayerSet, + const SdrLayerIDSet* pVisibleSdrLayerIDSet, const bool bTestSelectedVisibility) { const sdr::contact::ViewContactOfE3dScene* pViewContactOfE3dScene = dynamic_cast< const sdr::contact::ViewContactOfE3dScene* >(&rCandidate); @@ -64,7 +64,7 @@ void createSubPrimitive3DVector( rCandidate.GetViewContact(a), aNewAllTarget, o_pVisibleTarget ? &aNewVisibleTarget : nullptr, - pVisibleLayerSet, + pVisibleSdrLayerIDSet, bTestSelectedVisibility); } @@ -102,13 +102,13 @@ void createSubPrimitive3DVector( // test visibility. Primitive is visible when both tests are true (AND) bool bVisible(true); - if(pVisibleLayerSet) + if(pVisibleSdrLayerIDSet) { // test layer visibility const E3dObject& rE3dObject = pViewContactOfE3d->GetE3dObject(); const SdrLayerID aLayerID(rE3dObject.GetLayer()); - bVisible = pVisibleLayerSet->IsSet(aLayerID); + bVisible = pVisibleSdrLayerIDSet->IsSet(aLayerID); } if(bVisible && bTestSelectedVisibility) @@ -268,7 +268,7 @@ void ViewContactOfE3dScene::createSdrLightingAttribute() } drawinglayer::primitive2d::Primitive2DContainer ViewContactOfE3dScene::createScenePrimitive2DSequence( - const SetOfByte* pLayerVisibility) const + const SdrLayerIDSet* pLayerVisibility) const { drawinglayer::primitive2d::Primitive2DContainer xRetval; const sal_uInt32 nChildrenCount(GetObjectCount()); diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx index 4a4a9e9e7d00..2cd53ba26509 100644 --- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx @@ -82,7 +82,7 @@ namespace sdr // support ghosted for now. This is no problem currently but would need to be // added when sub-groups in 3d will be added one day. const ViewContactOfE3dScene& rViewContact = dynamic_cast< ViewContactOfE3dScene& >(GetViewContact()); - const SetOfByte& rVisibleLayers = rDisplayInfo.GetProcessLayers(); + const SdrLayerIDSet& rVisibleLayers = rDisplayInfo.GetProcessLayers(); drawinglayer::primitive2d::Primitive2DContainer xRetval(rViewContact.createScenePrimitive2DSequence(&rVisibleLayers)); if(!xRetval.empty()) diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx index d67210f3b6e2..cb676b712f7f 100644 --- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx @@ -99,10 +99,10 @@ namespace sdr return xRetval; } - bool ViewObjectContactOfGroup::isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const + bool ViewObjectContactOfGroup::isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const { - SetOfByte aObjectLayers; - getSdrObject().getMergedHierarchyLayerSet(aObjectLayers); + SdrLayerIDSet aObjectLayers; + getSdrObject().getMergedHierarchySdrLayerIDSet(aObjectLayers); aObjectLayers &= aLayers; return !aObjectLayers.IsEmpty(); } diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx index cadd37c6b466..3c9aca92946b 100644 --- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx @@ -72,15 +72,15 @@ namespace sdr rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder()); // Modify DisplayInfo for MasterPageContent collection; remember original layers and - // set combined LayerSet; set MasterPagePaint flag - const SetOfByte aRememberedLayers(rDisplayInfo.GetProcessLayers()); - SetOfByte aPreprocessedLayers(aRememberedLayers); + // set combined SdrLayerIDSet; set MasterPagePaint flag + const SdrLayerIDSet aRememberedLayers(rDisplayInfo.GetProcessLayers()); + SdrLayerIDSet aPreprocessedLayers(aRememberedLayers); aPreprocessedLayers &= rDescriptor.GetVisibleLayers(); rDisplayInfo.SetProcessLayers(aPreprocessedLayers); rDisplayInfo.SetSubContentActive(true); // check layer visibility (traditionally was member of layer 1) - if(aPreprocessedLayers.IsSet(1)) + if(aPreprocessedLayers.IsSet(SdrLayerID(1))) { // hide PageBackground for special DrawModes; historical reasons if(!GetObjectContact().isDrawModeGray() && !GetObjectContact().isDrawModeHighContrast()) diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx index fca9e8d4017b..27216f237357 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx @@ -50,7 +50,7 @@ ViewObjectContactOfSdrObj::~ViewObjectContactOfSdrObj() { } -bool ViewObjectContactOfSdrObj::isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const +bool ViewObjectContactOfSdrObj::isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const { return aLayers.IsSet(getSdrObject().GetLayer()); } diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx index ec3a4d21dba0..a1bdb47f8879 100644 --- a/svx/source/svdraw/sdrhittesthelper.cxx +++ b/svx/source/svdraw/sdrhittesthelper.cxx @@ -38,7 +38,7 @@ SdrObject* SdrObjectPrimitiveHit( const Point& rPnt, sal_uInt16 nTol, const SdrPageView& rSdrPageView, - const SetOfByte* pVisiLayer, + const SdrLayerIDSet* pVisiLayer, bool bTextOnly) { SdrObject* pResult = nullptr; @@ -95,7 +95,7 @@ SdrObject* SdrObjListPrimitiveHit( const Point& rPnt, sal_uInt16 nTol, const SdrPageView& rSdrPageView, - const SetOfByte* pVisiLayer, + const SdrLayerIDSet* pVisiLayer, bool bTextOnly) { size_t nObjNum(rList.GetObjCount()); diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index c35a8cd1aa20..a25cb3570c70 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -72,7 +72,7 @@ namespace sdr maOwnerPage.TRG_ClearMasterPage(); } - void MasterPageDescriptor::SetVisibleLayers(const SetOfByte& rNew) + void MasterPageDescriptor::SetVisibleLayers(const SdrLayerIDSet& rNew) { if(rNew != maVisibleLayers) { diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 76c903c15b92..85a0117df26f 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -307,7 +307,7 @@ void SdrPageWindow::RedrawAll( sdr::contact::ViewObjectContactRedirector* pRedir // get to be processed layers const bool bPrinter(GetPaintWindow().OutputToPrinter()); - SetOfByte aProcessLayers = bPrinter ? mpImpl->mrPageView.GetPrintableLayers() : mpImpl->mrPageView.GetVisibleLayers(); + SdrLayerIDSet aProcessLayers = bPrinter ? mpImpl->mrPageView.GetPrintableLayers() : mpImpl->mrPageView.GetVisibleLayers(); // create PaintInfoRec; use Rectangle only temporarily const vcl::Region& rRegion = GetPaintWindow().GetRedrawRegion(); @@ -361,7 +361,7 @@ void SdrPageWindow::RedrawLayer(const SdrLayerID* pId, // get the layers to process const bool bPrinter(GetPaintWindow().OutputToPrinter()); - SetOfByte aProcessLayers = bPrinter ? mpImpl->mrPageView.GetPrintableLayers() : mpImpl->mrPageView.GetVisibleLayers(); + SdrLayerIDSet aProcessLayers = bPrinter ? mpImpl->mrPageView.GetPrintableLayers() : mpImpl->mrPageView.GetVisibleLayers(); // is the given layer visible at all? if(aProcessLayers.IsSet(*pId)) diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 427242539cc3..ebac16e576af 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -205,7 +205,7 @@ SdrItemPool::SdrItemPool( rPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJSIZEPROTECT, false); rPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrObjPrintableItem; rPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem; - rPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem; + rPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem(SdrLayerID(0)); rPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SdrLayerNameItem; rPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SfxStringItem(SDRATTR_OBJECTNAME); rPoolDefaults[SDRATTR_ALLPOSITIONX -SDRATTR_START]=new SdrAllPositionXItem; diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 2a2b1e309446..2495c472c974 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -396,7 +396,7 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, cons } SdrLayerID nLayer=pCreatePV->GetPage()->GetLayerAdmin().GetLayerID(aLay); - if (nLayer==SDRLAYER_NOTFOUND) nLayer=0; + if (nLayer==SDRLAYER_NOTFOUND) nLayer = SdrLayerID(0); if (!pCreatePV->GetLockedLayers().IsSet(nLayer) && pCreatePV->GetVisibleLayers().IsSet(nLayer)) { if(pPreparedFactoryObject) @@ -621,7 +621,7 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd) if(SDRLAYER_NOTFOUND == nLayer) { - nLayer=0; + nLayer = SdrLayerID(0); } pObj->SetLayer(nLayer); 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; diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 67cd2d764c4e..062c828ca20c 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -789,7 +789,8 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const bool bSizProtect = false, bSizProtectDC = false; bool bPrintable = true, bPrintableDC = false; bool bVisible = true, bVisibleDC = false; - SdrLayerID nLayerId=0; bool bLayerDC=false; + SdrLayerID nLayerId(0); + bool bLayerDC=false; OUString aObjName; bool bObjNameDC=false,bObjNameSet=false; long nSnapPosX=0; bool bSnapPosXDC=false; diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index eeb7af14dd55..94e502646798 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -570,7 +570,7 @@ namespace const SdrObjList& rList, const Point& rPnt, const SdrPageView& rTextEditPV, - const SetOfByte& rVisLayers, + const SdrLayerIDSet& rVisLayers, Color& rCol) { if(!rList.GetModel()) @@ -614,7 +614,7 @@ namespace const SdrPage& rPage, const Point& rPnt, const SdrPageView& rTextEditPV, - const SetOfByte& rVisLayers, + const SdrLayerIDSet& rVisLayers, Color& rCol, bool bSkipBackgroundShape) { @@ -627,7 +627,7 @@ namespace { if(rPage.TRG_HasMasterPage()) { - SetOfByte aSet(rVisLayers); + SdrLayerIDSet aSet(rVisLayers); aSet &= rPage.TRG_GetMasterPageVisibleLayers(); SdrPage& rMasterPage = rPage.TRG_GetMasterPage(); diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx index a10c2aa14fcf..7027e004b5a9 100644 --- a/svx/source/svdraw/svdlayer.cxx +++ b/svx/source/svdraw/svdlayer.cxx @@ -24,7 +24,7 @@ #include "svdglob.hxx" #include "svx/svdstr.hrc" -bool SetOfByte::IsEmpty() const +bool SdrLayerIDSet::IsEmpty() const { for(sal_uInt8 i : aData) { @@ -35,7 +35,7 @@ bool SetOfByte::IsEmpty() const return true; } -void SetOfByte::operator&=(const SetOfByte& r2ndSet) +void SdrLayerIDSet::operator&=(const SdrLayerIDSet& r2ndSet) { for(sal_uInt16 i(0); i < 32; i++) { @@ -45,7 +45,7 @@ void SetOfByte::operator&=(const SetOfByte& r2ndSet) /** initialize this set with a uno sequence of sal_Int8 */ -void SetOfByte::PutValue( const css::uno::Any & rAny ) +void SdrLayerIDSet::PutValue( const css::uno::Any & rAny ) { css::uno::Sequence< sal_Int8 > aSeq; if( rAny >>= aSeq ) @@ -69,7 +69,7 @@ void SetOfByte::PutValue( const css::uno::Any & rAny ) /** returns a uno sequence of sal_Int8 */ -void SetOfByte::QueryValue( css::uno::Any & rAny ) const +void SdrLayerIDSet::QueryValue( css::uno::Any & rAny ) const { sal_Int16 nNumBytesSet = 0; sal_Int16 nIndex; @@ -229,16 +229,16 @@ void SdrLayerAdmin::NewStandardLayer(sal_uInt16 nPos) sal_uInt16 SdrLayerAdmin::GetLayerPos(SdrLayer* pLayer) const { - sal_uIntPtr nRet=SDRLAYER_NOTFOUND; + sal_uInt16 nRet=SDRLAYERPOS_NOTFOUND; if (pLayer!=nullptr) { std::vector::const_iterator it = std::find(aLayer.begin(), aLayer.end(), pLayer); if (it==aLayer.end()) { - nRet=SDRLAYER_NOTFOUND; + nRet=SDRLAYERPOS_NOTFOUND; } else { nRet=it - aLayer.begin(); } } - return sal_uInt16(nRet); + return nRet; } SdrLayer* SdrLayerAdmin::GetLayer(const OUString& rName) @@ -275,15 +275,12 @@ SdrLayerID SdrLayerAdmin::GetLayerID(const OUString& rName) const return nRet; } -const SdrLayer* SdrLayerAdmin::GetLayerPerID(sal_uInt16 nID) const +const SdrLayer* SdrLayerAdmin::GetLayerPerID(SdrLayerID nID) const { - sal_uInt16 i=0; - const SdrLayer* pLay=nullptr; - while (iGetID()) pLay=GetLayer(i); - else i++; - } - return pLay; + for (SdrLayer* pLayer : aLayer) + if (pLayer->GetID() == nID) + return pLayer; + return nullptr; } // Global LayerIDs begin at 0 and increase, @@ -292,31 +289,31 @@ const SdrLayer* SdrLayerAdmin::GetLayerPerID(sal_uInt16 nID) const SdrLayerID SdrLayerAdmin::GetUniqueLayerID() const { - SetOfByte aSet; - bool bDown = (pParent == nullptr); - sal_uInt16 j; - for (j=0; jGetID()); } - SdrLayerID i; - if (!bDown) + sal_uInt8 i; + if (pParent != nullptr) { - i=254; - while (i && aSet.IsSet(sal_uInt8(i))) + i = 254; + while (i && aSet.IsSet(SdrLayerID(i))) --i; + assert(i != 0); if (i == 0) - i=254; + i = 254; } else { - i=0; - while (i<=254 && aSet.IsSet(sal_uInt8(i))) + i = 0; + while (i<=254 && aSet.IsSet(SdrLayerID(i))) i++; + assert(i <= 254); if (i>254) - i=0; + i = 0; } - return i; + return SdrLayerID(i); } void SdrLayerAdmin::SetControlLayerName(const OUString& rNewName) diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 478b0cbb65b7..d72bfbcf0bc8 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1621,7 +1621,7 @@ void SdrMarkView::SetMarkHdlSizePixel(sal_uInt16 nSiz) } } -SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay) const +SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const { if(((nOptions & SdrSearchOptions::IMPISMASTER) && pObj->IsNotVisibleAsMaster()) || (!pObj->IsVisible())) { @@ -1688,11 +1688,11 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT return pRet; } -SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const +SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj) const { return (*this).CheckSingleSdrObjectHit(rPnt,nTol,pOL,pPV,nOptions,pMVisLay,rpRootObj,nullptr); } -SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const +SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const { SdrObject* pRet=nullptr; rpRootObj=nullptr; @@ -1797,7 +1797,7 @@ SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpP while (pHitObj==nullptr && (bBack ? nPgNum0)) { SdrSearchOptions nTmpOptions=nOptions; if (!bBack) nPgNum--; - const SetOfByte* pMVisLay=nullptr; + const SdrLayerIDSet* pMVisLay=nullptr; SdrObjList* pObjList=nullptr; if (pbHitPassDirect!=nullptr) *pbHitPassDirect = true; if (nPgNum>=nPgAnz-1 || (bExtraPassForWholePage && nPgNum>=nPgAnz-2)) diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 20edcb48e1fe..590262905d05 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -563,14 +563,14 @@ SdrLayerID SdrObject::GetLayer() const return mnLayerID; } -void SdrObject::getMergedHierarchyLayerSet(SetOfByte& rSet) const +void SdrObject::getMergedHierarchySdrLayerIDSet(SdrLayerIDSet& rSet) const { rSet.Set(GetLayer()); SdrObjList* pOL=GetSubList(); if (pOL!=nullptr) { const size_t nObjCount = pOL->GetObjCount(); for (size_t nObjNum = 0; nObjNumGetObj(nObjNum)->getMergedHierarchyLayerSet(rSet); + pOL->GetObj(nObjNum)->getMergedHierarchySdrLayerIDSet(rSet); } } } @@ -1721,8 +1721,7 @@ OString SdrObject::stringify() const append(bInserted). append(false). append(bVirtObj). - //append(maBLIPSizeRectangle). - append(mnLayerID); + append(sal_uInt8(mnLayerID)); aString.append(GetMergedItemSet().stringify()); diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index b6b4d7a7164d..a6d443c456ae 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2095,7 +2095,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO if (pOut==nullptr) pOut=rPV.GetView().GetFirstOutputDevice(); if (pOut==nullptr) return false; SdrObjList* pOL=rPV.GetObjList(); - const SetOfByte& rVisLayer=rPV.GetVisibleLayers(); + const SdrLayerIDSet& rVisLayer=rPV.GetVisibleLayers(); // sensitive area of connectors is twice as large as the one of the handles sal_uInt16 nMarkHdSiz=rPV.GetView().GetMarkHdlSizePixel(); Size aHalfConSiz(nMarkHdSiz,nMarkHdSiz); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 7be3f4e94887..02d6c50f0797 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -152,7 +152,7 @@ SdrLayerID SdrObjGroup::GetLayer() const for (size_t i=0; iGetObj(i)->GetLayer(); if (b1st) { nLay=nLay1; b1st = false; } - else if (nLay1!=nLay) return 0; + else if (nLay1!=nLay) return SdrLayerID(0); } return nLay; } diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 83281d013a74..24e440fab2e0 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1584,13 +1584,13 @@ SdrPage& SdrPage::TRG_GetMasterPage() const return mpMasterPageDescriptor->GetUsedPage(); } -const SetOfByte& SdrPage::TRG_GetMasterPageVisibleLayers() const +const SdrLayerIDSet& SdrPage::TRG_GetMasterPageVisibleLayers() const { DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)"); return mpMasterPageDescriptor->GetVisibleLayers(); } -void SdrPage::TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew) +void SdrPage::TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet& rNew) { DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_SetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)"); mpMasterPageDescriptor->SetVisibleLayers(rNew); diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index b8fd9863cfde..fd94f4388877 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -605,7 +605,7 @@ void SdrPageView::AdjHdl() GetView().AdjustMarkHdl(); } -void SdrPageView::SetLayer(const OUString& rName, SetOfByte& rBS, bool bJa) +void SdrPageView::SetLayer(const OUString& rName, SdrLayerIDSet& rBS, bool bJa) { if(!GetPage()) return; @@ -616,7 +616,7 @@ void SdrPageView::SetLayer(const OUString& rName, SetOfByte& rBS, bool bJa) rBS.Set(nID, bJa); } -bool SdrPageView::IsLayer(const OUString& rName, const SetOfByte& rBS) const +bool SdrPageView::IsLayer(const OUString& rName, const SdrLayerIDSet& rBS) const { if(!GetPage()) return false; @@ -674,9 +674,9 @@ bool SdrPageView::IsObjMarkable(SdrObject* pObj) const return false; // Obj suddenly in different Page // the layer has to be visible and must not be locked SdrLayerID nL = pObj->GetLayer(); - if (!aLayerVisi.IsSet(sal_uInt8(nL))) + if (!aLayerVisi.IsSet(nL)) return false; - if (aLayerLock.IsSet(sal_uInt8(nL))) + if (aLayerLock.IsSet(nL)) return false; return true; } diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx index ef00503274af..903992975f05 100644 --- a/svx/source/svdraw/svdviter.cxx +++ b/svx/source/svdraw/svdviter.cxx @@ -76,8 +76,8 @@ bool SdrViewIter::ImpCheckPageView(SdrPageView* pPV) const { // Looking for an object? First, determine if it visible in // this PageView. - SetOfByte aObjLay; - mpObject->getMergedHierarchyLayerSet(aObjLay); + SdrLayerIDSet aObjLay; + mpObject->getMergedHierarchySdrLayerIDSet(aObjLay); aObjLay &= pPV->GetVisibleLayers(); return !aObjLay.IsEmpty(); } @@ -99,8 +99,8 @@ bool SdrViewIter::ImpCheckPageView(SdrPageView* pPV) const { // Looking for an object? First, determine if it visible in // this PageView. - SetOfByte aObjLay; - mpObject->getMergedHierarchyLayerSet(aObjLay); + SdrLayerIDSet aObjLay; + mpObject->getMergedHierarchySdrLayerIDSet(aObjLay); aObjLay &= pPV->GetVisibleLayers(); aObjLay &= pPg->TRG_GetMasterPageVisibleLayers(); diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 44ab7ac9da0e..0b0904ac70cb 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -110,12 +110,12 @@ void SdrExchangeView::ImpGetPasteObjList(Point& /*rPos*/, SdrObjList*& rpLst) bool SdrExchangeView::ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const { bool bRet=false; - rLayer=0; + rLayer=SdrLayerID(0); if (pObjList!=nullptr) { const SdrPage* pPg=pObjList->GetPage(); if (pPg!=nullptr) { rLayer=pPg->GetLayerAdmin().GetLayerID(maActualLayer); - if (rLayer==SDRLAYER_NOTFOUND) rLayer=0; + if (rLayer==SDRLAYER_NOTFOUND) rLayer=SdrLayerID(0); SdrPageView* pPV = GetSdrPageView(); if (pPV!=nullptr) { bRet=!pPV->GetLockedLayers().IsSet(rLayer) && pPV->GetVisibleLayers().IsSet(rLayer); @@ -336,7 +336,7 @@ bool SdrExchangeView::Paste( if(SDRLAYER_NOTFOUND == nLayer) { - nLayer = 0; + nLayer = SdrLayerID(0); } pNeuObj->SetLayer(nLayer); @@ -672,7 +672,7 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject* ::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ]; ::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ]; const SdrLayerAdmin& rLayerAdmin = mpModel->GetLayerAdmin(); - const sal_uInt32 nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName() ); + const SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName() ); for( size_t n = 0, nCount = GetMarkedObjectCount(); n < nCount; ++n ) { diff --git a/svx/source/uitest/sdrobject.cxx b/svx/source/uitest/sdrobject.cxx index bd31316a498f..7852d6a8bec7 100644 --- a/svx/source/uitest/sdrobject.cxx +++ b/svx/source/uitest/sdrobject.cxx @@ -29,7 +29,7 @@ StringMap SdrUIObject::get_state() aMap["Description"] = pObject->GetDescription(); aMap["Title"] = pObject->GetTitle(); aMap["Z-Order"] = OUString::number(pObject->GetOrdNum()); - aMap["Layer"] = OUString::number(pObject->GetLayer()); + aMap["Layer"] = OUString::number(sal_uInt8(pObject->GetLayer())); aMap["IsGroupObject"] = OUString::boolean(pObject->IsGroupObject()); aMap["IsPolyObject"] = OUString::boolean(pObject->IsPolyObj()); aMap["PointCount"] = OUString::number(pObject->GetPointCount()); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 591a9cadb391..7cc707c7f510 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2299,10 +2299,10 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl sal_Int16 nLayerId = sal_Int16(); if( rValue >>= nLayerId ) { - SdrLayer* pLayer = mpModel->GetLayerAdmin().GetLayerPerID((unsigned char)nLayerId); + SdrLayer* pLayer = mpModel->GetLayerAdmin().GetLayerPerID(SdrLayerID(nLayerId)); if( pLayer ) { - mpObj->SetLayer((unsigned char)nLayerId); + mpObj->SetLayer(SdrLayerID(nLayerId)); return true; } } @@ -2747,7 +2747,7 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertySimpl break; } case SDRATTR_LAYERID: - rValue <<= (sal_Int16)mpObj->GetLayer(); + rValue <<= sal_uInt16(sal_uInt8(mpObj->GetLayer())); break; case SDRATTR_LAYERNAME: diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 295b0bb95961..cb7d75a1b827 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -278,7 +278,7 @@ public: void SelectionToTop ( bool bTop = true ); void SelectionToBottom( bool bBottom = true ); - short GetLayerId() const; ///< 1 Heaven, 0 Hell, -1 Ambiguous. + SdrLayerID GetLayerId() const; ///< 1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous. void SelectionToHeaven(); ///< Above document. void SelectionToHell(); ///< Below document. diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 94192f51b299..d1ba6086d476 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -186,7 +186,7 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt return pRetval; } -SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay) const +SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const { // call parent SdrObject* pRetval = FmFormView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 06963f3b1b50..edf4cb9dff26 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1062,29 +1062,26 @@ void SwFEShell::SelectionToBottom( bool bBottom ) } // Object above/below the document? 2 Controls, 1 Heaven, 0 Hell, -// -1 Ambiguous -short SwFEShell::GetLayerId() const +// SDRLAYER_NOTFOUND Ambiguous +SdrLayerID SwFEShell::GetLayerId() const { - short nRet = SHRT_MAX; - if ( Imp()->HasDrawView() ) + if ( !Imp()->HasDrawView() ) + return SDRLAYER_NOTFOUND; + + SdrLayerID nRet = SDRLAYER_NOTFOUND; + const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { - const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) + const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); + if( !pObj ) + continue; + if ( nRet == SDRLAYER_NOTFOUND ) + nRet = pObj->GetLayer(); + else if ( nRet != pObj->GetLayer() ) { - const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); - if( !pObj ) - continue; - if ( nRet == SHRT_MAX ) - nRet = pObj->GetLayer(); - else if ( nRet != pObj->GetLayer() ) - { - nRet = -1; - break; - } + return SDRLAYER_NOTFOUND; } } - if ( nRet == SHRT_MAX ) - nRet = -1; return nRet; } diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx index 09b9d89912a9..9af50eb0efdb 100644 --- a/sw/source/core/inc/UndoInsert.hxx +++ b/sw/source/core/inc/UndoInsert.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -175,7 +176,7 @@ class SwUndoInsertLabel : public SwUndo // #i26791# - re-store of drawing object position no longer needed sal_uInt16 nFieldId; SwLabelType eType; - sal_uInt8 nLayerId; // for character objects + SdrLayerID nLayerId; // for character objects bool bBefore :1; bool bUndoKeep :1; bool bCpyBrd :1; @@ -215,7 +216,7 @@ public: void SetUndoKeep() { bUndoKeep = true; } void SetFlys( SwFrameFormat& rOldFly, SfxItemSet& rChgSet, SwFrameFormat& rNewFly ); - void SetDrawObj( sal_uInt8 nLayerId ); + void SetDrawObj( SdrLayerID nLayerId ); }; #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOINSERT_HXX diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx index d5c2bf6bdd23..064cc544420e 100644 --- a/sw/source/core/inc/dview.hxx +++ b/sw/source/core/inc/dview.hxx @@ -73,7 +73,7 @@ protected: // override to allow extra handling when picking SwVirtFlyDrawObj's using FmFormView::CheckSingleSdrObjectHit; - virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay) const override; + virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const override; // support enhanced text edit for draw objects virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const override; diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index ab0ded01fb32..df8f3a6f84fe 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -802,7 +802,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, if ( pSh ) pSh->InvalidateWindows( Frame() ); const IDocumentDrawModelAccess& rIDDMA = GetFormat()->getIDocumentDrawModelAccess(); - const sal_uInt8 nId = GetFormat()->GetOpaque().GetValue() ? + const SdrLayerID nId = GetFormat()->GetOpaque().GetValue() ? rIDDMA.GetHeavenId() : rIDDMA.GetHellId(); GetVirtDrawObj()->SetLayer( nId ); @@ -883,7 +883,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, pSh->InvalidateWindows( Frame() ); const IDocumentDrawModelAccess& rIDDMA = GetFormat()->getIDocumentDrawModelAccess(); - const sal_uInt8 nId = static_cast(pNew)->GetValue() ? + const SdrLayerID nId = static_cast(pNew)->GetValue() ? rIDDMA.GetHeavenId() : rIDDMA.GetHellId(); GetVirtDrawObj()->SetLayer( nId ); diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index f28603b071ad..7d3beb76f5c3 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -491,7 +491,7 @@ bool SwTextFly::DrawTextOpaque( SwDrawTextInfo &rInf ) SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 ); if ( bOn && nCount > 0 ) { - const sal_uInt16 nHellId = pPage->getRootFrame()->GetCurrShell()->getIDocumentDrawModelAccess().GetHellId(); + const SdrLayerID nHellId = pPage->getRootFrame()->GetCurrShell()->getIDocumentDrawModelAccess().GetHellId(); for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i ) { // #i68520# @@ -578,7 +578,7 @@ void SwTextFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect ) SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 ); if ( bOn && nCount > 0 ) { - const sal_uInt16 nHellId = pPage->getRootFrame()->GetCurrShell()->getIDocumentDrawModelAccess().GetHellId(); + const SdrLayerID nHellId = pPage->getRootFrame()->GetCurrShell()->getIDocumentDrawModelAccess().GetHellId(); for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i ) { // #i68520# diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index b0b7a41b6f0f..78528a4a7f31 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -1057,7 +1057,7 @@ void SwUndoInsertLabel::SetFlys( SwFrameFormat& rOldFly, SfxItemSet& rChgSet, } } -void SwUndoInsertLabel::SetDrawObj( sal_uInt8 nLId ) +void SwUndoInsertLabel::SetDrawObj( SdrLayerID nLId ) { if( LTYPE_DRAW == eType ) { diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index cb3d5b326445..6ef892f8f5c4 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1046,6 +1046,9 @@ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo() void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) { + if (rPropertyName == "LayerID") { + SAL_WARN("sw.uno", "noel"); + } SolarMutexGuard aGuard; SwFrameFormat* pFormat = GetFrameFormat(); const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName ); @@ -1445,6 +1448,9 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) { + if (rPropertyName == "LayerID") { + SAL_WARN("sw.uno", "noel"); + } SolarMutexGuard aGuard; uno::Any aRet; SwFrameFormat* pFormat = GetFrameFormat(); diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index 09b0b0459983..e97a9e5d025b 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -29,6 +29,7 @@ #include "types.hxx" #include #include +#include #include #include #include @@ -628,7 +629,7 @@ namespace sw class SetLayer { private: - sal_uInt8 mnHeavenLayer, mnHellLayer, mnFormLayer; + SdrLayerID mnHeavenLayer, mnHellLayer, mnFormLayer; enum Layer {eHeaven, eHell}; void SetObjectLayer(SdrObject &rObject, Layer eLayer) const; void Swap(SetLayer &rOther) throw(); diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index fc0580ea85bd..6f2ee322b88e 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -254,7 +254,7 @@ void SwDrawShell::Execute(SfxRequest &rReq) if (rSh.IsObjSelected()) { rSh.StartUndo( SwUndoId::START ); - if (rSh.GetLayerId() == 0) + if (rSh.GetLayerId() == SdrLayerID(0)) { SetWrapMode(FN_FRAME_WRAPTHRU); rSh.SelectionToHeaven(); @@ -407,12 +407,12 @@ void SwDrawShell::GetState(SfxItemSet& rSet) switch( nWhich ) { case SID_OBJECT_HELL: - if ( !rSh.IsObjSelected() || rSh.GetLayerId() == 0 || bProtected ) + if ( !rSh.IsObjSelected() || rSh.GetLayerId() == SdrLayerID(0) || bProtected ) rSet.DisableItem( nWhich ); break; case SID_OBJECT_HEAVEN: - if ( !rSh.IsObjSelected() || rSh.GetLayerId() == 1 || bProtected ) + if ( !rSh.IsObjSelected() || rSh.GetLayerId() == SdrLayerID(1) || bProtected ) rSet.DisableItem( nWhich ); break; diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index ee7412daf952..ec081a2919d1 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -134,7 +134,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) aSet.Put(SfxBoolItem(SID_HTML_MODE, 0 != ::GetHtmlMode(pSh->GetView().GetDocShell()))); - aSet.Put(SfxInt16Item(FN_DRAW_WRAP_DLG, pSh->GetLayerId())); + aSet.Put(SfxInt16Item(FN_DRAW_WRAP_DLG, sal_uInt8(pSh->GetLayerId()))); pSh->GetObjAttr(aSet); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); -- cgit