[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - embedserv/source

Mike Kaganski mikekaganski at hotmail.com
Thu May 7 07:02:44 PDT 2015


 embedserv/source/embed/docholder.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 73eb60c8f958c6e33cde897194711111e31b45c2
Author: Mike Kaganski <mikekaganski at hotmail.com>
Date:   Sun May 3 22:59:49 2015 +1000

    tdf#66232: Cannot open files by COM2
    
    As suggested by comment 13 of the bug, the problem is caused
    by commit b248624126c271c88381d3dad6e04fc954f65779 by Noel Grandin.
    
    1. DocumentHolder::DocumentFrame(): XDesktop2 cannot be directly
    queried for XFrame2. And in this case, simple XFrame is enough.
    
    2. DocumentHolder::CloseFrame(): m_xFrame->dispose() violates an
    assert because of NULL reference. Reverted to previous code.
    
    3. Following commit debde4fdc443f522562ee29def4c27512d64609a by
    Andras Timar (supposed to fix the bug), found two places where
    previously used to be UNO_QUERY, but now UNO_QUERY_THROW is used.
    These places are reverted to use UNO_QUERY.
    
    Change-Id: Ifb9e74367d5dd99ba12166abdd443b29a8018aeb
    Reviewed-on: https://gerrit.libreoffice.org/15607
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 8568c7226cfb732e17fa42b365b9fce3a8264691)
    Signed-off-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/15618
    Reviewed-by: Mike Kaganski <mikekaganski at hotmail.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index 3263c9b..89098f3 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -363,7 +363,7 @@ HRESULT DocumentHolder::InPlaceActivate(
             LoadDocInFrame( sal_True );
 
             uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(comphelper::getComponentContext(m_xFactory));
-            xDesktop->getFrames()->append( uno::Reference<frame::XFrame>(m_xFrame, uno::UNO_QUERY_THROW) );
+            xDesktop->getFrames()->append( uno::Reference<frame::XFrame>(m_xFrame, uno::UNO_QUERY) );
 
             // determine the menuhandle to get menutitems.
             if(m_xLayoutManager.is()) {
@@ -694,7 +694,9 @@ void DocumentHolder::CloseFrame()
         catch( const uno::Exception& ) {
         }
     else {
-        m_xFrame->dispose();
+        uno::Reference<lang::XComponent> xComp(m_xFrame, uno::UNO_QUERY);
+        if (xComp.is())
+            xComp->dispose();
     }
 
     m_xFrame = uno::Reference< frame::XFrame2 >();
@@ -770,13 +772,13 @@ uno::Reference< frame::XFrame2 > DocumentHolder::DocumentFrame()
     {
         uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(comphelper::getComponentContext(m_xFactory));
 
-        uno::Reference<frame::XFrame2> xFrame(xDesktop,uno::UNO_QUERY);
+        uno::Reference<frame::XFrame> xFrame(xDesktop,uno::UNO_QUERY);
 
         // the frame will be registered on desktop here, later when the document
         // is loaded into the frame in ::show() method the terminate listener will be removed
         // this is so only for outplace activation
         if( xFrame.is() )
-            m_xFrame.set( xFrame->findFrame( OUString("_blank"), 0 ), uno::UNO_QUERY_THROW );
+            m_xFrame.set( xFrame->findFrame( OUString("_blank"), 0 ), uno::UNO_QUERY );
 
         uno::Reference< util::XCloseBroadcaster > xBroadcaster(
             m_xFrame, uno::UNO_QUERY );


More information about the Libreoffice-commits mailing list