The local method lcl_GetImageFromPngUrl() is implemented five times. Idea is to make it a helper function and reduce copy and pasted code. Seems that tools/ would be an appropriate directory for this. Here is the list: http://opengrok.libreoffice.org/search?q=lcl_GetImageFromPngUrl&project=core
NEW right away.
svtools seems to be the more appropriate directory.
Ok, I am willing to work on this bug. But I'm not sure where I should move the method. I guess svtools/source/graphic is the right directory, but I don't think creating a new file for a method is worth it. So where should I put it ?
@Jelle: You could create a file named helper.cxx or something similar. Then submit it to gerrit and hopefully someone will complain if it's not the right directory. @mmeeks: Do you have a idea where to put this method in?
comphelper seems to be the canonical place to stick those things into.
Jelle: I put you as assigned to warn clearly other people someone is working on it. Of course, if you change your mind or lack of time,... don't hesitate to revert:)
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
I am working in this bug and I have a doubt. I created a new file inside comphelper to move this function.When I compile the code the following problem is showed: make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libsvllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libcomphelper.so dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libi18nutil.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libcomphelper.so dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libsotlo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libcomphelper.so dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libtllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libcomphelper.so dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libutllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libcomphelper.so dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libvcllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/Headers/Library/libcomphelper.so dependency dropped. make[1]: Circular /home/vanz/git/libo/instdir/unxlngx6.pro/program/libsvllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/LinkTarget/Library/libcomphelper.so.exports dependency dropped. make[1]: Circular /home/vanz/git/libo/instdir/unxlngx6.pro/program/libi18nutil.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/LinkTarget/Library/libcomphelper.so.exports dependency dropped. make[1]: Circular /home/vanz/git/libo/instdir/unxlngx6.pro/program/libsotlo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/LinkTarget/Library/libcomphelper.so.exports dependency dropped. make[1]: Circular /home/vanz/git/libo/instdir/unxlngx6.pro/program/libtllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/LinkTarget/Library/libcomphelper.so.exports dependency dropped. make[1]: Circular /home/vanz/git/libo/instdir/unxlngx6.pro/program/libutllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/LinkTarget/Library/libcomphelper.so.exports dependency dropped. make[1]: Circular /home/vanz/git/libo/instdir/unxlngx6.pro/program/libvcllo.so <- /home/vanz/git/libo/workdir/unxlngx6.pro/LinkTarget/Library/libcomphelper.so.exports dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/ResTarget/vclen-US.res <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/btntext.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/helptext.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/images.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/menu.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/print.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/stdtext.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/throbber.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/units.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/src/fpicker.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. make[1]: Circular /home/vanz/git/libo/workdir/unxlngx6.pro/SrsPartTarget/vcl/source/edit/textundo.src <- /home/vanz/git/libo/workdir/unxlngx6.pro/Executable/rsc.run dependency dropped. On my .cxx there are the following includes: #include <vcl/graph.hxx> #include <vcl/graphicfilter.hxx> #include <vcl/image.hxx> #include <osl/file.hxx>
correcting... ;) On my .hxx there are the following includes: #include <vcl/graph.hxx> #include <vcl/graphicfilter.hxx> #include <vcl/image.hxx> #include <osl/file.hxx>
Sorry, but this functionality (a helper or not) should go into vcl. The function is clearly for creation of images and it does not use any problematic dependencies so it should be somewhere near Image.cxx. When you go to comphelper it says "Helper functionality for implementing UNO components". This function has directly nothing to do with UNO so this is not the right place or we could put anything in here which I hope we don't.
Hi Jose - thanks so much for working on this ! :-) as Tomaz says - putting it into vcl/ and prolly directly into Image itself - perhaps as a constructor / static create method would be wonderul.
Ok! I'll submit a patch soon :)
Jose Guilherme Vanz committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=288f0029c69ab0532165877637a146f774d5e740 fdo#52622 - Reduce copy and paste code The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Nice work, José :)
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp ) [NinjaEdit]
Remove LibreOffice Dev List from CC on EasyHacks (curtailing excessive email to list) [NinjaEdit]