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


sberg wrote
...
getCppuType is not without flaws though, and cppu::UnoType should be 
used instead.
...
What cast are you talking about?  The one in the typical usage like 
getCppuType((T*)0)?  Sure, nothing keeps you from writing that as 
getCppuType(static_cast<T*>(0)), or better yet, cppu::UnoType
<T>
::get(), 
instead.

Thank you Stephan for your feedback and the detailed explanations.
Yes I was talking about this typical usage.
Great if cppu::UnoType<T>::get() is better than getCppuType usage!
It will serve 2 goals then:
1) a better usage
2) a fix to cppcheck report "Expression is always false because 'else if'
condition matches previous condition at line..." for this type of case
(of course, I consider 1) more important but it will kill 2 birds with one
stone)

Eg in sfx2/source/toolbox/tbxitem.cxx, I could change:
else if ( pType == ::getCppuType((const sal_uInt32*)0) )
to 
else if ( pType == cppu::UnoType<const sal_uInt32>::get() )

Just to be sure, it would then mean that getCppuType could be removed after
having replaced all the occurences of getCppuType by cppu::UnoType... or are
there some special/specific cases?

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/Questions-about-getCppuType-tp4106361p4106403.html
Sent from the Dev mailing list archive at Nabble.com.

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.