[PUSHED] Re: fdo#46808, Adapt UNO services to new style, Part 7, updating ::create

Stephan Bergmann sbergman at redhat.com
Wed Jun 6 03:41:11 PDT 2012


On 06/06/2012 11:28 AM, Noel Grandin wrote:
> In this patch, shouldn't it be
>      uno::Reference<  frame::XDispatchProvider>  xDispatchProvider(rFrame,
>          uno::UNO_QUERY_THROW );<<<<<<<<<<<
>
> because you are not confirming the result with an is() call.
>
> diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
> index c105204..541b3c9 100644
> --- a/svtools/source/uno/contextmenuhelper.cxx
> +++ b/svtools/source/uno/contextmenuhelper.cxx
> @@ -346,27 +346,24 @@ ContextMenuHelper::dispatchCommand(
>       }
>
>       util::URL aTargetURL;
> +    aTargetURL.Complete = aCommandURL;
> +    m_xURLTransformer->parseStrict( aTargetURL );
> +
>       uno::Reference<  frame::XDispatch>  xDispatch;
> -    if ( m_xURLTransformer.is() )
> +    uno::Reference<  frame::XDispatchProvider>  xDispatchProvider(
> +        rFrame, uno::UNO_QUERY );
> +    if ( xDispatchProvider.is() )

^^^ the is() call is still there (this patch just removed the outer "if 
( m_xURLTransformer.is() )" and looks bigger than it actually is due to 
the consequential indentation changes)

Stephan

>       {
> -        aTargetURL.Complete = aCommandURL;
> -        m_xURLTransformer->parseStrict( aTargetURL );
> -
> -        uno::Reference<  frame::XDispatchProvider>  xDispatchProvider(
> -            rFrame, uno::UNO_QUERY );
> -        if ( xDispatchProvider.is() )


More information about the LibreOffice mailing list