[Libreoffice-commits] core.git: include/svx svx/source
Kohei Yoshida
kohei.yoshida at collabora.com
Tue Nov 4 10:44:21 PST 2014
include/svx/sdr/contact/objectcontact.hxx | 249 +++++------
include/svx/sdr/contact/viewcontactofsdrobj.hxx | 89 +---
include/svx/sdr/contact/viewobjectcontact.hxx | 199 ++++-----
svx/source/sdr/contact/objectcontact.cxx | 521 +++++++++++-------------
svx/source/sdr/contact/viewcontactofsdrobj.cxx | 259 +++++------
5 files changed, 641 insertions(+), 676 deletions(-)
New commits:
commit 1bb27282558f23ee6f94bb046f5905a65c94ba3d
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Tue Nov 4 13:10:55 2014 -0500
Unindent.
Change-Id: I40f97fb81993ea59e23430d4680981c6b2ed35ad
diff --git a/include/svx/sdr/contact/objectcontact.hxx b/include/svx/sdr/contact/objectcontact.hxx
index 89c3bb2..f10cb4a 100644
--- a/include/svx/sdr/contact/objectcontact.hxx
+++ b/include/svx/sdr/contact/objectcontact.hxx
@@ -24,20 +24,11 @@
#include <svx/svxdllapi.h>
#include <drawinglayer/geometry/viewinformation2d.hxx>
-
-// predeclarations
-
class SetOfByte;
class Rectangle;
class SdrPageView;
class OutputDevice;
-namespace sdr { namespace contact {
- class DisplayInfo;
- class ViewContact;
- class ViewObjectContactRedirector;
-}}
-
namespace sdr { namespace event {
class TimerEventHandler;
}}
@@ -47,172 +38,172 @@ namespace basegfx {
class B2DHomMatrix;
}
+namespace sdr { namespace contact {
+class DisplayInfo;
+class ViewContact;
+class ViewObjectContactRedirector;
-namespace sdr
+class SVX_DLLPUBLIC ObjectContact
{
- namespace contact
- {
- class SVX_DLLPUBLIC ObjectContact
- {
- private:
- // make ViewObjectContact a friend to exclusively allow it to use
- // AddViewObjectContact/RemoveViewObjectContact
- friend class ViewObjectContact;
+private:
+ // make ViewObjectContact a friend to exclusively allow it to use
+ // AddViewObjectContact/RemoveViewObjectContact
+ friend class ViewObjectContact;
- // All VOCs which are created using this OC, thus remembering this OC
- // as a reference. All those VOCs need to be deleted when the OC goes down.
- // Registering and de-registering is done in the VOC constructors/destructors.
- std::vector< ViewObjectContact* > maViewObjectContactVector;
+ // All VOCs which are created using this OC, thus remembering this OC
+ // as a reference. All those VOCs need to be deleted when the OC goes down.
+ // Registering and de-registering is done in the VOC constructors/destructors.
+ std::vector< ViewObjectContact* > maViewObjectContactVector;
- // A new ViewObjectContact was created and shall be remembered.
- void AddViewObjectContact(ViewObjectContact& rVOContact);
+ // A new ViewObjectContact was created and shall be remembered.
+ void AddViewObjectContact(ViewObjectContact& rVOContact);
- // A ViewObjectContact was deleted and shall be forgotten.
- virtual void RemoveViewObjectContact(ViewObjectContact& rVOContact);
+ // A ViewObjectContact was deleted and shall be forgotten.
+ virtual void RemoveViewObjectContact(ViewObjectContact& rVOContact);
- // the primitiveAnimator which is used if this View and/or the contained primitives
- // support animatedSwitchPrimitives
- sdr::animation::primitiveAnimator maPrimitiveAnimator;
+ // the primitiveAnimator which is used if this View and/or the contained primitives
+ // support animatedSwitchPrimitives
+ sdr::animation::primitiveAnimator maPrimitiveAnimator;
- // the EventHandler for e.g. asynchronious loading of graphics
- sdr::event::TimerEventHandler* mpEventHandler;
+ // the EventHandler for e.g. asynchronious loading of graphics
+ sdr::event::TimerEventHandler* mpEventHandler;
- // The redirector. If set it is used to pipe all supported calls
- // to the redirector
- ViewObjectContactRedirector* mpViewObjectContactRedirector;
+ // The redirector. If set it is used to pipe all supported calls
+ // to the redirector
+ ViewObjectContactRedirector* mpViewObjectContactRedirector;
- // the Primitive2DParameters containing view information
- drawinglayer::geometry::ViewInformation2D maViewInformation2D;
+ // the Primitive2DParameters containing view information
+ drawinglayer::geometry::ViewInformation2D maViewInformation2D;
- // bitfield
- // flag for preview renderer
- bool mbIsPreviewRenderer : 1;
+ // bitfield
+ // flag for preview renderer
+ bool mbIsPreviewRenderer : 1;
- // method to create a EventHandler. Needs to give a result.
- sdr::event::TimerEventHandler* CreateEventHandler();
+ // method to create a EventHandler. Needs to give a result.
+ sdr::event::TimerEventHandler* CreateEventHandler();
- protected:
- // Interface to allow derivates to travel over the registered VOC's
- sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); }
- ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; }
+protected:
+ // Interface to allow derivates to travel over the registered VOC's
+ sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); }
+ ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; }
- // interface to allow derivates to set PreviewRenderer flag
- void setPreviewRenderer(bool bNew) { mbIsPreviewRenderer = bNew; }
+ // interface to allow derivates to set PreviewRenderer flag
+ void setPreviewRenderer(bool bNew) { mbIsPreviewRenderer = bNew; }
- // interface to allow derivates to set ViewInformation2D
- void updateViewInformation2D(const drawinglayer::geometry::ViewInformation2D& rViewInformation2D) { maViewInformation2D = rViewInformation2D; }
+ // interface to allow derivates to set ViewInformation2D
+ void updateViewInformation2D(const drawinglayer::geometry::ViewInformation2D& rViewInformation2D) { maViewInformation2D = rViewInformation2D; }
- public:
- // basic constructor
- ObjectContact();
- virtual ~ObjectContact();
+public:
+ // basic constructor
+ ObjectContact();
+ virtual ~ObjectContact();
- // LazyInvalidate request. This is used from the VOCs to mark that they
- // got invalidated by an ActionCanged() call. An active view needs to remember
- // this and take action on it. Default implementation directly calls back
- // triggerLazyInvalidate() which promptly handles the request
- virtual void setLazyInvalidate(ViewObjectContact& rVOC);
+ // LazyInvalidate request. This is used from the VOCs to mark that they
+ // got invalidated by an ActionCanged() call. An active view needs to remember
+ // this and take action on it. Default implementation directly calls back
+ // triggerLazyInvalidate() which promptly handles the request
+ virtual void setLazyInvalidate(ViewObjectContact& rVOC);
- // call this to support evtl. preparations for repaint. Default does nothing
- virtual void PrepareProcessDisplay();
+ // call this to support evtl. preparations for repaint. Default does nothing
+ virtual void PrepareProcessDisplay();
- // Process the whole displaying
- virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
+ // Process the whole displaying
+ virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
- // test if visualizing of entered groups is switched on at all. Default
- // implementation returns sal_False.
- virtual bool DoVisualizeEnteredGroup() const;
+ // test if visualizing of entered groups is switched on at all. Default
+ // implementation returns sal_False.
+ virtual bool DoVisualizeEnteredGroup() const;
- // get active group's (the entered group) ViewContact
- virtual const ViewContact* getActiveViewContact() const;
+ // get active group's (the entered group) ViewContact
+ virtual const ViewContact* getActiveViewContact() const;
- // Invalidate given rectangle at the window/output which is represented by
- // this ObjectContact. Default does nothing.
- virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const;
+ // Invalidate given rectangle at the window/output which is represented by
+ // this ObjectContact. Default does nothing.
+ virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const;
- // Get info if given Rectangle is visible in this view
- virtual bool IsAreaVisible(const basegfx::B2DRange& rRange) const;
+ // Get info if given Rectangle is visible in this view
+ virtual bool IsAreaVisible(const basegfx::B2DRange& rRange) const;
- // Get info about the need to visualize GluePoints. The default
- // is that it is not necessary.
- virtual bool AreGluePointsVisible() const;
+ // Get info about the need to visualize GluePoints. The default
+ // is that it is not necessary.
+ virtual bool AreGluePointsVisible() const;
- // method to get the primitiveAnimator
- sdr::animation::primitiveAnimator& getPrimitiveAnimator() { return maPrimitiveAnimator; }
+ // method to get the primitiveAnimator
+ sdr::animation::primitiveAnimator& getPrimitiveAnimator() { return maPrimitiveAnimator; }
- // method to get the EventHandler. It will
- // return a existing one or create a new one using CreateEventHandler().
- sdr::event::TimerEventHandler& GetEventHandler() const;
+ // method to get the EventHandler. It will
+ // return a existing one or create a new one using CreateEventHandler().
+ sdr::event::TimerEventHandler& GetEventHandler() const;
- // delete the EventHandler
- void DeleteEventHandler();
+ // delete the EventHandler
+ void DeleteEventHandler();
- // test if there is an EventHandler without creating one on demand
- bool HasEventHandler() const;
+ // test if there is an EventHandler without creating one on demand
+ bool HasEventHandler() const;
- // check if text animation is allowed. Default is sal_true.
- virtual bool IsTextAnimationAllowed() const;
+ // check if text animation is allowed. Default is sal_true.
+ virtual bool IsTextAnimationAllowed() const;
- // check if graphic animation is allowed. Default is sal_true.
- virtual bool IsGraphicAnimationAllowed() const;
+ // check if graphic animation is allowed. Default is sal_true.
+ virtual bool IsGraphicAnimationAllowed() const;
- // check if asynchronious graphis loading is allowed. Default is sal_False.
- virtual bool IsAsynchronGraphicsLoadingAllowed() const;
+ // check if asynchronious graphis loading is allowed. Default is sal_False.
+ virtual bool IsAsynchronGraphicsLoadingAllowed() const;
- // access to ViewObjectContactRedirector
- ViewObjectContactRedirector* GetViewObjectContactRedirector() const { return mpViewObjectContactRedirector; }
- void SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew);
+ // access to ViewObjectContactRedirector
+ ViewObjectContactRedirector* GetViewObjectContactRedirector() const { return mpViewObjectContactRedirector; }
+ void SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew);
- // check if buffering of MasterPages is allowed. Default is sal_False.
- virtual bool IsMasterPageBufferingAllowed() const;
+ // check if buffering of MasterPages is allowed. Default is sal_False.
+ virtual bool IsMasterPageBufferingAllowed() const;
- // print? Default is false
- virtual bool isOutputToPrinter() const;
+ // print? Default is false
+ virtual bool isOutputToPrinter() const;
- // window? Default is true
- virtual bool isOutputToWindow() const;
+ // window? Default is true
+ virtual bool isOutputToWindow() const;
- // VirtualDevice? Default is false
- virtual bool isOutputToVirtualDevice() const;
+ // VirtualDevice? Default is false
+ virtual bool isOutputToVirtualDevice() const;
- // recording MetaFile? Default is false
- virtual bool isOutputToRecordingMetaFile() const;
+ // recording MetaFile? Default is false
+ virtual bool isOutputToRecordingMetaFile() const;
- // pdf export? Default is false
- virtual bool isOutputToPDFFile() const;
+ // pdf export? Default is false
+ virtual bool isOutputToPDFFile() const;
- // gray display mode
- virtual bool isDrawModeGray() const;
+ // gray display mode
+ virtual bool isDrawModeGray() const;
- // gray display mode
- virtual bool isDrawModeBlackWhite() const;
+ // gray display mode
+ virtual bool isDrawModeBlackWhite() const;
- // high contrast display mode
- virtual bool isDrawModeHighContrast() const;
+ // high contrast display mode
+ virtual bool isDrawModeHighContrast() const;
- // check if this is a preview renderer. Default is sal_False.
- bool IsPreviewRenderer() const { return mbIsPreviewRenderer; }
+ // check if this is a preview renderer. Default is sal_False.
+ bool IsPreviewRenderer() const { return mbIsPreviewRenderer; }
- // get Primitive2DParameters for this view
- const drawinglayer::geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; }
+ // get Primitive2DParameters for this view
+ const drawinglayer::geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; }
- // access to SdrPageView. May return 0L like the default implementations do. Needs to be overloaded as needed.
- virtual SdrPageView* TryToGetSdrPageView() const;
+ // access to SdrPageView. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual SdrPageView* TryToGetSdrPageView() const;
- // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
- virtual OutputDevice* TryToGetOutputDevice() const;
+ // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual OutputDevice* TryToGetOutputDevice() const;
- // reset ViewPort at internal ViewInformation2D. This is needed when the OC is used
- // not for ProcessDisplay() but to get a VOC associated with it. When trying to get
- // a sequence of primitives from the VOC then, the last initialized ViewPort from
- // the last ProcessDisplay() is used for geometric visibility testing. If this is not
- // wanted (like in such cases) this method is used. It will reuse the current
- // ViewInformation2D, but clear the ViewPort (no ViewPort means all is visible)
- void resetViewPort();
- };
- } // end of namespace contact
-} // end of namespace sdr
+ // reset ViewPort at internal ViewInformation2D. This is needed when the OC is used
+ // not for ProcessDisplay() but to get a VOC associated with it. When trying to get
+ // a sequence of primitives from the VOC then, the last initialized ViewPort from
+ // the last ProcessDisplay() is used for geometric visibility testing. If this is not
+ // wanted (like in such cases) this method is used. It will reuse the current
+ // ViewInformation2D, but clear the ViewPort (no ViewPort means all is visible)
+ void resetViewPort();
+};
+
+}}
diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx b/include/svx/sdr/contact/viewcontactofsdrobj.hxx
index bbf2c99..e35cf85 100644
--- a/include/svx/sdr/contact/viewcontactofsdrobj.hxx
+++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx
@@ -25,71 +25,62 @@
#include <svx/sdtakitm.hxx>
#include <svx/svxdllapi.h>
-
-// predeclarations
-
class SdrObject;
class GeoStat;
class Bitmap;
+namespace sdr { namespace contact {
-
-namespace sdr
+class SVX_DLLPUBLIC ViewContactOfSdrObj : public ViewContact
{
- namespace contact
+protected:
+ // the owner of this ViewContact. Set from constructor and not
+ // to be changed in any way.
+ SdrObject& mrObject;
+
+ // Remember AnimationKind of object. Used to find out if that kind
+ // has changed in ActionChanged()
+ SdrTextAniKind meRememberedAnimationKind;
+
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
+
+public:
+ // access to SdrObject
+ SdrObject& GetSdrObject() const
{
- class SVX_DLLPUBLIC ViewContactOfSdrObj : public ViewContact
- {
- protected:
- // the owner of this ViewContact. Set from constructor and not
- // to be changed in any way.
- SdrObject& mrObject;
-
- // Remember AnimationKind of object. Used to find out if that kind
- // has changed in ActionChanged()
- SdrTextAniKind meRememberedAnimationKind;
-
- // Create a Object-Specific ViewObjectContact, set ViewContact and
- // ObjectContact. Always needs to return something.
- virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
-
- public:
- // access to SdrObject
- SdrObject& GetSdrObject() const
- {
- return mrObject;
- }
-
- // basic constructor, used from SdrObject.
- explicit ViewContactOfSdrObj(SdrObject& rObj);
- virtual ~ViewContactOfSdrObj();
+ return mrObject;
+ }
- // Access to possible sub-hierarchy
- virtual sal_uInt32 GetObjectCount() const SAL_OVERRIDE;
- virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const SAL_OVERRIDE;
- virtual ViewContact* GetParentContact() const SAL_OVERRIDE;
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrObj(SdrObject& rObj);
+ virtual ~ViewContactOfSdrObj();
- // React on changes of the object of this ViewContact
- virtual void ActionChanged() SAL_OVERRIDE;
+ // Access to possible sub-hierarchy
+ virtual sal_uInt32 GetObjectCount() const SAL_OVERRIDE;
+ virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const SAL_OVERRIDE;
+ virtual ViewContact* GetParentContact() const SAL_OVERRIDE;
- // overload for acessing the SdrObject
- virtual SdrObject* TryToGetSdrObject() const SAL_OVERRIDE;
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged() SAL_OVERRIDE;
+ // overload for acessing the SdrObject
+ virtual SdrObject* TryToGetSdrObject() const SAL_OVERRIDE;
- // primitive stuff
- // add Gluepoints (if available)
- virtual drawinglayer::primitive2d::Primitive2DSequence createGluePointPrimitive2DSequence() const SAL_OVERRIDE;
+ // primitive stuff
- // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This
- // is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception
- // for 3D scenes
- virtual drawinglayer::primitive2d::Primitive2DSequence embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) const SAL_OVERRIDE;
- };
- } // end of namespace contact
-} // end of namespace sdr
+ // add Gluepoints (if available)
+ virtual drawinglayer::primitive2d::Primitive2DSequence createGluePointPrimitive2DSequence() const SAL_OVERRIDE;
+ // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This
+ // is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception
+ // for 3D scenes
+ virtual drawinglayer::primitive2d::Primitive2DSequence embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) const SAL_OVERRIDE;
+};
+}}
#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX
diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx b/include/svx/sdr/contact/viewobjectcontact.hxx
index 4e47270..e371c9c 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -26,119 +26,110 @@
#include <svx/svxdllapi.h>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-
-// predeclarations
-
namespace vcl { class Region; }
-namespace sdr { namespace contact {
- class DisplayInfo;
- class ObjectContact;
- class ViewContact;
- class ViewObjectContactRedirector;
-}}
-
namespace sdr { namespace animation {
class PrimitiveAnimation;
}}
+namespace sdr { namespace contact {
+class DisplayInfo;
+class ObjectContact;
+class ViewContact;
+class ViewObjectContactRedirector;
-namespace sdr
+class SVX_DLLPUBLIC ViewObjectContact
{
- namespace contact
- {
- class SVX_DLLPUBLIC ViewObjectContact
- {
- private:
- // must-exist and constant contacts
- ObjectContact& mrObjectContact;
- ViewContact& mrViewContact;
-
- // This range defines the object's BoundRect
- basegfx::B2DRange maObjectRange;
-
- // PrimitiveSequence of the ViewContact. This contains all necessary information
- // for the graphical visualisation and needs to be supported by all VCs which
- // can be visualized.
- drawinglayer::primitive2d::Primitive2DSequence mxPrimitive2DSequence;
-
- // the PrimitiveAnimation if Primitive2DSequence contains animations
- sdr::animation::PrimitiveAnimation* mpPrimitiveAnimation;
-
- // bitfield
- // This bool gets set when the object gets invalidated by ActionChanged() and
- // can be used from the OC to late-invalidates
- bool mbLazyInvalidate : 1;
-
- protected:
- // make redirector a protected friend, it needs to call createPrimitives as default action
- friend class ViewObjectContactRedirector;
-
- // Called from getPrimitive2DSequence() when vector has changed. Evaluate object animation
- // and setup accordingly
- void checkForPrimitive2DAnimations();
-
- // This method is responsible for creating the graphical visualisation data which is
- // stored/cached in the local primitive. Default gets view-independent Primitive
- // from the ViewContact using ViewContact::getViewIndependentPrimitive2DSequence(), takes care of
- // visibility, handles glue and ghosted.
- // This method will not handle included hierarchies and not check geometric visibility.
- virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
-
- // method for flushing Primitive2DSequence for VOC implementations
- void flushPrimitive2DSequence() { mxPrimitive2DSequence.realloc(0); }
-
- public:
- // basic constructor.
- ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact);
- virtual ~ViewObjectContact();
-
- // access to ObjectContact
- ObjectContact& GetObjectContact() const { return mrObjectContact; }
-
- // access to ViewContact
- ViewContact& GetViewContact() const { return mrViewContact; }
-
- // get the oebject's size range
- const basegfx::B2DRange& getObjectRange() const;
-
- // A ViewObjectContact was deleted and shall be forgotten.
- void RemoveViewObjectContact(ViewObjectContact& rVOContact);
-
- // React on changes of the object of this ViewContact
- virtual void ActionChanged();
-
- // LazyInvalidate handling
- void triggerLazyInvalidate();
-
- // Check if this primitive is animated in any OC (View) which means it has
- // generated a PrimitiveAnimation
- bool isAnimated() const { return (0 != mpPrimitiveAnimation); }
-
- // Take some action when new objects are inserted
- virtual void ActionChildInserted(ViewContact& rChild);
-
- // access to the local primitive. This will ensure that the local primitive is
- // current in comparing the local one with a fresh created incarnation
- // This method will not handle included hierarchies and not check visibility.
- drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
-
- // test this VOC for visibility concerning model-view stuff like e.g. Layer
- virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
-
- // test this VOC for ghosted mode
- virtual bool isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const;
-
- // process this primitive: Eventually also recursively travel an existing hierarchy,
- // e.g. for group objects, scenes or pages. This method will test geometrical visibility.
- virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
-
- // just process the sub-hierarchy, used as tooling from getPrimitive2DSequenceHierarchy
- drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const;
- };
- } // end of namespace contact
-} // end of namespace sdr
+private:
+ // must-exist and constant contacts
+ ObjectContact& mrObjectContact;
+ ViewContact& mrViewContact;
+
+ // This range defines the object's BoundRect
+ basegfx::B2DRange maObjectRange;
+
+ // PrimitiveSequence of the ViewContact. This contains all necessary information
+ // for the graphical visualisation and needs to be supported by all VCs which
+ // can be visualized.
+ drawinglayer::primitive2d::Primitive2DSequence mxPrimitive2DSequence;
+
+ // the PrimitiveAnimation if Primitive2DSequence contains animations
+ sdr::animation::PrimitiveAnimation* mpPrimitiveAnimation;
+
+ // bitfield
+ // This bool gets set when the object gets invalidated by ActionChanged() and
+ // can be used from the OC to late-invalidates
+ bool mbLazyInvalidate : 1;
+
+protected:
+ // make redirector a protected friend, it needs to call createPrimitives as default action
+ friend class ViewObjectContactRedirector;
+
+ // Called from getPrimitive2DSequence() when vector has changed. Evaluate object animation
+ // and setup accordingly
+ void checkForPrimitive2DAnimations();
+
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored/cached in the local primitive. Default gets view-independent Primitive
+ // from the ViewContact using ViewContact::getViewIndependentPrimitive2DSequence(), takes care of
+ // visibility, handles glue and ghosted.
+ // This method will not handle included hierarchies and not check geometric visibility.
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ // method for flushing Primitive2DSequence for VOC implementations
+ void flushPrimitive2DSequence() { mxPrimitive2DSequence.realloc(0); }
+
+public:
+ // basic constructor.
+ ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContact();
+
+ // access to ObjectContact
+ ObjectContact& GetObjectContact() const { return mrObjectContact; }
+
+ // access to ViewContact
+ ViewContact& GetViewContact() const { return mrViewContact; }
+
+ // get the oebject's size range
+ const basegfx::B2DRange& getObjectRange() const;
+
+ // A ViewObjectContact was deleted and shall be forgotten.
+ void RemoveViewObjectContact(ViewObjectContact& rVOContact);
+
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
+ // LazyInvalidate handling
+ void triggerLazyInvalidate();
+
+ // Check if this primitive is animated in any OC (View) which means it has
+ // generated a PrimitiveAnimation
+ bool isAnimated() const { return (0 != mpPrimitiveAnimation); }
+
+ // Take some action when new objects are inserted
+ virtual void ActionChildInserted(ViewContact& rChild);
+
+ // access to the local primitive. This will ensure that the local primitive is
+ // current in comparing the local one with a fresh created incarnation
+ // This method will not handle included hierarchies and not check visibility.
+ drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ // test this VOC for visibility concerning model-view stuff like e.g. Layer
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+
+ // test this VOC for ghosted mode
+ virtual bool isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const;
+
+ // process this primitive: Eventually also recursively travel an existing hierarchy,
+ // e.g. for group objects, scenes or pages. This method will test geometrical visibility.
+ virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+
+ // just process the sub-hierarchy, used as tooling from getPrimitive2DSequenceHierarchy
+ drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const;
+};
+
+}}
diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx
index 67241aa..77ed1cc8 100644
--- a/svx/source/sdr/contact/objectcontact.cxx
+++ b/svx/source/sdr/contact/objectcontact.cxx
@@ -29,269 +29,266 @@
using namespace com::sun::star;
-namespace sdr
+namespace sdr { namespace contact {
+
+ObjectContact::ObjectContact()
+: maViewObjectContactVector(),
+ maPrimitiveAnimator(),
+ mpEventHandler(0),
+ mpViewObjectContactRedirector(0),
+ maViewInformation2D(uno::Sequence< beans::PropertyValue >()),
+ mbIsPreviewRenderer(false)
{
- namespace contact
+}
+
+ObjectContact::~ObjectContact()
+{
+ // get rid of all registered contacts
+ // #i84257# To avoid that each 'delete pCandidate' again uses
+ // the local RemoveViewObjectContact with a search and removal in the
+ // vector, simply copy and clear local vector.
+ std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector);
+ maViewObjectContactVector.clear();
+
+ while(!aLocalVOCList.empty())
+ {
+ ViewObjectContact* pCandidate = aLocalVOCList.back();
+ aLocalVOCList.pop_back();
+ DBG_ASSERT(pCandidate, "Corrupted ViewObjectContactList (!)");
+
+ // ViewObjectContacts only make sense with View and Object contacts.
+ // When the contact to the SdrObject is deleted like in this case,
+ // all ViewObjectContacts can be deleted, too.
+ delete pCandidate;
+ }
+
+ // assert when there were new entries added during deletion
+ DBG_ASSERT(maViewObjectContactVector.empty(), "Corrupted ViewObjectContactList (!)");
+
+ // delete the EventHandler. This will destroy all still contained events.
+ DeleteEventHandler();
+}
+
+// LazyInvalidate request. Default implementation directly handles
+// this by calling back triggerLazyInvalidate() at the VOC
+void ObjectContact::setLazyInvalidate(ViewObjectContact& rVOC)
+{
+ rVOC.triggerLazyInvalidate();
+}
+
+// call this to support evtl. preparations for repaint. Default does nothing
+void ObjectContact::PrepareProcessDisplay()
+{
+}
+
+// A new ViewObjectContact was created and shall be remembered.
+void ObjectContact::AddViewObjectContact(ViewObjectContact& rVOContact)
+{
+ maViewObjectContactVector.push_back(&rVOContact);
+}
+
+// A ViewObjectContact was deleted and shall be forgotten.
+void ObjectContact::RemoveViewObjectContact(ViewObjectContact& rVOContact)
+{
+ std::vector< ViewObjectContact* >::iterator aFindResult = std::find(maViewObjectContactVector.begin(), maViewObjectContactVector.end(), &rVOContact);
+
+ if(aFindResult != maViewObjectContactVector.end())
+ {
+ maViewObjectContactVector.erase(aFindResult);
+ }
+}
+
+// Process the whole displaying
+void ObjectContact::ProcessDisplay(DisplayInfo& /*rDisplayInfo*/)
+{
+ // default does nothing
+}
+
+// test if visualizing of entered groups is switched on at all
+bool ObjectContact::DoVisualizeEnteredGroup() const
+{
+ // Don not do that as default
+ return false;
+}
+
+// get active group's (the entered group) ViewContact
+const ViewContact* ObjectContact::getActiveViewContact() const
+{
+ // default has no active VC
+ return 0;
+}
+
+// Invalidate given rectangle at the window/output which is represented by
+// this ObjectContact.
+void ObjectContact::InvalidatePartOfView(const basegfx::B2DRange& /*rRange*/) const
+{
+ // nothing to do here in the default version
+}
+
+// Get info if given Rectangle is visible in this view
+bool ObjectContact::IsAreaVisible(const basegfx::B2DRange& /*rRange*/) const
+{
+ // always visible in default version
+ return true;
+}
+
+// Get info about the need to visualize GluePoints
+bool ObjectContact::AreGluePointsVisible() const
+{
+ return false;
+}
+
+// method to create a EventHandler. Needs to give a result.
+sdr::event::TimerEventHandler* ObjectContact::CreateEventHandler()
+{
+ // Create and return a new EventHandler
+ return new sdr::event::TimerEventHandler();
+}
+
+// method to get the primitiveAnimator
+
+// method to get the EventHandler. It will
+// return a existing one or create a new one using CreateEventHandler().
+sdr::event::TimerEventHandler& ObjectContact::GetEventHandler() const
+{
+ if(!HasEventHandler())
+ {
+ const_cast< ObjectContact* >(this)->mpEventHandler = const_cast< ObjectContact* >(this)->CreateEventHandler();
+ DBG_ASSERT(mpEventHandler, "ObjectContact::GetEventHandler(): Got no EventHandler (!)");
+ }
+
+ return *mpEventHandler;
+}
+
+// delete the EventHandler
+void ObjectContact::DeleteEventHandler()
+{
+ if(mpEventHandler)
+ {
+ // If there are still Events registered, something has went wrong
+ delete mpEventHandler;
+ mpEventHandler = 0L;
+ }
+}
+
+// test if there is an EventHandler without creating one on demand
+bool ObjectContact::HasEventHandler() const
+{
+ return (0L != mpEventHandler);
+}
+
+// check if text animation is allowed. Default is sal_true.
+bool ObjectContact::IsTextAnimationAllowed() const
+{
+ return true;
+}
+
+// check if graphic animation is allowed. Default is sal_true.
+bool ObjectContact::IsGraphicAnimationAllowed() const
+{
+ return true;
+}
+
+// check if asynchronous graphics loading is allowed. Default is false.
+bool ObjectContact::IsAsynchronGraphicsLoadingAllowed() const
+{
+ return false;
+}
+
+void ObjectContact::SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew)
+{
+ if(mpViewObjectContactRedirector != pNew)
+ {
+ mpViewObjectContactRedirector = pNew;
+ }
+}
+
+// check if buffering of MasterPages is allowed. Default is false.
+bool ObjectContact::IsMasterPageBufferingAllowed() const
+{
+ return false;
+}
+
+// print? Default is false
+bool ObjectContact::isOutputToPrinter() const
+{
+ return false;
+}
+
+// window? Default is true
+bool ObjectContact::isOutputToWindow() const
+{
+ return true;
+}
+
+// VirtualDevice? Default is false
+bool ObjectContact::isOutputToVirtualDevice() const
+{
+ return false;
+}
+
+// recording MetaFile? Default is false
+bool ObjectContact::isOutputToRecordingMetaFile() const
+{
+ return false;
+}
+
+// pdf export? Default is false
+bool ObjectContact::isOutputToPDFFile() const
+{
+ return false;
+}
+
+// gray display mode
+bool ObjectContact::isDrawModeGray() const
+{
+ return false;
+}
+
+// gray display mode
+bool ObjectContact::isDrawModeBlackWhite() const
+{
+ return false;
+}
+
+// high contrast display mode
+bool ObjectContact::isDrawModeHighContrast() const
+{
+ return false;
+}
+
+// access to SdrPageView. Default implementation returns NULL
+SdrPageView* ObjectContact::TryToGetSdrPageView() const
+{
+ return 0;
+}
+
+// access to OutputDevice. Default implementation returns NULL
+OutputDevice* ObjectContact::TryToGetOutputDevice() const
+{
+ return 0;
+}
+
+void ObjectContact::resetViewPort()
+{
+ const drawinglayer::geometry::ViewInformation2D& rCurrentVI2D = getViewInformation2D();
+
+ if(!rCurrentVI2D.getViewport().isEmpty())
{
- ObjectContact::ObjectContact()
- : maViewObjectContactVector(),
- maPrimitiveAnimator(),
- mpEventHandler(0),
- mpViewObjectContactRedirector(0),
- maViewInformation2D(uno::Sequence< beans::PropertyValue >()),
- mbIsPreviewRenderer(false)
- {
- }
-
- ObjectContact::~ObjectContact()
- {
- // get rid of all registered contacts
- // #i84257# To avoid that each 'delete pCandidate' again uses
- // the local RemoveViewObjectContact with a search and removal in the
- // vector, simply copy and clear local vector.
- std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector);
- maViewObjectContactVector.clear();
-
- while(!aLocalVOCList.empty())
- {
- ViewObjectContact* pCandidate = aLocalVOCList.back();
- aLocalVOCList.pop_back();
- DBG_ASSERT(pCandidate, "Corrupted ViewObjectContactList (!)");
-
- // ViewObjectContacts only make sense with View and Object contacts.
- // When the contact to the SdrObject is deleted like in this case,
- // all ViewObjectContacts can be deleted, too.
- delete pCandidate;
- }
-
- // assert when there were new entries added during deletion
- DBG_ASSERT(maViewObjectContactVector.empty(), "Corrupted ViewObjectContactList (!)");
-
- // delete the EventHandler. This will destroy all still contained events.
- DeleteEventHandler();
- }
-
- // LazyInvalidate request. Default implementation directly handles
- // this by calling back triggerLazyInvalidate() at the VOC
- void ObjectContact::setLazyInvalidate(ViewObjectContact& rVOC)
- {
- rVOC.triggerLazyInvalidate();
- }
-
- // call this to support evtl. preparations for repaint. Default does nothing
- void ObjectContact::PrepareProcessDisplay()
- {
- }
-
- // A new ViewObjectContact was created and shall be remembered.
- void ObjectContact::AddViewObjectContact(ViewObjectContact& rVOContact)
- {
- maViewObjectContactVector.push_back(&rVOContact);
- }
-
- // A ViewObjectContact was deleted and shall be forgotten.
- void ObjectContact::RemoveViewObjectContact(ViewObjectContact& rVOContact)
- {
- std::vector< ViewObjectContact* >::iterator aFindResult = std::find(maViewObjectContactVector.begin(), maViewObjectContactVector.end(), &rVOContact);
-
- if(aFindResult != maViewObjectContactVector.end())
- {
- maViewObjectContactVector.erase(aFindResult);
- }
- }
-
- // Process the whole displaying
- void ObjectContact::ProcessDisplay(DisplayInfo& /*rDisplayInfo*/)
- {
- // default does nothing
- }
-
- // test if visualizing of entered groups is switched on at all
- bool ObjectContact::DoVisualizeEnteredGroup() const
- {
- // Don not do that as default
- return false;
- }
-
- // get active group's (the entered group) ViewContact
- const ViewContact* ObjectContact::getActiveViewContact() const
- {
- // default has no active VC
- return 0;
- }
-
- // Invalidate given rectangle at the window/output which is represented by
- // this ObjectContact.
- void ObjectContact::InvalidatePartOfView(const basegfx::B2DRange& /*rRange*/) const
- {
- // nothing to do here in the default version
- }
-
- // Get info if given Rectangle is visible in this view
- bool ObjectContact::IsAreaVisible(const basegfx::B2DRange& /*rRange*/) const
- {
- // always visible in default version
- return true;
- }
-
- // Get info about the need to visualize GluePoints
- bool ObjectContact::AreGluePointsVisible() const
- {
- return false;
- }
-
- // method to create a EventHandler. Needs to give a result.
- sdr::event::TimerEventHandler* ObjectContact::CreateEventHandler()
- {
- // Create and return a new EventHandler
- return new sdr::event::TimerEventHandler();
- }
-
- // method to get the primitiveAnimator
-
- // method to get the EventHandler. It will
- // return a existing one or create a new one using CreateEventHandler().
- sdr::event::TimerEventHandler& ObjectContact::GetEventHandler() const
- {
- if(!HasEventHandler())
- {
- const_cast< ObjectContact* >(this)->mpEventHandler = const_cast< ObjectContact* >(this)->CreateEventHandler();
- DBG_ASSERT(mpEventHandler, "ObjectContact::GetEventHandler(): Got no EventHandler (!)");
- }
-
- return *mpEventHandler;
- }
-
- // delete the EventHandler
- void ObjectContact::DeleteEventHandler()
- {
- if(mpEventHandler)
- {
- // If there are still Events registered, something has went wrong
- delete mpEventHandler;
- mpEventHandler = 0L;
- }
- }
-
- // test if there is an EventHandler without creating one on demand
- bool ObjectContact::HasEventHandler() const
- {
- return (0L != mpEventHandler);
- }
-
- // check if text animation is allowed. Default is sal_true.
- bool ObjectContact::IsTextAnimationAllowed() const
- {
- return true;
- }
-
- // check if graphic animation is allowed. Default is sal_true.
- bool ObjectContact::IsGraphicAnimationAllowed() const
- {
- return true;
- }
-
- // check if asynchronous graphics loading is allowed. Default is false.
- bool ObjectContact::IsAsynchronGraphicsLoadingAllowed() const
- {
- return false;
- }
-
- void ObjectContact::SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew)
- {
- if(mpViewObjectContactRedirector != pNew)
- {
- mpViewObjectContactRedirector = pNew;
- }
- }
-
- // check if buffering of MasterPages is allowed. Default is false.
- bool ObjectContact::IsMasterPageBufferingAllowed() const
- {
- return false;
- }
-
- // print? Default is false
- bool ObjectContact::isOutputToPrinter() const
- {
- return false;
- }
-
- // window? Default is true
- bool ObjectContact::isOutputToWindow() const
- {
- return true;
- }
-
- // VirtualDevice? Default is false
- bool ObjectContact::isOutputToVirtualDevice() const
- {
- return false;
- }
-
- // recording MetaFile? Default is false
- bool ObjectContact::isOutputToRecordingMetaFile() const
- {
- return false;
- }
-
- // pdf export? Default is false
- bool ObjectContact::isOutputToPDFFile() const
- {
- return false;
- }
-
- // gray display mode
- bool ObjectContact::isDrawModeGray() const
- {
- return false;
- }
-
- // gray display mode
- bool ObjectContact::isDrawModeBlackWhite() const
- {
- return false;
- }
-
- // high contrast display mode
- bool ObjectContact::isDrawModeHighContrast() const
- {
- return false;
- }
-
- // access to SdrPageView. Default implementation returns NULL
- SdrPageView* ObjectContact::TryToGetSdrPageView() const
- {
- return 0;
- }
-
- // access to OutputDevice. Default implementation returns NULL
- OutputDevice* ObjectContact::TryToGetOutputDevice() const
- {
- return 0;
- }
-
- void ObjectContact::resetViewPort()
- {
- const drawinglayer::geometry::ViewInformation2D& rCurrentVI2D = getViewInformation2D();
-
- if(!rCurrentVI2D.getViewport().isEmpty())
- {
- const basegfx::B2DRange aEmptyRange;
-
- drawinglayer::geometry::ViewInformation2D aNewVI2D(
- rCurrentVI2D.getObjectTransformation(),
- rCurrentVI2D.getViewTransformation(),
- aEmptyRange,
- rCurrentVI2D.getVisualizedPage(),
- rCurrentVI2D.getViewTime(),
- rCurrentVI2D.getExtendedInformationSequence());
-
- updateViewInformation2D(aNewVI2D);
- }
- }
-
- } // end of namespace contact
-} // end of namespace sdr
+ const basegfx::B2DRange aEmptyRange;
+
+ drawinglayer::geometry::ViewInformation2D aNewVI2D(
+ rCurrentVI2D.getObjectTransformation(),
+ rCurrentVI2D.getViewTransformation(),
+ aEmptyRange,
+ rCurrentVI2D.getVisualizedPage(),
+ rCurrentVI2D.getViewTime(),
+ rCurrentVI2D.getExtendedInformationSequence());
+
+ updateViewInformation2D(aNewVI2D);
+ }
+}
+
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index 3da45e7..ac74b2f 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -34,170 +34,165 @@
#include <svx/sdrpaintwindow.hxx>
#include <svx/svdhdl.hxx>
+namespace sdr { namespace contact {
+// Create a Object-Specific ViewObjectContact, set ViewContact and
+// ObjectContact. Always needs to return something.
+ViewObjectContact& ViewContactOfSdrObj::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
+{
+ ViewObjectContact* pRetval = new ViewObjectContactOfSdrObj(rObjectContact, *this);
+ DBG_ASSERT(pRetval, "ViewContactOfSdrObj::CreateObjectSpecificViewObjectContact() failed (!)");
+
+ return *pRetval;
+}
-namespace sdr
+ViewContactOfSdrObj::ViewContactOfSdrObj(SdrObject& rObj)
+: ViewContact(),
+ mrObject(rObj),
+ meRememberedAnimationKind(SDRTEXTANI_NONE)
{
- namespace contact
+ // init AnimationKind
+ if(GetSdrObject().ISA(SdrTextObj))
{
- // Create a Object-Specific ViewObjectContact, set ViewContact and
- // ObjectContact. Always needs to return something.
- ViewObjectContact& ViewContactOfSdrObj::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
- {
- ViewObjectContact* pRetval = new ViewObjectContactOfSdrObj(rObjectContact, *this);
- DBG_ASSERT(pRetval, "ViewContactOfSdrObj::CreateObjectSpecificViewObjectContact() failed (!)");
+ SdrTextObj& rTextObj = static_cast<SdrTextObj&>(GetSdrObject());
+ meRememberedAnimationKind = rTextObj.GetTextAniKind();
+ }
+}
- return *pRetval;
- }
+ViewContactOfSdrObj::~ViewContactOfSdrObj()
+{
+}
- ViewContactOfSdrObj::ViewContactOfSdrObj(SdrObject& rObj)
- : ViewContact(),
- mrObject(rObj),
- meRememberedAnimationKind(SDRTEXTANI_NONE)
- {
- // init AnimationKind
- if(GetSdrObject().ISA(SdrTextObj))
- {
- SdrTextObj& rTextObj = static_cast<SdrTextObj&>(GetSdrObject());
- meRememberedAnimationKind = rTextObj.GetTextAniKind();
- }
- }
+// Access to possible sub-hierarchy
+sal_uInt32 ViewContactOfSdrObj::GetObjectCount() const
+{
+ if(GetSdrObject().GetSubList())
+ {
+ return GetSdrObject().GetSubList()->GetObjCount();
+ }
+
+ return 0L;
+}
- ViewContactOfSdrObj::~ViewContactOfSdrObj()
+ViewContact& ViewContactOfSdrObj::GetViewContact(sal_uInt32 nIndex) const
+{
+ assert(GetSdrObject().GetSubList() &&
+ "ViewContactOfSdrObj::GetViewContact: Access to non-existent Sub-List (!)");
+ SdrObject* pObj = GetSdrObject().GetSubList()->GetObj(nIndex);
+ assert(pObj && "ViewContactOfSdrObj::GetViewContact: Corrupt SdrObjList (!)");
+ return pObj->GetViewContact();
+}
+
+ViewContact* ViewContactOfSdrObj::GetParentContact() const
+{
+ ViewContact* pRetval = 0L;
+ SdrObjList* pObjList = GetSdrObject().GetObjList();
+
+ if(pObjList)
+ {
+ if(pObjList->ISA(SdrPage))
{
+ // Is a page
+ pRetval = &(static_cast<SdrPage*>(pObjList)->GetViewContact());
}
-
- // Access to possible sub-hierarchy
- sal_uInt32 ViewContactOfSdrObj::GetObjectCount() const
+ else
{
- if(GetSdrObject().GetSubList())
+ // Is a group?
+ if(pObjList->GetOwnerObj())
{
- return GetSdrObject().GetSubList()->GetObjCount();
+ pRetval = &(pObjList->GetOwnerObj()->GetViewContact());
}
-
- return 0L;
}
+ }
- ViewContact& ViewContactOfSdrObj::GetViewContact(sal_uInt32 nIndex) const
- {
- assert(GetSdrObject().GetSubList() &&
- "ViewContactOfSdrObj::GetViewContact: Access to non-existent Sub-List (!)");
- SdrObject* pObj = GetSdrObject().GetSubList()->GetObj(nIndex);
- assert(pObj && "ViewContactOfSdrObj::GetViewContact: Corrupt SdrObjList (!)");
- return pObj->GetViewContact();
- }
-
- ViewContact* ViewContactOfSdrObj::GetParentContact() const
- {
- ViewContact* pRetval = 0L;
- SdrObjList* pObjList = GetSdrObject().GetObjList();
+ return pRetval;
+}
- if(pObjList)
- {
- if(pObjList->ISA(SdrPage))
- {
- // Is a page
- pRetval = &(static_cast<SdrPage*>(pObjList)->GetViewContact());
- }
- else
- {
- // Is a group?
- if(pObjList->GetOwnerObj())
- {
- pRetval = &(pObjList->GetOwnerObj()->GetViewContact());
- }
- }
- }
+// React on changes of the object of this ViewContact
+void ViewContactOfSdrObj::ActionChanged()
+{
+ // look for own changes
+ if(GetSdrObject().ISA(SdrTextObj))
+ {
+ SdrTextObj& rTextObj = static_cast<SdrTextObj&>(GetSdrObject());
- return pRetval;
+ if(rTextObj.GetTextAniKind() != meRememberedAnimationKind)
+ {
+ // #i38135# now remember new type
+ meRememberedAnimationKind = rTextObj.GetTextAniKind();
}
+ }
- // React on changes of the object of this ViewContact
- void ViewContactOfSdrObj::ActionChanged()
- {
- // look for own changes
- if(GetSdrObject().ISA(SdrTextObj))
- {
- SdrTextObj& rTextObj = static_cast<SdrTextObj&>(GetSdrObject());
+ // call parent
+ ViewContact::ActionChanged();
+}
- if(rTextObj.GetTextAniKind() != meRememberedAnimationKind)
- {
- // #i38135# now remember new type
- meRememberedAnimationKind = rTextObj.GetTextAniKind();
- }
- }
+// overload for acessing the SdrObject
+SdrObject* ViewContactOfSdrObj::TryToGetSdrObject() const
+{
+ return &GetSdrObject();
+}
- // call parent
- ViewContact::ActionChanged();
- }
- // overload for acessing the SdrObject
- SdrObject* ViewContactOfSdrObj::TryToGetSdrObject() const
- {
- return &GetSdrObject();
- }
+// primitive stuff
+// add Gluepoints (if available)
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrObj::createGluePointPrimitive2DSequence() const
+{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ const SdrGluePointList* pGluePointList = GetSdrObject().GetGluePointList();
- // primitive stuff
+ if(pGluePointList)
+ {
+ const sal_uInt32 nCount(pGluePointList->GetCount());
- // add Gluepoints (if available)
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrObj::createGluePointPrimitive2DSequence() const
+ if(nCount)
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrGluePointList* pGluePointList = GetSdrObject().GetGluePointList();
+ // prepare point vector
+ std::vector< basegfx::B2DPoint > aGluepointVector;
- if(pGluePointList)
+ // create GluePoint primitives. ATM these are relative to the SnapRect
+ for(sal_uInt32 a(0L); a < nCount; a++)
{
- const sal_uInt32 nCount(pGluePointList->GetCount());
-
- if(nCount)
- {
- // prepare point vector
- std::vector< basegfx::B2DPoint > aGluepointVector;
-
- // create GluePoint primitives. ATM these are relative to the SnapRect
- for(sal_uInt32 a(0L); a < nCount; a++)
- {
- const SdrGluePoint& rCandidate = (*pGluePointList)[(sal_uInt16)a];
- const Point aPosition(rCandidate.GetAbsolutePos(GetSdrObject()));
-
- aGluepointVector.push_back(basegfx::B2DPoint(aPosition.X(), aPosition.Y()));
- }
-
- if(!aGluepointVector.empty())
- {
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::MarkerArrayPrimitive2D(
- aGluepointVector, SdrHdl::createGluePointBitmap()));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
- }
+ const SdrGluePoint& rCandidate = (*pGluePointList)[(sal_uInt16)a];
+ const Point aPosition(rCandidate.GetAbsolutePos(GetSdrObject()));
- return xRetval;
- }
+ aGluepointVector.push_back(basegfx::B2DPoint(aPosition.X(), aPosition.Y()));
+ }
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrObj::embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) const
- {
- if(rSource.hasElements() &&
- (!GetSdrObject().GetName().isEmpty() ||
- !GetSdrObject().GetTitle().isEmpty() ||
- !GetSdrObject().GetDescription().isEmpty()))
+ if(!aGluepointVector.empty())
{
- const drawinglayer::primitive2d::Primitive2DReference xRef(
- new drawinglayer::primitive2d::ObjectInfoPrimitive2D(
- rSource,
- GetSdrObject().GetName(),
- GetSdrObject().GetTitle(),
- GetSdrObject().GetDescription()));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::MarkerArrayPrimitive2D(
+ aGluepointVector, SdrHdl::createGluePointBitmap()));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
-
- return rSource;
}
+ }
+
+ return xRetval;
+}
+
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrObj::embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) const
+{
+ if(rSource.hasElements() &&
+ (!GetSdrObject().GetName().isEmpty() ||
+ !GetSdrObject().GetTitle().isEmpty() ||
+ !GetSdrObject().GetDescription().isEmpty()))
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::ObjectInfoPrimitive2D(
+ rSource,
+ GetSdrObject().GetName(),
+ GetSdrObject().GetTitle(),
+ GetSdrObject().GetDescription()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
+ }
+
+ return rSource;
+}
- } // end of namespace contact
-} // end of namespace sdr
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list