Re: [PUSHED][PATCH] convert table.hxx use in editeng/inc/editeng/forbiddencharacterstable.hxx

2012-02-16 Thread Kohei Yoshida
On Thu, 2012-02-16 at 10:48 +0400, Ivan Timofeev wrote: Whoa, I seem to be too naive for patch-reviewing... Is it a safe code? pForbiddenCharacters = maMap[ nLanguage ]; return pForbiddenCharacters; Yeah I don't see anything wrong with it. Will pForbiddenCharacters point to

Re: [PUSHED][PATCH] convert table.hxx use in editeng/inc/editeng/forbiddencharacterstable.hxx

2012-02-16 Thread Michael Meeks
On Thu, 2012-02-16 at 15:20 -0500, Kohei Yoshida wrote: Is it a safe code? pForbiddenCharacters = maMap[ nLanguage ]; return pForbiddenCharacters; ... So, in theory, taking the address of a returned object which itself is a reference to the instance stored in the container is

Re: [PUSHED][PATCH] convert table.hxx use in editeng/inc/editeng/forbiddencharacterstable.hxx

2012-02-16 Thread Kohei Yoshida
On Thu, Feb 16, 2012 at 4:01 PM, Michael Meeks michael.me...@suse.com wrote: On Thu, 2012-02-16 at 15:20 -0500, Kohei Yoshida wrote: Is it a safe code?      pForbiddenCharacters = maMap[ nLanguage ];      return pForbiddenCharacters; ... So, in theory, taking the address of a returned

Re: [PUSHED][PATCH] convert table.hxx use in editeng/inc/editeng/forbiddencharacterstable.hxx

2012-02-16 Thread Ivan Timofeev
On 17.02.2012 00:20, Kohei Yoshida wrote: As far as I know those STL methods that return its element are guaranteed to return a reference to the stored instance, not its copy. Ah, great, I was not sure of that. On 17.02.2012 01:01, Michael Meeks wrote: I guess :-) I imagine the real

Re: [PUSHED][PATCH] convert table.hxx use in editeng/inc/editeng/forbiddencharacterstable.hxx

2012-02-15 Thread Ivan Timofeev
Hi Noel, On 15.02.2012 19:01, Noel Grandin wrote: Updated patch implementing Ivan's suggestion. Passes make and make check. Convert tools/table.hxx usage in editeng/inc/editeng/forbiddencharacterstable.hxx to std::map Looks good to me, pushed (without GetCharInfo - it was unused):

Re: [PUSHED][PATCH] convert table.hxx use in editeng/inc/editeng/forbiddencharacterstable.hxx

2012-02-15 Thread Ivan Timofeev
Whoa, I seem to be too naive for patch-reviewing... Is it a safe code? pForbiddenCharacters = maMap[ nLanguage ]; return pForbiddenCharacters; Will pForbiddenCharacters point to the deleted object, after the return? Terribly sorry for such a question... Regards, Ivan