From 09d4525b11f396a68ca7c5cbb1ae3462db40c77c Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 24 Mar 2013 14:08:14 +0100 Subject: fdo#62617 display groups on multiple layers correctly It is possible to group objects from different layers, so it is an error to rely on layer ID when checking visibility of a group. This problem was partially obscured by the fact that SdrObjGroup::GetLayer() returns 0 if its subobjects are on different layers and 0 is a valid layer ID. Change-Id: I0ef75544a26817154642185864cafd4e6734fa38 --- svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx | 3 +++ svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx | 9 +++++++++ 2 files changed, 12 insertions(+) (limited to 'svx/inc') diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx index b925889eb9c9..fda5610e0568 100644 --- a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx @@ -40,6 +40,9 @@ namespace sdr // This method recursively paints the draw hierarchy. virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + + private: + virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const; }; } // end of namespace contact } // end of namespace sdr diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx index d7609bdcbb39..e0384426add3 100644 --- a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx @@ -25,6 +25,7 @@ ////////////////////////////////////////////////////////////////////////////// // predeclarations class SdrObject; +class SetOfByte; ////////////////////////////////////////////////////////////////////////////// @@ -34,6 +35,14 @@ namespace sdr { class SVX_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact { + /** Test whether the primitive is visible on any layer from @c aLayers + + This should be overriden by ViewObjectContacts of SDR classes + that have subparts which can be on different layers (that is, + SdrObjGroup .-) + */ + virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const; + protected: const SdrObject& getSdrObject() const; -- cgit