Question on call to IsCrookAllowed in SdrDragView::BegDragObj

Thorsten Behrens thb at documentfoundation.org
Tue Mar 12 15:50:24 PDT 2013


Philippe Jung wrote:
> Trying to implement crop Image in writer, I reached the "case
> SDRDRAG_CROP" code in  SdrDragView::BegDragObj.
> 
Nice, would be cool to have that!

> This part of code calls new SdrDragCrop if and only if
> IsCrookAllowed(true) or IsCrookAllowed(false)
> 
> This basically means that the cropped object must be RotateFreeAllowed
> or ContortionPossible.
> 
Looks like copypasta to me -

> If I create a IsCropAllowed for the SDRDRAG_CROP case (not changing
> anything for SDRDRAG_CROOK case) and in IsCropAllowed I put only
> 
>     ForcePossibilities();
>     return (!bMoveProtect && bMoveAllowed)
>            || (!bResizeProtect && bContortionPossible);
> 
Yeah, would go for that - but the condition probably should be
something like (!bMoveProtect && bMoveAllowed && !bResizeProtect &&
bResizePropAllowed) or somesuch - this bContortionPossible contortion
relates to the crook functionality. Once you have that hacked, play a
bit with Draw/Impress, too, in the position/size dialog, you can lock
move and resize - if that behaves sensibly with your crop feature.

HTH,

-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130312/58249b43/attachment-0001.pgp>


More information about the LibreOffice mailing list