Commit: Fix drag/drop icon segfault.


Subject: Commit: Fix drag/drop icon segfault.
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Sun Feb 03 2002 - 18:20:49 CST


This segfault occured if you dragged and dropped an icon on a toolbar then
changed the number of toolbars visible in the frame. It occurs because the
pointers in AP_FrameData to the toolbars are stale after being
rebuilt. The solution was a simple method in

ap_UnixFrame.cpp::refillToolbarsInFrameData

to set the pointers correctly. However the toolbar rebuilding code is in
XAP_UnixFrame and xap_UnixGnomeFrame which does not have direct access to
the framedata class. This means that this method must be pure virtual in
XAP_Frame.cpp.

This in turn means that I had to implement this code in all the
ap_*Frame.h headers to keep abiword compiling on all platforms. This means
some platfroms may be broken because I haven't tested them.

Sorry in advance again. We really need src/wp/ap/xp/ap_Frame.cpp.

BTW the implementation on all platforms other than unix is

refillToolbarsInFrameData(void) {UT_ASSERT(0);}

So once platform maintainers implement icon drag and dropping you'll get a
nice assert to remind you to implement this :-)

Curtesy of Hub.

Cheers

Martin

CVS: ----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: src/af/xap/unix/xap_UnixFrame.cpp
CVS: src/af/xap/unix/xap_UnixFrame.h
CVS: src/af/xap/unix/gnome/xap_UnixGnomeFrame.cpp
CVS: src/af/xap/xp/xap_Frame.h src/text/fmt/xp/fl_SectionLayout.cpp
CVS: src/text/fmt/xp/fp_Line.cpp src/text/fmt/xp/fv_View.cpp
CVS: src/wp/ap/beos/ap_BeOSFrame.h src/wp/ap/cocoa/ap_CocoaFrame.h
CVS: src/wp/ap/mac/ap_MacFrame.h src/wp/ap/qnx/ap_QNXFrame.h
CVS: src/wp/ap/unix/ap_UnixFrame.cpp src/wp/ap/unix/ap_UnixFrame.h
CVS: src/wp/ap/win/ap_Win32Frame.h
CVS: ----------------------------------------------------------------------
Fix segfault after drag/drop toolbar icon and changing the number of
toolbars i\n the view.



This archive was generated by hypermail 2b25 : Sun Feb 03 2002 - 18:21:52 CST