Possible option to simplify code?
Philipp Riemer
ruderphilipp at gmail.com
Tue Jun 26 00:18:28 PDT 2012
2012/6/25 Miklos Vajna <vmiklos at suse.cz>:
> 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.
Cool. Thank you for your help.
More information about the LibreOffice
mailing list