Re: [Libreoffice-commits] core.git: ucb/source

classic Classic list List threaded Threaded
1 message Options
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: [Libreoffice-commits] core.git: ucb/source

On 01/11/2014 04:40 PM, Julien Nabet wrote:

> commit 0d1f724f9645e7ec0da6a4c3a1c22d0dcf785cb6
> Author: Julien Nabet <[hidden email]>
> Date:   Sat Jan 11 16:38:08 2014 +0100
>
>      Resolves: fdo#72277 https CMIS Alfresco "The specified device is invalid."
>
>      Change-Id: I34f8b5e19d9bea0c6d98a7f3258b67e82c50e1de
>
> diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
> index 53777bc..a2e1868 100644
> --- a/ucb/source/ucp/cmis/cmis_content.cxx
> +++ b/ucb/source/ucp/cmis/cmis_content.cxx
> @@ -297,9 +297,11 @@ namespace cmis
>                           ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI,
>                           ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) );
>
> +                OUString pURL =  m_aURL.getBindingUrl( );
> +
>                   m_pSession = libcmis::SessionFactory::createSession(
>                           OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ),
> -                        rUsername, rPassword, OUSTR_TO_STDSTR( m_aURL.getRepositoryId( ) ), sal_False, oauth2Data );
> +                        rUsername, rPassword, OUSTR_TO_STDSTR( m_aURL.getRepositoryId( ) ), pURL.startsWith("https")?true:false, oauth2Data );
>                   if ( m_pSession == NULL )
>                       ucbhelper::cancelCommandExecution(
>                                           ucb::IOErrorCode_INVALID_DEVICE,

Hi Julien,

Four nitpicks, if you don't mind:

* pURL -- those funny Hungarian prefixes like "p", if used at all (which
I would personally suggest not to, even if lots of LO code does), "p"
means "pointer", so this should be "a" (an object) or maybe "s" (string)

* ?true:false -- is redundant

* startsWith("https") -- should better be "https:" so it doesn't
erroneously pick up other URI schemes that start with "https" (not that
there are any, but anyway)

* startsWith -- should better be startsWithIgnoreAsciiCase, as URI
schemes are not case sensitive

Stephan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice