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

Noel Grandin noel at peralex.com
Wed Jun 6 02:28:53 PDT 2012


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() )
      {
-        aTargetURL.Complete = aCommandURL;
-        m_xURLTransformer->parseStrict( aTargetURL );
-
-        uno::Reference<  frame::XDispatchProvider>  xDispatchProvider(
-            rFrame, uno::UNO_QUERY );
-        if ( xDispatchProvider.is() )
+        try
+        {
+            xDispatch = xDispatchProvider->queryDispatch( aTargetURL, m_aSelf, 0 );
+        }
+        catch ( uno::RuntimeException&  )
+        {
+            throw;
+        }
+        catch ( uno::Exception&  )
          {
-            try
-            {
-                xDispatch = xDispatchProvider->queryDispatch( aTargetURL, m_aSelf, 0 );
-            }
-            catch ( uno::RuntimeException&  )
-            {
-                throw;
-            }
-            catch ( uno::Exception&  )
-            {
-            }
          }
      }



On 2012-06-06 11:02, Stephan Bergmann wrote:
> On 06/04/2012 05:12 PM, Stephan Bergmann wrote:
>> Will look at the other four patches later.
>
> And now also pushed the other four.  Again, they needed some trivial 
> merge fixes, and I added a number of tweaks to patches 2, 3, and 5 
> (see attachments for reference).
>
> Thanks again,
> Stephan
>
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice

Disclaimer: http://www.peralex.com/disclaimer.html


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120606/4ece30d1/attachment-0001.htm>


More information about the LibreOffice mailing list