(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 received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/491746

Title:
  [Upstream] No interactive crop in Writer

To manage notifications about this bug go to:
https://bugs.launchpad.net/df-libreoffice/+bug/491746/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to