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

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to