summaryrefslogtreecommitdiff
path: root/include/svx
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-05-01 23:32:00 +0200
committerJan Holesovsky <kendy@collabora.com>2015-05-05 10:03:29 +0000
commit80a38d299133823e93ec5c29e8fe5c51771940d5 (patch)
tree911b1d525dd741a1210d0dfbb641e140fd52f0b5 /include/svx
parent7ebed1d63e2ad5728fa81b65fa98f09b0406965d (diff)
tdf#34555 add crop features to svx
Adds crop feature to SdrObject. In EndSdrDrag related to Crop, there is a new branch. If object is a regular SdrGrafObj (known inside svx), it is used. Else, a virtual method on the object is used. This enables to forward End of crop action to SwVirtFlyDrawObj objects (when you crop with handles in writer). Regarding writer, coordinates based on Twip/MM100 are used, not the matrix based one. This is part of a serie of 4 patches that adds Save graphic, Change Picture, Edit with external tool, Crop (by handles) in all products (scalc, sdraw, simpress, swriter). Main menus, toolbars and contextual menus are updated accordingly. Change-Id: Ie1a133d18487f51bb9c44ae2f000e63d911bf6b3 Reviewed-on: https://gerrit.libreoffice.org/15588 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'include/svx')
-rw-r--r--include/svx/svdedtv.hxx2
-rw-r--r--include/svx/svdobj.hxx3
-rw-r--r--include/svx/svdograf.hxx2
3 files changed, 6 insertions, 1 deletions
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index c22074bcc5ae..cdc23088704a 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -109,6 +109,7 @@ protected:
bool bShearAllowed : 1;
bool bEdgeRadiusAllowed : 1;
bool bTransparenceAllowed : 1;
+ bool bCropAllowed : 1;
bool bGradientAllowed : 1;
bool bCanConvToPath : 1;
bool bCanConvToPoly : 1;
@@ -250,6 +251,7 @@ public:
bool IsShearAllowed() const;
bool IsEdgeRadiusAllowed() const;
bool IsCrookAllowed(bool bNoContortion=false) const;
+ bool IsCropAllowed() const;
bool IsDistortAllowed(bool bNoContortion=false) const;
// Unite several objects to a polygon:
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index de32cf06ce7e..d7f71d5a9c13 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -571,6 +571,7 @@ public:
virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+ virtual void addCropHandles(SdrHdlList& rTarget) const;
/// The standard transformations (Move,Resize,Rotate,Mirror,Shear) are
/// taken over by the View (TakeXorPoly(),...).
@@ -630,12 +631,14 @@ public:
/// Nbc means "no broadcast".
virtual void NbcMove (const Size& rSiz);
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcCrop (const Point& rRef, const Fraction& xFact, const Fraction& yFact);
virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs);
virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
virtual void NbcShear (const Point& rRef, long nAngle, double tn, bool bVShear);
virtual void Move (const Size& rSiz);
virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true);
+ virtual void Crop (const Point& rRef, const Fraction& xFact, const Fraction& yFact);
virtual void Rotate(const Point& rRef, long nAngle, double sn, double cs);
virtual void Mirror(const Point& rRef1, const Point& rRef2);
virtual void Shear (const Point& rRef, long nAngle, double tn, bool bVShear);
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index 29499a180742..c0becced8c17 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -210,7 +210,7 @@ public:
virtual SdrObject* getFullDragClone() const SAL_OVERRIDE;
// add handles for crop mode when selected
- void addCropHandles(SdrHdlList& rTarget) const;
+ virtual void addCropHandles(SdrHdlList& rTarget) const;
};
#endif // INCLUDED_SVX_SVDOGRAF_HXX