Apache OpenOffice (AOO) Bugzilla – Issue 101648
Inserting a frame via toolbar results in wrong position of frame
Last modified: 2013-08-07 14:44:00 UTC
Open the 'Insert' toolbar and click 'Insert Frame Manually'. Try to draw a frame on a page whatever you want. The frame is always created top left on the first page and has always the same size. Found in OOo 3.1 final.
Set keyword regression. Behaviour was o.k. in OOo 3.0.1
confirmed - OOO310m11 on W2K SP4 - OOO310m11 on Ubuntu Linux 8.10 setting Priority to P3
MRU->OS: when trying to draw a frame with the mouse, only a yellow bordered rectangle will be shown in the upper left during drawing process and then the frame will be placed there.
->aw: A lot of assertion pop up when inserting the frame. od told me the reason is the integration of some awxx-cws.
Adding MRU and OD to cc.
*** Issue 102250 has been marked as a duplicate of this issue. ***
AW: This is the root to #i102250#, need to check (see there). Adding to CWS aw073...
AW: Okay, done.
AW: Reopening: Closed the wrong task. AW: Preparing SW with some debug...
AW: SW prepared, taking a look...
AW: The method SW is using to create frames interactively is pretty weird. It uses the standard SdrCreateView::BegCreateObj call, but it uses GetDrawView()->SetCurrentObj( eSdrObjectKind ) in SwFEShell::BeginCreate to use a eSdrObjectKind of OBJ_NONE (== 0). This creates and manipulates a naked (non-derived) SdrObject. A naked SdrObject is not a good idea to use, it has by definition no SfxItemSet (no properties) and only a rectangle (the aOutRect member is 're-used' for this, normally holding the BoundRect). But it must have worked, so i will make it work again. The base implementations for interactive create (SdrObject::BegCreate/MovCreate/EndCreate/BrkCreate/BckCreate/TakeCreatePoly/GetCreatePointer) manipulate aOutRect directly. This is disturbed by also clearing this rectangle by using SetBoundRectDirty()/SetRectsDirty(). This again was changed by me; before, there was an extra bool to mark the rectangles (including aOutRect) as invalid withut resetting them, i use aOutRect.IsEmpty() instead now. The old base-impl of rect recalculations simply resetted the flag, so aOutRect survived (by chance...?). To make the interactive create work again i have to remove the SetBoundRectDirty()/SetRectsDirty() calls and the bSnapRectDirty=TRUE (makes no sense here). This makes the positioning work again. The visualisation needs some hint that no FullDrag shall be used for this mode (else a naked SdrObject will be asked for it's visualisation which gives the yellow fallback rectangle that can be seen). To do so, i will use the OBJ_NONE type identification in SdrCreateView::ShowCreateObj to switch off FullDrag. These steps together make the interactive frame creation work again. Doing some more checks...
AW: Added changes, no more problems found (the derivated implementations of the create methods, e.g. BegCreate, etc., do never call the base implementations). Committed, done.
AW: Checked on installed Win32 install set, works as expected.
AW->WG: Please verify as descibed; i or OD may also show/demonstrate if needed
Reassigning Writer issue to MRU.
.
Verified in DEV300m56 on Ubuntu Linux 9.04
Closing.