diff options
author | Mike Kaganski <mikekaganski@hotmail.com> | 2015-05-03 22:59:49 +1000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-05-03 16:14:03 +0000 |
commit | 8568c7226cfb732e17fa42b365b9fce3a8264691 (patch) | |
tree | dc69882a2a1931f590bcd316fceefaffe7e34a2e /embedserv | |
parent | d1ed2f0a23a3c0895e5c01c2bd402de52997196e (diff) |
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@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'embedserv')
-rw-r--r-- | embedserv/source/embed/docholder.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx index 496d08935767..45a2dc8bf1e2 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 ); |