https://issues.apache.org/ooo/show_bug.cgi?id=122116
--- Comment #9 from Ariel Constenla-Haile <[email protected]> --- (In reply to comment #2) > Among the possible solutions, one could be: > > * change these member functions, make them static, taking a theme name and a > theme item id as argument; and > * change the slot definition (right now it is already wrong: it is > dispatched with arguments, but defined without them): add slot arguments, > for example: theme name, theme item id, gallery item format, if item is > link, item URL (when link) I took another approach: * added a new SvxGalleryItem: - the gallery item ID is a sal_uIntPtr, this is a sal_uInt32 or sal_uInt64, depending on the arch. (sal/inc/sal/types.h) There is no SfxPoolItem to hold a sal_uIntPtr, so that changing the slot definition to add a gallery item id argument, would have required to create one - for UNO clients, dispatching the command would require to know the item ID. The fact that the index of an UNO gallery item is the same as the one of the internal implementation, is simply an implementation detail (main/svx/source/unogallery/) Adding this new pool item had the advantage of completely remove some stuff, as described below. * remove the member functions, and turn the GalleryExplorer into a mere utility class. - INetURLObject GetURL() const; - String GetFilterName() const; - Graphic GetGraphic() const; - sal_Bool GetVCDrawModel( FmFormModel& rModel ) const; - sal_Bool IsLinkage() const; * remove the define SVX_GALLERY() #define SVX_GALLERY() (GalleryExplorer::GetGallery()) * remove the defines for gallery item type from the public interface of the GalleryExplorer; instead of it, use the IDL definition of css::gallery::GalleryItemType in the client code (sw, sc, sd) * Moved the slot definition of SID_GALLERY_BG_BRUSH from sfx2 to svx: the method slot arguments were wrong, it also needed an SvxBrushItem sfx2/sdi/sfx.sdi SfxVoidItem BackgroundImage SID_GALLERY_BG_BRUSH (SfxStringItem ImageFile SID_FILE_NAME) svx/sdi/svx.sdi SfxVoidItem BackgroundImage SID_GALLERY_BG_BRUSH (SvxBrushItem Background SID_GALLERY_BG_BRUSH, SfxUInt16Item Position SID_GALLERY_BG_POS) * avoid crash on the shells' execute method by checking the request arguments * the context menu was retrieving the state of the slots and executing them bypassing the UNO layer, this was solved by moving all related code to only use pure UNO dispatch framework * as a consequence of the bug described above, the gallery was inserting graphics in protected cursor (a protected cell in a table, a protected section), this was solved by the same fix -- You are receiving this mail because: You are on the CC list for the bug.
