Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index




On 2012-02-08 08:40, David Tardon wrote:
Why not split it into more patches, preferably one for each replaced class? It would make review easier (and it would also make revert of only one of the conversions easier, if it proves necessary ;-) A couple of comments:
Sure, will do.

IMHO it would be more appropriate to use boost::ptr_map here.
OK.

You add "compatibility" functions here, but replace them by std::map functions at other places. Are these so widely used it would be impractical?
In general I try not to produce too much code churn, so I create compatibility functions if I see more than about 5 uses.

-const com::sun::star::i18n::ForbiddenCharacters* 
SvxForbiddenCharactersTable::GetForbiddenCharacters( sal_uInt16 nLanguage, sal_Bool bGetDefault ) 
const
+const com::sun::star::i18n::ForbiddenCharacters* 
SvxForbiddenCharactersTable::GetForbiddenCharacters( sal_uInt16 nLanguage, sal_Bool bGetDefault )
  {
-    ForbiddenCharactersInfo* pInf = Get( nLanguage );
+    ForbiddenCharactersInfo* pInf = GetCharInfo( nLanguage );
      if ( !pInf&&  bGetDefault&&  mxMSF.is() )
      {
-        const SvxForbiddenCharactersTableImpl *pConstImpl = dynamic_cast<const 
SvxForbiddenCharactersTableImpl*>(this);
-        SvxForbiddenCharactersTableImpl* pImpl = 
const_cast<SvxForbiddenCharactersTableImpl*>(pConstImpl);
-         pInf = new ForbiddenCharactersInfo;
-        pImpl->Insert( nLanguage, pInf );
+        pInf = new ForbiddenCharactersInfo;
+        maCharInfoMap[ nLanguage ] = pInf;

          pInf->bTemporary = sal_True;
          LocaleDataWrapper aWrapper( mxMSF, SvxCreateLocale( nLanguage ) );
This function can remain const if you declare the maCharInfoMap member
mutable. But that is just a nitpick :-)

This I don't understand - maCharInfoMap is not declared const, so how can I make it mutable?

Thanks for the feedback.


Disclaimer: http://www.peralex.com/disclaimer.html



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.