Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


https://bugs.freedesktop.org/show_bug.cgi?id=34555

--- Comment #50 from Laurent Charrière <lcharriere@gmail.com> ---
(In reply to wepmaschda from comment #14)
The files

(draw)
http://cgit.freedesktop.org/libreoffice/core/tree/svx/source/tbxctrls/
grafctrl.cxx
and
(writer)
http://cgit.freedesktop.org/libreoffice/core/tree/sw/source/ui/shells/grfsh.
cxx

are quite similar.

There are blocks labeled "SID_ATTR_GRAF_CROP" in
SvxGrafAttrHelper::ExecuteGrafAttr() and
SvxGrafAttrHelper::GetGrafAttrState() in the first file. 

So I started looking into this, and I think that SID_ATTR_GRAF_CROP is used
when cropping with the dialog, but I don't think it's used when doing an
interactive crop. I added debug statements here and there when doing a crop in
Draw, and the relevant SID is SID_OBJECT_CROP. Unfortunately this is not used
in Writer. I'm able to add a new 'Crop Image' option in the context menu for
inserted images in Writer, but then the problem becomes that Writer and Draw
don't seem to use the same data structure to insert graphics, and it looks like
only the one in Draw supports interactive crop. Details follow:

In Draw, once SID_OBJECT_CROP is sent, eventually what happens is that
FuSelection::Activate() sets the drag mode SDRDRAG_CROP on mpView.
SdrMarkView::SetDragMode get called. In turns, it calls
SdrMarkView::SetMarkHandles(). In that method, there is to test to see if
pMarkedObj is an instance of SdrGrafObj. When true, the instance of SdrGrafObj
is responsible for "handling crop" (according to the comments). This is true in
Draw, but not in Writer. In Writer, pMarkedObj is a SwVirtFlyDrawObj.

I'm stuck at this point. I don't know how to make the SwVirtFlyDrawObj draw the
crop handles. Interestingly enough, while the handles are not drawn, the corner
of an inserted image are draggable, and the cursor is changed to the cropping
cursor. But there is no visible cropping taking place as in Draw.

As a side note, OpenOffice.org has a whole page devoted to an ongoing
refactoring of Writer's usage of the Drawing layer at
https://wiki.openoffice.org/wiki/Refactoring_of_Writer%27s_usage_of_the_Drawing_layer.
I think this may be related.

I would appreciate any pointers on how to keep proceeding with this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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.