[PATCH] Remove RTL_CONSTASCII_(U)STRINGPARAM (sd)

Stephan Bergmann sbergman at redhat.com
Fri May 31 02:02:34 PDT 2013


On 05/30/2013 10:32 PM, Christina Roßmanith (via Code Review) wrote:
> @@ -810,8 +805,8 @@
>                       {
>                           const String& rTypeName = pFilter->GetRealTypeName();
>
> -                        if( (rTypeName.CompareToAscii( RTL_CONSTASCII_STRINGPARAM("impress_StarImpress" ) ) == 0) ||
> -                            (rTypeName.CompareToAscii( RTL_CONSTASCII_STRINGPARAM("draw_StarDraw" ) ) == 0) )
> +                        if( (rTypeName.CompareToAscii( "impress_StarImpress" ) == 0) ||
> +                            (rTypeName.CompareToAscii( "draw_StarDraw" ) == 0) )
>                           {
>                               bTransform = true;
>                           }

Careful with any string functions containing "compare" in their 
names---they don't necessarily do what one might expect.  Fixed now with 
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=018c22d37878f1fc349085143ee4241165a4802a> 
"UniString::CompareToAscii(RTL_CONSTASCII_STRINGPARAM("x"))==COMPARE_EQUAL 
..."

Stephan



More information about the LibreOffice mailing list