using bool in rtl::OUStringBuffer::append

Noel Grandin noel at
Wed Oct 3 22:49:15 PDT 2012

On 2012-10-03 22:03, Stephan Bergmann wrote:
>> places. The commit seems to have caused some test failures and
>> crashes. I reverted it for now.
> ...which only goes to show what a horrible mess C++ is in practice. 
> bool is rather special, but you easily forget to consider all the 
> consequences of that.  Turns out that code like
>   aBuf.append( pElementType->pTypeName );
> (typelib_static_sequence_type_init, 
> cppu/source/typelib/static_types.cxx), where pElementType->pTypeName 
> is of type rtl_uString*, now chooses for overload resolution the 
> standard boolean conversion from rtl_uString* to bool (yielding true, 
> so appending "true" to aBuf) rather than the user-defined conversion 
> by constructor from rtl_uString* to rtl::OUString.

Can that be fixed by adding an
    OUStringBuffer::append( rtl_uString* )
method, which does the necessary conversion internally?


More information about the LibreOffice mailing list