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


Hi,

Sometimes some methods are declared with some default value(s)
As an example, here is the definition of matchAsciiL for OUString
>>>>>
sal_Bool matchAsciiL( const sal_Char* asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex = 0 ) const SAL_THROW(())
>>>>>


When these functions are called, the optional parameters are sometimes passed with the default values. As an example, at line 60 of /framework/source/lomenubar/MenuItemStatusListener.cxx, we can find :
>>>>>>>
    if ((Event.State >>= oULabel) &&
        !oULabel.matchAsciiL ("private:", 8, 0) &&
        !oULabel.matchAsciiL (".uno:", 5, 0)    &&
        !oULabel.matchAsciiL ("slot:", 5, 0)    &&
        !oULabel.matchAsciiL ("service:", 8, 0) &&
        !oULabel.matchAsciiL (".cmd:", 5, 0)    &&
        !oULabel.matchAsciiL ("macro:///", 5, 0))
>>>>>>>

Would it be interesting to lightweight the code by removing these useless parameters ?
It could be a Easy Hacks for Beginners


Best regards
Christophe JAILLET


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.