On 23/06/12 21:26, Philipp Riemer wrote: > (1) Wouldn't it be better in the method > "SwXTextDefaults::supportsService" to use the output of > "SwXTextDefaults::getSupportedServiceNames" and make an "is in array?" > check there instead of duplicating the allowed/supported string > values?
yes there is some room for improvement with these methods, see e.g. the SupportsServiceImpl/GetSupportedServiceNamesImpl methods in sw/inc/unobaseclass.hxx and usage in e.g. sw/source/unocore/unobkm.cxx. guess it would make sense to deploy this more widely :) > (2) I skimmed over the file "cppu/inc/com/sun/star/uno/Sequence.hxx" > since (a) there are no Doxygen pages for this module and (b) this > seems to be the return value of > "SwXTextDefaults::getSupportedServiceNames". As far as I understand, > this class does not provide any option to do such a simple "contains?" > checking (like e.g. the Java Collection class > <http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html#contains(java.lang.Object)>). hmmm, adding such a method would be possible. but you can already do something similar by using the STL algorithms; there is a comphelper/stlunosequence.hxx that has some begin()/end() functions that work on uno::Sequence, and with that you can just use std::find() like on any STL container, which i guess is what's appropriate in C++. _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice