summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2010-08-18 16:43:38 +0200
committerMikhail Voytenko <mav@openoffice.org>2010-08-18 16:43:38 +0200
commit967756108a94191a992d38cc4866a5f2971f56f5 (patch)
tree236159c976c72a236551e05c4f56a14d4fc19456 /sfx2
parent4929c034350dbad96804a5c517d3471c1d7b7b14 (diff)
fwk153: #i113674# replace backing component if there is one
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewfrm.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index ed924623c700..a7f5c9d16541 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -96,6 +96,7 @@
#include <comphelper/storagehelper.hxx>
#include <svtools/asynclink.hxx>
#include <svl/sharecontrolfile.hxx>
+#include <framework/framelistanalyzer.hxx>
#include <boost/optional.hpp>
@@ -2092,7 +2093,25 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell
{
::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
- xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+
+ if ( !i_bHidden )
+ {
+ try
+ {
+ // if there is a backing component, use it
+ Reference< XFramesSupplier > xTaskSupplier( xDesktop , css::uno::UNO_QUERY_THROW );
+ ::framework::FrameListAnalyzer aAnalyzer( xTaskSupplier, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT );
+
+ if ( aAnalyzer.m_xBackingComponent.is() )
+ xFrame = aAnalyzer.m_xBackingComponent;
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ if ( !xFrame.is() )
+ xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+
bOwnFrame = true;
}