Hi Philippe,
Philippe Jung schrieb:
Hi,
I am working on implementing the Crop Image feature in Writer.
Which one? In Impress/Draw we have .uno:Crop (That is used for cropping
with the mouse) and .uno:GrafAttrCrop (That opens the crop dialog)?
Cropping ends in svx/source/svdraw/svddrgmt.cxx SdrDragCrop::EndSdrDrag.
When cropping from Impress, marked object is SdrGrafObj. I rewrote part
of the code so that Cropping is now part of SdrGrafObj (Similar to
NbcMove, NbcResize and so on).
??
In Writer it is the property "GraphicCrop", a struct, type
com.sun.star.text.GraphicCrop.
When cropping from Writer, the marked Object (and so the object to crop)
is SwVirtFlyDrawObj (dflyobj.cxx). I have added SwVirtDrawObj::NbcCrop
as Resize or Move. At this point, I would like to save the new values
for crop attributes. That's where help is needed : how SwVirtFlyDrawObj
relates to the embedded image and what is the "expected" way of applying
an attribute to the image in a SwVirtFlyDrawObj?
Got various ways to read the current value of the image, but I did not
succeed in writing new values. I am a bit lost betwwen GetFrm,
GetFrm->Lower, FrameFmt, and all the possible attribute pools.
Any recommandation would be appreciated :-).
The crop property exists for pictures in Writer, for
com.sun.star.text.TextGraphicObject and
com.sun.star.drawing.GraphicObjectShape as well. There is no problem to
crop a picture using a macro. In a macro you need to set the GraphicCrop
property, nothing more. Therefore there should be no need to change
anything on the objects themselves, but write a UI for it.
(I'm no core developer, but see things from writing macros, so I might
be totally wrong.)
Kind regards
Regina
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.