[Libreoffice] Remove duplicate 'placeholder' icons
Joachim Trémouroux
joachim.tremouroux at gmail.com
Fri Nov 26 07:01:50 PST 2010
Hi everybody,
Here is another patch for the duplicate icons task.
On 11/25/2010 02:18 PM, Michael Meeks wrote:
> On Tue, 2010-11-23 at 22:04 +0100, Joachim Trémouroux wrote:
> I have looked at the calling places. The ImplImageTree::loadImage
>
>> method is called here:
>> vcl/source/gdi/bitmapex.cxx
>> vcl/source/gdi/image.cxx
>> vcl/source/gdi/imagerepository.cxx
>>
> Right; we should clearly clobber the BitmapEx constructor from a
> ResId
> - since this is just grabbing a path from a resource file - to load the
> missing icon if it is not there.
>
I have modified BitmapEx in the attached patch
> Where ImageList::GetImage is called
> from, I don't know, we should audit that too.
>
g grep "vcl/image.hxx" | wc -l returns 179 lines...
I guess I need more time to check this ;-)
ImageRepository::loadImage is called in
>>
>> libs-gui/svtools/source/graphic/provider.cxx (method
>> GraphicProvider::queryGraphicDescriptor)
>> itself called in components/cui/source/customize/cfg.cxx
>> and in impress/sd/source/filter/grf/sdgrffilter.cxx
>>
> Right - this badly needs the return value; perhaps we should add the
> loadMissing parameter - and default to false on the ImageRepository
> class as well.
>
> Done.
libs-gui/toolkit/source/layout/core/helper.cxx (method
>> layoutimpl::loadGraphic)
>> itself called in toolkit/source/awt/vclxbutton.cxx
>> and in toolkit/source/layout/vcl/wbutton.cxx
>>
> This should be substituting missing icons.
>
Done in helper.cxx
Wrt. testing, I would try adding a custom item / icon to a toolbar
> and
> then editing the file to rename the icon named (so it doesn't exist),
> and re-loading [ prolly easiest if saved as flat-XML ? ] to see if we
> get the right behaviour with the missing icon code there (?).
>
>
Is there a tutorial somewhere? It doesn't look so obvious to me...
I have tried to rename an icon in a existing .xhp file but I still see the
correct icon. Not sure I have modified the correct file
Attached patch is LGPLv3+/MPL.
As suggested by Andrew I have used an existing icon for the fallback icon.
I'll continue with auditing the usage of vcl/image.hxx. And of course a bit
of testing.
Regards,
Joachim.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101126/1b551575/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: duplicate_icon.patch
Type: text/x-patch
Size: 4284 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101126/1b551575/attachment-0001.bin>
More information about the LibreOffice
mailing list