(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 Desktop
Packages, which is subscribed to libreoffice in Ubuntu.
https://bugs.launchpad.net/bugs/491746

Title:
  [Upstream] No interactive crop in Writer

Status in LibreOffice Productivity Suite:
  Confirmed
Status in The OpenOffice.org Suite:
  Unknown
Status in libreoffice package in Ubuntu:
  Won't Fix
Status in openoffice.org package in Ubuntu:
  Won't Fix

Bug description:
  Binary package hint: openoffice.org

  OpenOffice.org Writer in both Karmic and Lucid appears to lack the
  interactive crop feature. This feature is present in Draw, and in
  Windows Writer builds.

  WORKAROUND: Secondary click picture -> click Picture... -> tab Crop.

  ProblemType: Bug
  Architecture: i386
  Date: Thu Dec  3 18:08:10 2009
  DistroRelease: Ubuntu 10.04
  Package: openoffice.org-writer 1:3.1.1-5ubuntu1
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_AU.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.32-5.6-generic
  SourcePackage: openoffice.org
  Uname: Linux 2.6.32-5-generic i686

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

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to