Bug 46501 - EasyHack: cleanup SimpleResMgr ...
Summary: EasyHack: cleanup SimpleResMgr ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Szabolcs Dézsi
URL:
Whiteboard: target:3.6.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2012-02-23 03:22 UTC by Michael Meeks
Modified: 2015-12-15 23:37 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Removed SimpleResMgr's constructor (with OUString parameter) (3.42 KB, patch)
2012-03-02 03:32 UTC, Szabolcs Dézsi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2012-02-23 03:22:19 UTC
The SimpleResMgr has two constructors, one taking an rtl::OUString and the other a simple char * - since we now have implicit construction of OUStrings, this was seen to cause problems.

We should audit the usage of these two constructors, and remove one of them - perhaps keeping the 'const char *' version.

Similarly we should remove usage of: CREATEVERSIONRESMGR_NAME - which seems to be an un-necessary stringifying macro.

We prolly want to junk the: CREATEVERSIONRESMGR macro, in-lining it at each site as well - it appears to add no value at all if the _NAME macro is gone.

Thanks ! :-)
Comment 1 Stephan Bergmann 2012-02-23 08:08:34 UTC
The CREATEVERSIONRESMGR[_NAME] part got already fixed with <http://cgit.freedesktop.org/libreoffice/core/commit/?id=86ffa606478d18968babe809931be65463399fbb> "Get rid of CREATEVERSIONRESMGR[_NAME]" and <http://cgit.freedesktop.org/libreoffice/binfilter/commit/?id=0593ef5c57daa85f5982e57d11618b631aa5692d> "Get rid of CREATEVERSIONRESMGR_NAME."
Comment 2 Szabolcs Dézsi 2012-03-02 00:40:58 UTC
(In reply to comment #0)
> The SimpleResMgr has two constructors, one taking an rtl::OUString and the
> other a simple char * - since we now have implicit construction of OUStrings,
> this was seen to cause problems.

Hello!

I removed the constructor with the OUString parameter.
There was one error after i tried to compile.

In extensions/source/resource/oooresourceloader.cxx (line 205):

204:   ::rtl::OUString sBaseName( _rBaseName );
205:   m_pResourceManager = new SimpleResMgr( sBaseName, m_aLocale );

sBaseName is of type OUString and there's no constructor with this parameter.
What did you mean by implicit construction? (not implicit conversion I presume, because with implicit conversion this should work (I think))

Szabolcs
Comment 3 Michael Meeks 2012-03-02 02:05:24 UTC
great - for that last one, I guess a simple conversion to rtl::OString with a UTF8 encoding (it'll be ascii anyway but ...) would do, pass the result of 'getStr()' to the method.

Thanks !
Comment 4 Szabolcs Dézsi 2012-03-02 03:32:25 UTC
Created attachment 57914 [details]
Removed SimpleResMgr's constructor (with OUString parameter)
Comment 5 Not Assigned 2012-03-02 05:47:05 UTC
Szabolcs Dezsi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bcd21acf727da88388c2dcbc795c24525f178dde

fdo#46501: Cleanup SimpleResMgr
Comment 6 Michael Meeks 2012-03-02 06:29:40 UTC
so - closing; thanks ! :-)
Comment 7 Rainer Bielefeld Retired 2012-04-05 08:07:43 UTC
I added Fix submitter as assignee because this will ease queries and bug tracking.
Comment 8 Robinson Tryon (qubit) 2015-12-15 23:37:48 UTC
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyBeginner,SkillCpp,TopicCleanup )
[NinjaEdit]