Possible option to simplify code?

Miklos Vajna vmiklos at suse.cz
Mon Jun 25 09:20:17 PDT 2012


On Sun, Jun 24, 2012 at 06:28:05PM +0200, Michael Stahl <mstahl at redhat.com> wrote:
> 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?
> 
> 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++.

Yes, that makes sense, I just did so in master.


More information about the LibreOffice mailing list