summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdedtv.cxx
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 /svx/source/svdraw/svdedtv.cxx
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 'svx/source/svdraw/svdedtv.cxx')
-rw-r--r--svx/source/svdraw/svdedtv.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 8984e9450353..c9a567a2914c 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -72,6 +72,7 @@ void SdrEditView::ImpResetPossibilityFlags()
bMirror45Allowed =false;
bMirror90Allowed =false;
bTransparenceAllowed =false;
+ bCropAllowed =false;
bGradientAllowed =false;
bShearAllowed =false;
bEdgeRadiusAllowed =false;
@@ -402,6 +403,12 @@ bool SdrEditView::IsTransparenceAllowed() const
return bTransparenceAllowed;
}
+bool SdrEditView::IsCropAllowed() const
+{
+ ForcePossibilities();
+ return bCropAllowed;
+}
+
bool SdrEditView::IsGradientAllowed() const
{
ForcePossibilities();
@@ -509,6 +516,7 @@ void SdrEditView::CheckPossibilities()
// these ones are only allowed when single object is selected
bTransparenceAllowed = (nMarkCount == 1);
bGradientAllowed = (nMarkCount == 1);
+ bCropAllowed = (nMarkCount == 1);
if(bGradientAllowed)
{
// gradient depends on fill style
@@ -576,6 +584,10 @@ void SdrEditView::CheckPossibilities()
}
}
+ // Must be resizeable to allow cropping
+ if (!aInfo.bResizeFreeAllowed && !aInfo.bResizePropAllowed)
+ bCropAllowed = false;
+
// if one member cannot be converted, no conversion is possible
if(!aInfo.bCanConvToContour)
bCanConvToContour = false;