diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-22 09:24:15 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-08 13:53:04 +0200 |
commit | b248624126c271c88381d3dad6e04fc954f65779 (patch) | |
tree | 989f9131b865ea470ced1317834b91de06efd9e4 | |
parent | c68b934cd03e60ab6e0579108089b0e834ac47ad (diff) |
fdo#46808, Convert frame::Frame to new style
Change-Id: I74427d1e0059808f04960c648b93245b06c20f7f
45 files changed, 555 insertions, 570 deletions
diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx index 27afd5d4e83b..c2bfcde9a84d 100644 --- a/UnoControls/source/controls/framecontrol.cxx +++ b/UnoControls/source/controls/framecontrol.cxx @@ -19,12 +19,13 @@ #include "framecontrol.hxx" +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/frame/Frame.hpp> +#include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> -#include <com/sun/star/frame/XDispatch.hpp> -#include <com/sun/star/frame/FrameSearchFlag.hpp> -#include <com/sun/star/beans/PropertyAttribute.hpp> #include <comphelper/processfactory.hxx> #include <cppuhelper/typeprovider.hxx> #include <osl/diagnose.h> @@ -459,8 +460,8 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee const OUString& rURL , const Sequence< PropertyValue >& rArguments ) { - Reference< XFrame > xOldFrame ; - Reference< XFrame > xNewFrame ; + Reference< XFrame2 > xOldFrame ; + Reference< XFrame2 > xNewFrame ; { MutexGuard aGuard ( m_aMutex ) ; @@ -469,29 +470,24 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee - xNewFrame = Reference< XFrame > ( impl_getComponentContext()->getServiceManager()->createInstanceWithContext("com.sun.star.frame.Frame", impl_getComponentContext()), UNO_QUERY ) ; - Reference< XDispatchProvider > xDSP ( xNewFrame, UNO_QUERY ) ; + xNewFrame = Frame::create( impl_getComponentContext() ); - if (xDSP.is()) - { - Reference< XWindow > xWP ( xPeer, UNO_QUERY ) ; - xNewFrame->initialize ( xWP ) ; - - // option - //xFrame->setName( "WhatYouWant" ); + Reference< XWindow > xWP ( xPeer, UNO_QUERY ) ; + xNewFrame->initialize ( xWP ) ; - Reference< XURLTransformer > xTrans = URLTransformer::create( impl_getComponentContext() ); - // load file - URL aURL ; + // option + //xFrame->setName( "WhatYouWant" ); - aURL.Complete = rURL ; - xTrans->parseStrict( aURL ) ; + Reference< XURLTransformer > xTrans = URLTransformer::create( impl_getComponentContext() ); + // load file + URL aURL ; + aURL.Complete = rURL ; + xTrans->parseStrict( aURL ) ; - Reference< XDispatch > xDisp = xDSP->queryDispatch ( aURL, OUString (), FrameSearchFlag::SELF ) ; - if (xDisp.is()) - { - xDisp->dispatch ( aURL, rArguments ) ; - } + Reference< XDispatch > xDisp = xNewFrame->queryDispatch ( aURL, OUString (), FrameSearchFlag::SELF ) ; + if (xDisp.is()) + { + xDisp->dispatch ( aURL, rArguments ) ; } // set the frame @@ -519,20 +515,20 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee void FrameControl::impl_deleteFrame() { - Reference< XFrame > xOldFrame; - Reference< XFrame > xNullFrame; + Reference< XFrame2 > xOldFrame; + Reference< XFrame2 > xNullFrame; { // do not dispose the frame in this guarded section (deadlock?) MutexGuard aGuard( m_aMutex ); xOldFrame = m_xFrame; - m_xFrame = Reference< XFrame > (); + m_xFrame = Reference< XFrame2 > (); } // notify the listeners sal_Int32 nFrameId = PROPERTYHANDLE_FRAME; - Any aNewFrame( &xNullFrame, ::getCppuType((const Reference< XFrame >*)0) ); - Any aOldFrame( &xOldFrame, ::getCppuType((const Reference< XFrame >*)0) ); + Any aNewFrame( &xNullFrame, ::getCppuType((const Reference< XFrame2 >*)0) ); + Any aOldFrame( &xOldFrame, ::getCppuType((const Reference< XFrame2 >*)0) ); fire( &nFrameId, &aNewFrame, &aOldFrame, 1, sal_False ); // dispose the frame diff --git a/UnoControls/source/inc/framecontrol.hxx b/UnoControls/source/inc/framecontrol.hxx index 96086a691610..8da8c67e1c15 100644 --- a/UnoControls/source/inc/framecontrol.hxx +++ b/UnoControls/source/inc/framecontrol.hxx @@ -22,7 +22,7 @@ #include <com/sun/star/frame/XFrameActionListener.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/frame/FrameActionEvent.hpp> #include <com/sun/star/frame/FrameAction.hpp> #include <com/sun/star/lang/XServiceName.hpp> @@ -593,7 +593,7 @@ private: private: - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame ; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xFrame ; OUString m_sComponentURL ; ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_seqLoaderArguments ; ::cppu::OMultiTypeInterfaceContainerHelper m_aInterfaceContainer ; diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx index a5f19ac76f4c..24ec2d76aa17 100644 --- a/basctl/source/dlged/propbrw.cxx +++ b/basctl/source/dlged/propbrw.cxx @@ -28,6 +28,7 @@ #include <svx/svxids.hrc> #include <com/sun/star/awt/PosSize.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/inspection/XObjectInspector.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <comphelper/types.hxx> @@ -85,7 +86,6 @@ DBG_NAME(PropBrw) PropBrw::PropBrw (DialogWindowLayout& rLayout_): DockingWindow(&rLayout_), m_bInitialStateChange(true), - m_xORB(comphelper::getProcessServiceFactory()), m_xContextDocument(SfxViewShell::Current() ? SfxViewShell::Current()->GetCurrentDocument() : Reference<XModel>()), rLayout(rLayout_), pView(0) @@ -99,12 +99,9 @@ PropBrw::PropBrw (DialogWindowLayout& rLayout_): try { // create a frame wrapper for myself - m_xMeAsFrame = Reference< XFrame >(m_xORB->createInstance( "com.sun.star.frame.Frame" ), UNO_QUERY); - if (m_xMeAsFrame.is()) - { - m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); - m_xMeAsFrame->setName( "form property browser" ); // change name! - } + m_xMeAsFrame = frame::Frame::create( comphelper::getProcessComponentContext() ); + m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); + m_xMeAsFrame->setName( "form property browser" ); // change name! } catch (const Exception&) { @@ -127,8 +124,7 @@ void PropBrw::ImplReCreateController() try { - Reference< XComponentContext > xOwnContext( - comphelper::getComponentContext( m_xORB ) ); + Reference< XComponentContext > xOwnContext = comphelper::getProcessComponentContext(); // a ComponentContext for the ::cppu::ContextEntry_Init aHandlerContextInfo[] = @@ -160,7 +156,7 @@ void PropBrw::ImplReCreateController() } else { - xAsXController->attachFrame(m_xMeAsFrame); + xAsXController->attachFrame( Reference<XFrame>(m_xMeAsFrame,UNO_QUERY_THROW) ); m_xBrowserComponentWindow = m_xMeAsFrame->getComponentWindow(); DBG_ASSERT(m_xBrowserComponentWindow.is(), "PropBrw::PropBrw: attached the controller, but have no component window!"); } diff --git a/basctl/source/inc/propbrw.hxx b/basctl/source/inc/propbrw.hxx index fe00cdd5e28b..76020e6c0e57 100644 --- a/basctl/source/inc/propbrw.hxx +++ b/basctl/source/inc/propbrw.hxx @@ -21,6 +21,7 @@ #define BASCTL_PROPBRW_HXX #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <comphelper/stl_types.hxx> #include <svl/lstner.hxx> #include <svl/brdcst.hxx> @@ -30,9 +31,6 @@ class SfxBindings; class SdrView; class SfxViewShell; -namespace com { namespace sun { namespace star { namespace lang { - class XMultiServiceFactory; -}}}} namespace basctl { @@ -44,9 +42,7 @@ class PropBrw : public DockingWindow, public SfxListener, public SfxBroadcaster private: bool m_bInitialStateChange; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - m_xORB; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xMeAsFrame; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xBrowserController; diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 62ef52daf496..c7a23ad41f70 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -25,30 +25,30 @@ #include "tabletree.hxx" #include "UITools.hxx" #include "dbtreelistbox.hxx" -#include <com/sun/star/frame/XLayoutManager.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XTabController.hpp> -#include <com/sun/star/sdbc/XConnection.hpp> -#include <com/sun/star/sdbcx/XTablesSupplier.hpp> -#include <com/sun/star/sdbcx/XViewsSupplier.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/container/XContainer.hpp> +#include <com/sun/star/form/XLoadable.hpp> +#include <com/sun/star/frame/XLayoutManager.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/XFrames.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> -#include <com/sun/star/awt/XWindow.hpp> -#include <toolkit/helper/vclunohelper.hxx> -#include <com/sun/star/ucb/XCommandEnvironment.hpp> -#include <com/sun/star/ucb/XCommandProcessor.hpp> -#include <com/sun/star/ucb/Command.hpp> -#include <com/sun/star/form/XLoadable.hpp> -#include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/container/XContainer.hpp> #include <com/sun/star/sdb/CommandType.hpp> -#include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp> #include <com/sun/star/sdb/application/DatabaseObject.hpp> #include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/sdbcx/XTablesSupplier.hpp> +#include <com/sun/star/sdbcx/XViewsSupplier.hpp> +#include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <com/sun/star/ucb/XCommandProcessor.hpp> +#include <com/sun/star/ucb/Command.hpp> +#include <com/sun/star/util/XCloseable.hpp> +#include <toolkit/helper/vclunohelper.hxx> #include "AppView.hxx" #include "dbaccess_helpid.hrc" #include "dbu_app.hrc" @@ -1141,20 +1141,19 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName, { try { - m_xFrame = Reference < XFrame > ( getBorderWin().getView()->getORB()->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.frame.Frame"), getBorderWin().getView()->getORB() ), UNO_QUERY ); + m_xFrame = Frame::create( getBorderWin().getView()->getORB() ); m_xFrame->initialize( m_xWindow ); // no layout manager (and thus no toolbars) in the preview // Must be called after initialize ... but before any other call to this frame. // Otherwise frame throws "life time exceptions" as e.g. NON_INITIALIZED - Reference< XPropertySet > xFrameProps( m_xFrame, UNO_QUERY_THROW ); - xFrameProps->setPropertyValue( OUString( "LayoutManager" ), makeAny(Reference< XLayoutManager >()) ); + m_xFrame->setLayoutManager( Reference< XLayoutManager >() ); Reference<XFramesSupplier> xSup(getBorderWin().getView()->getAppController().getXController()->getFrame(),UNO_QUERY); if ( xSup.is() ) { Reference<XFrames> xFrames = xSup->getFrames(); - xFrames->append(m_xFrame); + xFrames->append( Reference<XFrame>(m_xFrame,UNO_QUERY_THROW)); } } catch(const Exception&) @@ -1169,7 +1168,7 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName, xApplication, NULL, _bTable ) ); SAL_WNODEPRECATED_DECLARATIONS_POP - pDispatcher->setTargetFrame( m_xFrame ); + pDispatcher->setTargetFrame( Reference<XFrame>(m_xFrame,UNO_QUERY_THROW) ); ::comphelper::NamedValueCollection aArgs; aArgs.put( "Preview", sal_True ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index 486ca96a8baa..3f8df99c8240 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -37,7 +37,7 @@ #include <memory> namespace com{ namespace sun { namespace star { namespace awt { class XWindow; } } } } -namespace com{ namespace sun { namespace star { namespace frame { class XFrame; } } } } +namespace com{ namespace sun { namespace star { namespace frame { class XFrame2; } } } } namespace com{ namespace sun { namespace star { namespace io { class XPersist; } } } } #define ELEMENT_COUNT size_t(E_ELEMENT_TYPE_COUNT) @@ -90,7 +90,7 @@ namespace dbaui Window* m_pTablePreview; ::std::auto_ptr<PopupMenu> m_aMenu; PreviewMode m_ePreviewMode; - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > + ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > m_xFrame; ::com::sun::star::uno::Reference < ::com::sun::star::io::XPersist > m_xDocInfo; diff --git a/dbaccess/source/ui/inc/querycontainerwindow.hxx b/dbaccess/source/ui/inc/querycontainerwindow.hxx index 749493ea74c7..5fab032b3cfa 100644 --- a/dbaccess/source/ui/inc/querycontainerwindow.hxx +++ b/dbaccess/source/ui/inc/querycontainerwindow.hxx @@ -23,7 +23,7 @@ #include <vcl/window.hxx> #include <vcl/split.hxx> #include "dataview.hxx" -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include "QueryViewSwitch.hxx" #include <vcl/dockwin.hxx> @@ -50,7 +50,7 @@ namespace dbaui OQueryViewSwitch* m_pViewSwitch; OBeamer* m_pBeamer; Splitter* m_pSplitter; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBeamer; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xBeamer; DECL_LINK( SplitHdl, void* ); public: @@ -66,7 +66,7 @@ namespace dbaui // called when the beamer has been disposed void disposingPreview(); - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > getPreviewFrame() const { return m_xBeamer; } OQueryDesignView* getDesignView() { return m_pViewSwitch->getDesignView(); } diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 07ef8b711f5c..2c04309c68be 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -28,8 +28,9 @@ #include <sfx2/sfxsids.hrc> #include <vcl/fixed.hxx> #include "UITools.hxx" -#include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/Frame.hpp> +#include <com/sun/star/util/XCloseable.hpp> //......................................................................... namespace dbaui @@ -195,18 +196,13 @@ namespace dbaui ::dbaui::notifySystemWindow(this,m_pBeamer,::comphelper::mem_fun(&TaskPaneList::AddWindow)); - Reference < XFrame > xBeamerFrame( m_pViewSwitch->getORB()->getServiceManager()->createInstanceWithContext(OUString("com.sun.star.frame.Frame"), m_pViewSwitch->getORB()),UNO_QUERY ); - m_xBeamer.set( xBeamerFrame ); - OSL_ENSURE(m_xBeamer.is(),"No frame created!"); + m_xBeamer = Frame::create( m_pViewSwitch->getORB() ); m_xBeamer->initialize( VCLUnoHelper::GetInterface ( m_pBeamer ) ); // notify layout manager to not create internal toolbars - Reference < XPropertySet > xPropSet( xBeamerFrame, UNO_QUERY ); try { - const OUString aLayoutManager( "LayoutManager" ); - Reference < XPropertySet > xLMPropSet(xPropSet->getPropertyValue( aLayoutManager ),UNO_QUERY); - + Reference < XPropertySet > xLMPropSet(m_xBeamer->getLayoutManager(), UNO_QUERY); if ( xLMPropSet.is() ) { const OUString aAutomaticToolbars( "AutomaticToolbars" ); @@ -222,7 +218,7 @@ namespace dbaui // append our frame Reference < XFramesSupplier > xSup(_xFrame,UNO_QUERY); Reference < XFrames > xFrames = xSup->getFrames(); - xFrames->append( m_xBeamer ); + xFrames->append( Reference<XFrame>(m_xBeamer,UNO_QUERY_THROW) ); Size aSize = GetOutputSizePixel(); Size aBeamer(aSize.Width(),sal_Int32(aSize.Height()*0.33)); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index ca36ffec8a56..960c8a0d421a 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1192,7 +1192,7 @@ void SAL_CALL OQueryController::disposing( const EventObject& Source ) throw(Run { if ( Source.Source == m_aCurrentFrame.getFrame() ) { // our frame is being disposed -> close the preview window (if we have one) - Reference< XFrame > xPreviewFrame( getContainer()->getPreviewFrame() ); + Reference< XFrame2 > xPreviewFrame( getContainer()->getPreviewFrame() ); ::comphelper::disposeComponent( xPreviewFrame ); } else if ( Source.Source == getContainer()->getPreviewFrame() ) diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx index e5a7511d11e7..e56f66f212b8 100644 --- a/embedserv/source/embed/docholder.cxx +++ b/embedserv/source/embed/docholder.cxx @@ -30,36 +30,37 @@ #include "common.h" #include <Windows.h> -#include <com/sun/star/lang/SystemDependent.hpp> +#include <com/sun/star/awt/XTopWindow.hpp> +#include <com/sun/star/awt/PosSize.hpp> +#include <com/sun/star/awt/XView.hpp> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/XSystemChildFactory.hpp> #include <com/sun/star/awt/XSystemDependentWindowPeer.hpp> #include <com/sun/star/awt/XSystemDependentMenuPeer.hpp> -#include <com/sun/star/ui/XUIElement.hpp> #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/util/XCloseBroadcaster.hpp> -#include <com/sun/star/util/XCloseAble.hpp> -#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/bridge/XBridgeSupplier2.hpp> +#include <com/sun/star/bridge/ModelDependent.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/document/MacroExecMode.hpp> +#include <com/sun/star/embed/EmbedMapUnits.hpp> +#include <com/sun/star/embed/XVisualObject.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XStatusListener.hpp> -#include <com/sun/star/util/XModifyBroadcaster.hpp> #include <com/sun/star/frame/XDispatchProviderInterception.hpp> -#include <com/sun/star/awt/XTopWindow.hpp> -#include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/awt/XView.hpp> -#include <com/sun/star/bridge/XBridgeSupplier2.hpp> -#include <com/sun/star/bridge/ModelDependent.hpp> -#include <com/sun/star/embed/EmbedMapUnits.hpp> -#include <com/sun/star/embed/XVisualObject.hpp> -#include <com/sun/star/document/MacroExecMode.hpp> +#include <com/sun/star/lang/SystemDependent.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/task/InteractionHandler.hpp> +#include <com/sun/star/ui/XUIElement.hpp> +#include <com/sun/star/util/XCloseBroadcaster.hpp> +#include <com/sun/star/util/XCloseAble.hpp> +#include <com/sun/star/util/XModifyBroadcaster.hpp> #include <comphelper/processfactory.hxx> #include <osl/diagnose.h> #include <rtl/process.h> @@ -348,28 +349,12 @@ HRESULT DocumentHolder::InPlaceActivate( m_xFrame->activate(); else { // create frame and initialize it with with the created window - static const OUString aFrameServiceName( "com.sun.star.frame.Frame" ); - m_xFrame = uno::Reference<frame::XFrame>( - m_xFactory->createInstance(aFrameServiceName), - uno::UNO_QUERY); - - if(!m_xFrame.is()) - return ERROR; - + m_xFrame = frame::Frame::create( m_xFactory ); m_xFrame->initialize(m_xEditWindow); - uno::Reference<frame::XDispatchProviderInterception> - xDPI(m_xFrame,uno::UNO_QUERY); - if(xDPI.is()) - xDPI->registerDispatchProviderInterceptor( CreateNewInterceptor() ); + m_xFrame->registerDispatchProviderInterceptor( CreateNewInterceptor() ); - uno::Reference<beans::XPropertySet> xPS(m_xFrame,uno::UNO_QUERY); - if( xPS.is() ) - { - aAny = xPS->getPropertyValue( - OUString("LayoutManager")); - aAny >>= m_xLayoutManager; - } + m_xLayoutManager.set( m_xFrame->getLayoutManager(), UNO_QUERY_THROW ); if(m_xLayoutManager.is()) m_xLayoutManager->setDockingAreaAcceptor(this); @@ -378,7 +363,7 @@ HRESULT DocumentHolder::InPlaceActivate( LoadDocInFrame( sal_True ); uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(comphelper::getComponentContext(m_xFactory)); - xDesktop->getFrames()->append(m_xFrame); + xDesktop->getFrames()->append( uno::Reference<frame::XFrame>(m_xFrame, uno::UNO_QUERY_THROW) ); // determine the menuhandle to get menutitems. if(m_xLayoutManager.is()) { @@ -661,7 +646,7 @@ void DocumentHolder::DisconnectFrameDocument( sal_Bool bComplete ) if ( bComplete ) { - m_xFrame = uno::Reference< frame::XFrame>(); + m_xFrame = uno::Reference<frame::XFrame2>(); m_pIDispatch = NULL; m_xDocument = uno::Reference< frame::XModel >(); } @@ -709,12 +694,10 @@ void DocumentHolder::CloseFrame() catch( const uno::Exception& ) { } else { - uno::Reference<lang::XComponent> xComp(m_xFrame,uno::UNO_QUERY); - if(xComp.is()) - xComp->dispose(); + m_xFrame->dispose(); } - m_xFrame = uno::Reference< frame::XFrame >(); + m_xFrame = uno::Reference< frame::XFrame2 >(); } void DocumentHolder::SetDocument( const uno::Reference< frame::XModel >& xDoc, sal_Bool bLink ) @@ -761,9 +744,7 @@ sal_Bool DocumentHolder::ExecuteSuspendCloseFrame() xCloseable->close(sal_True); else { - uno::Reference<lang::XComponent> xComp( m_xFrame, uno::UNO_QUERY_THROW ); - if( xComp.is() ) - xComp->dispose(); + m_xFrame->dispose(); } } catch( const util::CloseVetoException& ) @@ -777,13 +758,13 @@ sal_Bool DocumentHolder::ExecuteSuspendCloseFrame() { } - m_xFrame = uno::Reference< frame::XFrame >(); + m_xFrame = uno::Reference< frame::XFrame2 >(); } return sal_True; } -uno::Reference< frame::XFrame > DocumentHolder::DocumentFrame() +uno::Reference< frame::XFrame2 > DocumentHolder::DocumentFrame() { if(! m_xFrame.is() ) { @@ -795,8 +776,7 @@ uno::Reference< frame::XFrame > DocumentHolder::DocumentFrame() // 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 = xFrame->findFrame( - OUString("_blank"),0); + m_xFrame = xFrame->findFrame( OUString("_blank"), 0 ); uno::Reference< util::XCloseBroadcaster > xBroadcaster( m_xFrame, uno::UNO_QUERY ); @@ -811,10 +791,7 @@ uno::Reference< frame::XFrame > DocumentHolder::DocumentFrame() if( m_xFrame.is() ) { // intercept - uno::Reference<frame::XDispatchProviderInterception> - xDPI(m_xFrame,uno::UNO_QUERY); - if(xDPI.is()) - xDPI->registerDispatchProviderInterceptor( CreateNewInterceptor() ); + m_xFrame->registerDispatchProviderInterceptor( CreateNewInterceptor() ); } return m_xFrame; @@ -868,17 +845,11 @@ void DocumentHolder::show() LoadDocInFrame( sal_False ); // get rid of second closer if it is there - uno::Reference< beans::XPropertySet > xProps( m_xFrame, uno::UNO_QUERY ); - if ( xProps.is() ) + uno::Reference< beans::XPropertySet > xLMProps( m_xFrame->getLayoutManager(), uno::UNO_QUERY ); + if ( xLMProps.is() ) { - uno::Reference< frame::XLayoutManager > xLayoutManager; - xProps->getPropertyValue( OUString( "LayoutManager" ) ) >>= xLayoutManager; - uno::Reference< beans::XPropertySet > xLMProps( xLayoutManager, uno::UNO_QUERY ); - if ( xLMProps.is() ) - { - xLMProps->setPropertyValue( OUString( "MenuBarCloser" ), - uno::makeAny( uno::Reference< frame::XStatusListener >() ) ); - } + xLMProps->setPropertyValue( OUString( "MenuBarCloser" ), + uno::makeAny( uno::Reference< frame::XStatusListener >() ) ); } if ( !m_bLink ) @@ -1007,24 +978,16 @@ void DocumentHolder::setTitle(const OUString& aDocumentName) } } // set the title - uno::Reference<beans::XPropertySet> xPropSet( - m_xFrame,uno::UNO_QUERY); - if(xPropSet.is()) { - uno::Any aAny; - static const sal_Unicode u[] = { ' ','(',0 }; - static const sal_Unicode c[] = { ')',0 }; - OUString aTotalName(m_aFilterName); - aTotalName += OUString(u); - aTotalName += aDocumentName; - aTotalName += OUString(c); - aAny <<= aTotalName; - try { - xPropSet->setPropertyValue( - OUString("Title"), - aAny); - } - catch( const uno::Exception& ) { - } + static const sal_Unicode u[] = { ' ','(',0 }; + static const sal_Unicode c[] = { ')',0 }; + rtl::OUString aTotalName(m_aFilterName); + aTotalName += rtl::OUString(u); + aTotalName += aDocumentName; + aTotalName += rtl::OUString(c); + try { + m_xFrame->setTitle( aTotalName ); + } + catch( const uno::Exception& ) { } } @@ -1383,7 +1346,7 @@ DocumentHolder::disposing( } if( m_xFrame.is() && m_xFrame == aSource.Source ) - m_xFrame = uno::Reference< frame::XFrame >(); + m_xFrame = uno::Reference< frame::XFrame2 >(); } @@ -1421,14 +1384,14 @@ DocumentHolder::notifyClosing( // can happen only in case of links m_pIDispatch = NULL; m_xDocument = uno::Reference< frame::XModel >(); - m_xFrame = uno::Reference< frame::XFrame >(); + m_xFrame = uno::Reference< frame::XFrame2 >(); LockedEmbedDocument_Impl aDocLock = m_xOleAccess->GetEmbedDocument(); if ( aDocLock.GetEmbedDocument() ) aDocLock.GetEmbedDocument()->OLENotifyClosing(); } else if( m_xFrame.is() && m_xFrame == aSource.Source ) - m_xFrame = uno::Reference< frame::XFrame >(); + m_xFrame = uno::Reference< frame::XFrame2 >(); } void SAL_CALL diff --git a/embedserv/source/inc/docholder.hxx b/embedserv/source/inc/docholder.hxx index 61c6ef80e236..e4f72ee587d6 100644 --- a/embedserv/source/inc/docholder.hxx +++ b/embedserv/source/inc/docholder.hxx @@ -25,7 +25,7 @@ #include <com/sun/star/util/XCloseListener.hpp> #include <com/sun/star/frame/XTerminateListener.hpp> #include <com/sun/star/util/XModifyListener.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <cppuhelper/implbase4.hxx> @@ -90,7 +90,7 @@ private: ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XFrame > m_xFrame; + ::com::sun::star::frame::XFrame2 > m_xFrame; OUString m_aContainerName,m_aDocumentNamePart,m_aFilterName; @@ -100,7 +100,7 @@ private: ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XFrame > DocumentFrame(); + ::com::sun::star::frame::XFrame2 > DocumentFrame(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > diff --git a/extensions/source/nsplugin/source/so_instance.cxx b/extensions/source/nsplugin/source/so_instance.cxx index 23cd49ec4f63..0045da3f5bad 100644 --- a/extensions/source/nsplugin/source/so_instance.cxx +++ b/extensions/source/nsplugin/source/so_instance.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/DispatchHelper.hpp> #include <com/sun/star/frame/XDispatchProviderInterception.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/lang/SystemDependent.hpp> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/XVclWindowPeer.hpp> @@ -172,14 +173,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) m_nX, m_nY, m_nWidth, m_nHeight, m_nFlag); // create frame - m_xFrame = Reference< frame::XFrame >( - mxRemoteMSF->createInstance( OUString("com.sun.star.frame.Frame")), - uno::UNO_QUERY ); - if (!m_xFrame.is()) - { - debug_fprintf(NSP_LOG_APPEND, "can not create frame\n"); - return sal_False; - } + m_xFrame = frame::Frame::create( xContext ); // initialize frame m_xFrame->initialize( m_xUnoWin ); @@ -208,7 +202,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) } // append m_xFrame to m_xFrames - m_xFrames->append( m_xFrame ); + m_xFrames->append( Reference<frame::XFrame>(m_xFrame, uno::UNO_QUERY_THROW) ); // create XComponentLoader Reference< frame::XComponentLoader > xLoader( m_xFrame, uno::UNO_QUERY ); @@ -425,7 +419,7 @@ sal_Bool SoPluginInstance::Destroy(void) m_xUnoWin = Reference< awt::XWindow >(); m_xComponent = Reference< XComponent >(); - m_xFrame = Reference< frame::XFrame >(); + m_xFrame = Reference< frame::XFrame2 >(); m_xFrames = Reference< frame::XFrames >(); m_xDispatcher = Reference< frame::XDispatchHelper >(); m_xDispatchProvider = Reference< frame::XDispatchProvider >(); diff --git a/extensions/source/nsplugin/source/so_instance.hxx b/extensions/source/nsplugin/source/so_instance.hxx index 1af9146a1605..92b771ed5c5c 100644 --- a/extensions/source/nsplugin/source/so_instance.hxx +++ b/extensions/source/nsplugin/source/so_instance.hxx @@ -37,6 +37,7 @@ #include <com/sun/star/uno/XNamingService.hpp> #include <com/sun/star/connection/ConnectionSetupException.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/util/URL.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/io/XSeekable.hpp> @@ -47,7 +48,7 @@ #include <com/sun/star/awt/WindowDescriptor.hpp> #include <rtl/ustring.hxx> #include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/frame/XDispatchHelper.hpp> #include "ns_debug.hxx" @@ -77,7 +78,7 @@ private: // StarOffice component window ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xComponent; // StarOffice frame for this Plugin - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xFrame; // Frames of StarOffice ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrames > m_xFrames; // Dispatcher of frame diff --git a/framework/inc/macros/xtypeprovider.hxx b/framework/inc/macros/xtypeprovider.hxx index 3de533fc552e..85648a75bb99 100644 --- a/framework/inc/macros/xtypeprovider.hxx +++ b/framework/inc/macros/xtypeprovider.hxx @@ -638,6 +638,34 @@ ________________________________________________________________________________ )) \ ) +// implementation of XTypeProvider with 20 additional interfaces for getTypes() +#define DEFINE_XTYPEPROVIDER_21( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19, TYPE20, TYPE21 ) \ + PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \ + (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \ + TYPE2 , \ + TYPE3 , \ + TYPE4 , \ + TYPE5 , \ + TYPE6 , \ + TYPE7 , \ + TYPE8 , \ + TYPE9 , \ + TYPE10 , \ + TYPE11 , \ + TYPE12 \ + )), \ + (PRIVATE_DEFINE_TYPE_9 ( TYPE13 , \ + TYPE14 , \ + TYPE15 , \ + TYPE16 , \ + TYPE17 , \ + TYPE18 , \ + TYPE19 , \ + TYPE20 , \ + TYPE21 \ + )) \ + ) + // implementation of XTypeProvider with 1 additional interface for getTypes() AND using 1 baseclass #define DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) \ PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \ diff --git a/framework/inc/services.h b/framework/inc/services.h index 956568db3721..bf1502632bea 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -28,7 +28,6 @@ namespace framework{ // used servicenames by framework //_________________________________________________________________________________________________________________ -#define SERVICENAME_FRAME DECLARE_ASCII("com.sun.star.frame.Frame" ) #define SERVICENAME_FRAMELOADERFACTORY DECLARE_ASCII("com.sun.star.frame.FrameLoaderFactory" ) #define SERVICENAME_FILTERFACTORY DECLARE_ASCII("com.sun.star.document.FilterFactory" ) #define SERVICENAME_TYPEDETECTION DECLARE_ASCII("com.sun.star.document.TypeDetection" ) @@ -62,7 +61,6 @@ namespace framework{ // used implementationnames by framework //_________________________________________________________________________________________________________________ -#define IMPLEMENTATIONNAME_FRAME DECLARE_ASCII("com.sun.star.comp.framework.Frame" ) #define IMPLEMENTATIONNAME_DESKTOP DECLARE_ASCII("com.sun.star.comp.framework.Desktop" ) #define IMPLEMENTATIONNAME_URLTRANSFORMER DECLARE_ASCII("com.sun.star.comp.framework.URLTransformer" ) #define IMPLEMENTATIONNAME_GENERICFRAMELOADER DECLARE_ASCII("com.sun.star.comp.office.FrameLoader" ) diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx index cc050cff67c1..492c3989c064 100644 --- a/framework/inc/services/frame.hxx +++ b/framework/inc/services/frame.hxx @@ -35,23 +35,6 @@ #include <macros/xserviceinfo.hxx> #include <general.h> -#include <com/sun/star/frame/XDispatchInformationProvider.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/frame/XDispatch.hpp> -#include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> -#include <com/sun/star/frame/XDispatchProviderInterception.hpp> -#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> -#include <com/sun/star/lang/XEventListener.hpp> -#include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/frame/XFrameActionListener.hpp> -#include <com/sun/star/frame/XFrames.hpp> -#include <com/sun/star/frame/XFramesSupplier.hpp> -#include <com/sun/star/frame/XTitle.hpp> -#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> -#include <com/sun/star/task/XStatusIndicator.hpp> -#include <com/sun/star/task/XStatusIndicatorFactory.hpp> #include <com/sun/star/awt/XTopWindowListener.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XTopWindow.hpp> @@ -60,8 +43,18 @@ #include <com/sun/star/awt/FocusEvent.hpp> #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp> #include <com/sun/star/document/XActionLockable.hpp> -#include <com/sun/star/util/XCloseable.hpp> +#include <com/sun/star/lang/XEventListener.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> +#include <com/sun/star/frame/XFrame2.hpp> +#include <com/sun/star/frame/XFrameActionListener.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> +#include <com/sun/star/frame/XTitle.hpp> +#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> +#include <com/sun/star/task/XStatusIndicator.hpp> +#include <com/sun/star/util/XCloseable.hpp> #include <unotools/cmdoptions.hxx> #include <cppuhelper/interfacecontainer.hxx> @@ -111,11 +104,7 @@ class WindowCommandDispatch; class Frame : // interfaces public css::lang::XTypeProvider , public css::lang::XServiceInfo , - public css::frame::XFramesSupplier , // => XFrame => XComponent - public css::frame::XDispatchProvider , - public css::frame::XDispatchProviderInterception , - public css::frame::XDispatchInformationProvider , - public css::task::XStatusIndicatorFactory , + public css::frame::XFrame2 , public css::awt::XWindowListener , // => XEventListener public css::awt::XTopWindowListener , public css::awt::XFocusListener , @@ -290,6 +279,19 @@ class Frame : // interfaces virtual void SAL_CALL addTitleChangeListener ( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener) throw (css::uno::RuntimeException); virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListenr ) throw (css::uno::RuntimeException); + + //--------------------------------------------------------------------------------------------------------- + // XFrame2 attributes + //--------------------------------------------------------------------------------------------------------- + virtual css::uno::Reference<css::container::XNameContainer> SAL_CALL getUserDefinedAttributes() throw (css::uno::RuntimeException); + + virtual css::uno::Reference<css::frame::XDispatchRecorderSupplier> SAL_CALL getDispatchRecorderSupplier() throw (css::uno::RuntimeException); + virtual void SAL_CALL setDispatchRecorderSupplier(const css::uno::Reference<css::frame::XDispatchRecorderSupplier>&) throw (css::uno::RuntimeException); + + virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getLayoutManager() throw (css::uno::RuntimeException); + virtual void SAL_CALL setLayoutManager(const css::uno::Reference<css::uno::XInterface>&) throw (css::uno::RuntimeException); + + //--------------------------------------------------------------------------------------------------------- // PropertySetHelper => XPropertySet, XPropertySetInfo //--------------------------------------------------------------------------------------------------------- @@ -331,7 +333,7 @@ class Frame : // interfaces // non threadsafe void impl_checkMenuCloser ( ); - void impl_setCloser ( const css::uno::Reference< css::frame::XFrame >& xFrame , + void impl_setCloser ( const css::uno::Reference< css::frame::XFrame2 >& xFrame , sal_Bool bState ); void impl_disposeContainerWindow ( css::uno::Reference< css::awt::XWindow >& xWindow ); static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor( ); @@ -403,8 +405,8 @@ class Frame : // interfaces SvtCommandOptions m_aCommandOptions ; /// ref counted class to support disabling commands defined by configuration file sal_Bool m_bSelfClose ; /// in case of CloseVetoException on method close() wqs thrown by ourself - we must close ourself later if no internal processes are running sal_Bool m_bIsHidden ; /// indicates, if this frame is used in hidden mode or not - static css::uno::WeakReference< css::frame::XFrame > m_xCloserFrame ; /// holds the only frame, which must show the special closer menu item (can be NULL!) - css::uno::Reference< ::com::sun::star::frame::XLayoutManager > m_xLayoutManager ; /// is used to layout the child windows of the frame. + static css::uno::WeakReference< css::frame::XFrame2 > m_xCloserFrame ; /// holds the only frame, which must show the special closer menu item (can be NULL!) + css::uno::Reference< ::css::frame::XLayoutManager > m_xLayoutManager ; /// is used to layout the child windows of the frame. css::uno::Reference< css::frame::XDispatchInformationProvider > m_xDispatchInfoHelper ; css::uno::Reference< css::frame::XTitle > m_xTitleHelper ; diff --git a/framework/inc/services/taskcreatorsrv.hxx b/framework/inc/services/taskcreatorsrv.hxx index 2d80f43163dd..68654e0c89e7 100644 --- a/framework/inc/services/taskcreatorsrv.hxx +++ b/framework/inc/services/taskcreatorsrv.hxx @@ -28,7 +28,7 @@ #include <stdtypes.h> #include <com/sun/star/uno/XInterface.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -132,14 +132,14 @@ class TaskCreatorService : public css::lang::XTypeProvider void implts_applyDocStyleToWindow(const css::uno::Reference< css::awt::XWindow >& xWindow) const; - css::uno::Reference< css::frame::XFrame > implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame , + css::uno::Reference< css::frame::XFrame2 > implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame , const css::uno::Reference< css::awt::XWindow >& xContainerWindow , const OUString& sName ); - void implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame >& xFrame ); - void implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame >& xFrame ); + void implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame ); + void implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame2 >& xFrame ); - void implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame >& xFrame ); + void implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame ); OUString impl_filterNames( const OUString& sName ); }; diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 6c6a32aeec67..44d30d03d4de 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -91,22 +91,23 @@ namespace framework{ -css::uno::WeakReference< css::frame::XFrame > Frame::m_xCloserFrame = css::uno::WeakReference< css::frame::XFrame >(); +css::uno::WeakReference< css::frame::XFrame2 > Frame::m_xCloserFrame = css::uno::WeakReference< css::frame::XFrame2 >(); //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XINTERFACE_21 ( Frame , +DEFINE_XINTERFACE_22 ( Frame , OWeakObject , DIRECT_INTERFACE(css::lang::XTypeProvider ), DIRECT_INTERFACE(css::lang::XServiceInfo ), + DIRECT_INTERFACE(css::frame::XFrame2 ), DIRECT_INTERFACE(css::frame::XFramesSupplier ), DIRECT_INTERFACE(css::frame::XFrame ), - DIRECT_INTERFACE(css::lang::XComponent ), DIRECT_INTERFACE(css::task::XStatusIndicatorFactory ), DIRECT_INTERFACE(css::frame::XDispatchProvider ), DIRECT_INTERFACE(css::frame::XDispatchInformationProvider ), DIRECT_INTERFACE(css::frame::XDispatchProviderInterception ), + DIRECT_INTERFACE(css::lang::XComponent ), DIRECT_INTERFACE(css::beans::XPropertySet ), DIRECT_INTERFACE(css::beans::XPropertySetInfo ), DIRECT_INTERFACE(css::awt::XWindowListener ), @@ -121,18 +122,19 @@ DEFINE_XINTERFACE_21 ( Frame DIRECT_INTERFACE(css::frame::XTitleChangeBroadcaster ) ) -DEFINE_XTYPEPROVIDER_20 ( Frame , +DEFINE_XTYPEPROVIDER_21 ( Frame , css::lang::XTypeProvider , css::lang::XServiceInfo , + css::frame::XFrame2 , css::frame::XFramesSupplier , css::frame::XFrame , - css::lang::XComponent , css::task::XStatusIndicatorFactory , - css::beans::XPropertySet , - css::beans::XPropertySetInfo , css::frame::XDispatchProvider , css::frame::XDispatchInformationProvider , css::frame::XDispatchProviderInterception , + css::lang::XComponent , + css::beans::XPropertySet , + css::beans::XPropertySetInfo , css::awt::XWindowListener , css::awt::XTopWindowListener , css::awt::XFocusListener , @@ -146,8 +148,8 @@ DEFINE_XTYPEPROVIDER_20 ( Frame DEFINE_XSERVICEINFO_MULTISERVICE ( Frame , ::cppu::OWeakObject , - SERVICENAME_FRAME , - IMPLEMENTATIONNAME_FRAME + "com.sun.star.frame.Frame" , + OUString("com.sun.star.comp.framework.Frame") ) DEFINE_INIT_SERVICE ( Frame, @@ -1735,6 +1737,47 @@ void SAL_CALL Frame::removeTitleChangeListener( const css::uno::Reference< css:: xTitle->removeTitleChangeListener(xListener); } +css::uno::Reference<css::container::XNameContainer> SAL_CALL Frame::getUserDefinedAttributes() throw (css::uno::RuntimeException) +{ + // optional attribute + return 0; +} + +css::uno::Reference<css::frame::XDispatchRecorderSupplier> SAL_CALL Frame::getDispatchRecorderSupplier() throw (css::uno::RuntimeException) +{ + ReadGuard aReadLock( m_aLock ); + return m_xDispatchRecorderSupplier; +} + +void SAL_CALL Frame::setDispatchRecorderSupplier(const css::uno::Reference<css::frame::XDispatchRecorderSupplier>& p) throw (css::uno::RuntimeException) +{ + TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); + + /* SAFE { */ + WriteGuard aWriteLock( m_aLock ); + m_xDispatchRecorderSupplier.set(p); + aWriteLock.unlock(); + /* } SAFE */ +} + +css::uno::Reference<css::uno::XInterface> SAL_CALL Frame::getLayoutManager() throw (css::uno::RuntimeException) +{ + ReadGuard aReadLock( m_aLock ); + return m_xLayoutManager; +} + +void SAL_CALL Frame::setLayoutManager(const css::uno::Reference<css::uno::XInterface>& p1) throw (css::uno::RuntimeException) +{ + TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); + + /* SAFE { */ + WriteGuard aWriteLock( m_aLock ); + m_xLayoutManager.set(p1, css::uno::UNO_QUERY_THROW); + aWriteLock.unlock(); + /* } SAFE */ +} + + /*-****************************************************************************************************/ void Frame::implts_forgetSubFrames() { @@ -3011,7 +3054,7 @@ void Frame::implts_checkSuicide() <TRUE/> enable; <FALSE/> disable this state */ -void Frame::impl_setCloser( /*IN*/ const css::uno::Reference< css::frame::XFrame >& xFrame , +void Frame::impl_setCloser( /*IN*/ const css::uno::Reference< css::frame::XFrame2 >& xFrame , /*IN*/ sal_Bool bState ) { // Note: If start module isnt installed - no closer has to be shown! @@ -3068,7 +3111,7 @@ void Frame::impl_checkMenuCloser() FrameListAnalyzer::E_HIDDEN | FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT); // specify the new frame, which must have this special state ... - css::uno::Reference< css::frame::XFrame > xNewCloserFrame; + css::uno::Reference< css::frame::XFrame2 > xNewCloserFrame; // ----------------------------- // a) @@ -3088,7 +3131,7 @@ void Frame::impl_checkMenuCloser() { // others[0] can't be the backing component! // Because it's set at the special member aAnalyzer.m_xBackingComponent ... :-) - xNewCloserFrame = aAnalyzer.m_lOtherVisibleFrames[0]; + xNewCloserFrame.set( aAnalyzer.m_lOtherVisibleFrames[0], css::uno::UNO_QUERY_THROW ); } // ----------------------------- // b) @@ -3109,7 +3152,7 @@ void Frame::impl_checkMenuCloser() // or must be enabled/disabled at all. /* STATIC SAFE { */ WriteGuard aStaticWriteLock(LockHelper::getGlobalLock()); - css::uno::Reference< css::frame::XFrame > xCloserFrame (m_xCloserFrame.get(), css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XFrame2 > xCloserFrame (m_xCloserFrame.get(), css::uno::UNO_QUERY); if (xCloserFrame!=xNewCloserFrame) { if (xCloserFrame.is()) diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index b90ef2cef4ab..52f5ebe60a7d 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -27,7 +27,7 @@ #include <loadenv/targethelper.hxx> #include <services.h> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XDesktop.hpp> @@ -160,7 +160,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI //-------------------> // create the new frame - css::uno::Reference< css::frame::XFrame > xFrame = implts_createFrame(xParentFrame, xContainerWindow, sRightName); + css::uno::Reference< css::frame::XFrame2 > xFrame = implts_createFrame(xParentFrame, xContainerWindow, sRightName); // special freature: // A special listener will restore pos/size states in case @@ -264,7 +264,7 @@ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContai } //----------------------------------------------- -css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame , +css::uno::Reference< css::frame::XFrame2 > TaskCreatorService::implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame , const css::uno::Reference< css::awt::XWindow >& xContainerWindow, const OUString& sName ) { @@ -275,7 +275,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame // <- SAFE // create new frame. - css::uno::Reference< css::frame::XFrame > xNewFrame( xSMGR->createInstance( SERVICENAME_FRAME ), css::uno::UNO_QUERY_THROW ); + css::uno::Reference< css::frame::XFrame2 > xNewFrame = css::frame::Frame::create( comphelper::getComponentContext(xSMGR) ); // Set window on frame. // Do it before calling any other interface methods ... @@ -288,7 +288,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame { css::uno::Reference< css::frame::XFramesSupplier > xSupplier (xParentFrame, css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XFrames > xContainer = xSupplier->getFrames(); - xContainer->append( xNewFrame ); + xContainer->append( css::uno::Reference<css::frame::XFrame>(xNewFrame, css::uno::UNO_QUERY_THROW) ); } // Set it's API name (if there is one from outside) @@ -299,7 +299,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame } //----------------------------------------------- -void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame >& xFrame ) +void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame ) { // SAFE -> ReadGuard aReadLock( m_aLock ); @@ -320,7 +320,7 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re } //----------------------------------------------- -void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame >& xFrame ) +void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame ) { // SAFE -> ReadGuard aReadLock( m_aLock ); @@ -340,7 +340,7 @@ void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Refe } //----------------------------------------------- -void TaskCreatorService::implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame >& xFrame ) +void TaskCreatorService::implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame2 >& xFrame ) { // SAFE -> ReadGuard aReadLock( m_aLock ); diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 092cefb7c3ee..3ad428aa9b47 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -161,6 +161,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\ DispatchRecorder \ DispatchRecorderSupplier \ DocumentTemplates \ + Frame \ GlobalEventBroadcaster \ MediaTypeDetectionHelper \ ModuleManager \ @@ -896,7 +897,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/frame,\ DesktopTask \ DesktopTasks \ DispatchProvider \ - Frame \ FrameControl \ FrameLoader \ FrameLoaderFactory \ @@ -2546,6 +2546,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/frame,\ XExtendedFilterDetection \ XFilterDetect \ XFrame \ + XFrame2 \ XFrameActionListener \ XFrameLoader \ XFrameLoaderQuery \ diff --git a/offapi/com/sun/star/frame/Frame.idl b/offapi/com/sun/star/frame/Frame.idl index 5d7224099348..a354fed10754 100644 --- a/offapi/com/sun/star/frame/Frame.idl +++ b/offapi/com/sun/star/frame/Frame.idl @@ -19,15 +19,8 @@ #ifndef __com_sun_star_frame_Frame_idl__ #define __com_sun_star_frame_Frame_idl__ -#include <com/sun/star/frame/XFrame.idl> -#include <com/sun/star/frame/XDispatchProvider.idl> -#include <com/sun/star/frame/XDispatchRecorderSupplier.idl> -#include <com/sun/star/frame/XDispatchProviderInterception.idl> -#include <com/sun/star/frame/XFramesSupplier.idl> -#include <com/sun/star/task/XStatusIndicatorFactory.idl> -#include <com/sun/star/beans/XPropertySet.idl> -#include <com/sun/star/frame/XDispatchInformationProvider.idl> -#include <com/sun/star/xml/UserDefinedAttributesSupplier.idl> +#include <com/sun/star/frame/XFrame2.idl> +#include <com/sun/star/awt/XWindow.idl> module com { module sun { module star { module frame { @@ -45,113 +38,7 @@ @see Desktop */ -published service Frame -{ - /** contains user defined attributes. - - @see <type scope="com::sun::star::xml">UserDefinedAttributesSupplier</type> - */ - [optional] service com::sun::star::xml::UserDefinedAttributesSupplier; - - /** allows the component to be loaded and accessed - within the frame; it is the main connection to the - environment of the component. - */ - interface XFrame; - - /** provides access to dispatchers for the frame. - - <p> - What kind of URLs a frame accepts in the calls to <member>XDispatchProvider::queryDispatch()</member>, - and how the returned dispatcher handles dispatches is completely implementation dependent - (though of course the restrictions of <type>XDispatchProvider</type> must be met). - Frame implementations may (optionally) support special targets in the call to - <member>XDispatchProvider::queryDispatch()</member>. - Such special targets are passed as target frame name. They may, in addition, - require special frame search flags (see <type>FrameSearchFlag</type>), or, - in opposite, limit the set of allowed flags.<br> - Common special targets include: - <ul> - <li><b>_blank</b><br> is used to create a new frame when dispatching the URL.</li> - <li><b>_default</b><br> is used to recycle empty or create a new frame when dispatching the URL.</li> - <li><b>_self</b><br> forces the frame to dispatch the URL into itself. ("" means the same)</li> - <li><b>_parent</b><br> dispatches the URL into the parent frame.</li> - <li><b>_top</b><br> dispatches the URL into the top level frame, the frame where this is invoked belongs to.</li> - </ul> - </p> - - @see XDispatch - @see XFrame::findFrame() - */ - interface XDispatchProvider; - - /** provides information about supported commands - - @since OOo 2.0 - */ - [optional] interface XDispatchInformationProvider; - - /** supports interception mechanism for dispatched URLs - - <p> - Registered objects can intercept, suppress or reroute dispatched URLs. - If they support another interface too (<type>XInterceptorInfo</type>) - it's possible to perform it by directly calling of right interceptor without - using list of all registered ones. - </p> - */ - interface XDispatchProviderInterception; - - /** provides access to sub frames within this frame - */ - interface XFramesSupplier; - - /** supplies access to <type scope="com::sun::star::task">XStatusIndicator</type> objects - for the component within the frame to show progresses - */ - [optional] interface com::sun::star::task::XStatusIndicatorFactory; - - /** if possible it sets/gets the UI title on/from the frame container window - - <p> - It depends from the type of the frame container window. If it is a system - task window all will be OK. Otherwise the title can't be set. - Setting/getting of the pure value of this property must be possible in every - case. Only showing on the UI can be fail. - </p> - */ - [property] string Title; - - /** provides access to the dispatch recorder of the frame - - <p> - Such recorder can be used to record dispatch requests. - The supplier contains a dispatch recorder and provide the functionality - to use it for any dispatch object from outside which supports the interface - <type>XDispatch</type>. A supplier is available only, if recording was enabled. - That means: if someone wishes to enable recoding on a frame he must set - a supplier with a recorder object inside of it. Every user of dispatches - has to check then if such supplier is available at this frame property. - If value of this property is <NULL/> he must call <member>XDispatch::dispatch()</member> - on the original dispatch object. If it's a valid value he must use the supplier - by calling his method <member>XDispatchRecorderSupplier::dispatchAndRecord()</member> - with the original dispatch object as argument. - </p> - - <p> - Note:<br> - It's not recommended to cache an already gotten supplier. Because there exist - no possibility to check for enabled/disabled recording then. - </p> - - @since OOo 1.1.2 - */ - [optional, property] XDispatchRecorderSupplier RecorderSupplier; - - /** provides access to the <type>LayoutManager</type> of the frame. - */ - [optional, property] com::sun::star::uno::XInterface LayoutManager; -}; +published service Frame : XFrame2; }; }; }; }; diff --git a/offapi/com/sun/star/frame/XFrame2.idl b/offapi/com/sun/star/frame/XFrame2.idl new file mode 100644 index 000000000000..d90d00b1e9b4 --- /dev/null +++ b/offapi/com/sun/star/frame/XFrame2.idl @@ -0,0 +1,145 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_frame_XFrame2_idl__ +#define __com_sun_star_frame_XFrame2_idl__ + +#include <com/sun/star/container/XNameContainer.idl> +#include <com/sun/star/frame/XDispatchInformationProvider.idl> +#include <com/sun/star/frame/XDispatchProvider.idl> +#include <com/sun/star/frame/XDispatchProviderInterception.idl> +#include <com/sun/star/frame/XDispatchRecorderSupplier.idl> +#include <com/sun/star/frame/XFramesSupplier.idl> +#include <com/sun/star/task/XStatusIndicatorFactory.idl> + + +module com { module sun { module star { module frame { + +/** + @since LibreOffice 4.1 + */ +published interface XFrame2 +{ + /** contains user defined attributes. + */ + [attribute, readonly] com::sun::star::container::XNameContainer UserDefinedAttributes; + + /** provides access to dispatchers for the frame. + + <p> + What kind of URLs a frame accepts in the calls to <member>XDispatchProvider::queryDispatch()</member>, + and how the returned dispatcher handles dispatches is completely implementation dependent + (though of course the restrictions of <type>XDispatchProvider</type> must be met). + Frame implementations may (optionally) support special targets in the call to + <member>XDispatchProvider::queryDispatch()</member>. + Such special targets are passed as target frame name. They may, in addition, + require special frame search flags (see <type>FrameSearchFlag</type>), or, + in opposite, limit the set of allowed flags.<br> + Common special targets include: + <ul> + <li><b>_blank</b><br> is used to create a new frame when dispatching the URL.</li> + <li><b>_default</b><br> is used to recycle empty or create a new frame when dispatching the URL.</li> + <li><b>_self</b><br> forces the frame to dispatch the URL into itself. ("" means the same)</li> + <li><b>_parent</b><br> dispatches the URL into the parent frame.</li> + <li><b>_top</b><br> dispatches the URL into the top level frame, the frame where this is invoked belongs to.</li> + </ul> + </p> + + @see XDispatch + @see XFrame::findFrame() + */ + interface XDispatchProvider; + + /** provides information about supported commands + + @since OOo 2.0 + */ + interface XDispatchInformationProvider; + + /** supports interception mechanism for dispatched URLs + + <p> + Registered objects can intercept, suppress or reroute dispatched URLs. + If they support another interface too (<type>XInterceptorInfo</type>) + it's possible to perform it by directly calling of right interceptor without + using list of all registered ones. + </p> + */ + interface XDispatchProviderInterception; + + /** Provides access to sub frames within this frame, + and via it's XFrame sub-interface: Allows the component to be loaded and accessed + within the frame; it is the main connection to the + environment of the component. + */ + interface XFramesSupplier; // -> XFrame + + /** supplies access to <type scope="com::sun::star::task">XStatusIndicator</type> objects + for the component within the frame to show progresses + */ + interface com::sun::star::task::XStatusIndicatorFactory; + + /** if possible it sets/gets the UI title on/from the frame container window + + <p> + It depends from the type of the frame container window. If it is a system + task window all will be OK. Otherwise the title can't be set. + Setting/getting of the pure value of this property must be possible in every + case. Only showing on the UI can be fail. + </p> + */ + [attribute] string Title; + + /** provides access to the dispatch recorder of the frame + + <p> + Such recorder can be used to record dispatch requests. + The supplier contains a dispatch recorder and provide the functionality + to use it for any dispatch object from outside which supports the interface + <type>XDispatch</type>. A supplier is available only, if recording was enabled. + That means: if someone wishes to enable recoding on a frame he must set + a supplier with a recorder object inside of it. Every user of dispatches + has to check then if such supplier is available at this frame property. + If value of this property is <NULL/> he must call <member>XDispatch::dispatch()</member> + on the original dispatch object. If it's a valid value he must use the supplier + by calling his method <member>XDispatchRecorderSupplier::dispatchAndRecord()</member> + with the original dispatch object as argument. + </p> + + <p> + Note:<br> + It's not recommended to cache an already gotten supplier. Because there exist + no possibility to check for enabled/disabled recording then. + </p> + + @since OOo 1.1.2 + */ + [attribute] XDispatchRecorderSupplier DispatchRecorderSupplier; + + /** Provides access to the <type>LayoutManager</type> of the frame. + This is actually of type XLayoutManager, but this API is still experimental (unpublished). + */ + [attribute] com::sun::star::uno::XInterface LayoutManager; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb Binary files differindex 86a07526106d..f43806a7a4f3 100644 --- a/offapi/type_reference/types.rdb +++ b/offapi/type_reference/types.rdb diff --git a/reportdesign/source/ui/inc/propbrw.hxx b/reportdesign/source/ui/inc/propbrw.hxx index 005d1d554a38..aae98d424d7e 100644 --- a/reportdesign/source/ui/inc/propbrw.hxx +++ b/reportdesign/source/ui/inc/propbrw.hxx @@ -20,10 +20,9 @@ #ifndef _REPORT_PROPBRW_HXX #define _REPORT_PROPBRW_HXX -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/inspection/XObjectInspector.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <svl/brdcst.hxx> @@ -48,9 +47,9 @@ private: OModuleClient m_aModuleClient; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xInspectorContext; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xORB; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xMeAsFrame; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspector > m_xBrowserController; @@ -87,7 +86,7 @@ protected: DECL_LINK( OnAsyncGetFocus, void* ); public: - PropBrw(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB + PropBrw(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB ,Window* pParent ,ODesignView* _pDesignView); virtual ~PropBrw(); diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 9d9ef89ea7c1..3ca115c83e62 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -460,7 +460,7 @@ void ODesignView::togglePropertyBrowser(sal_Bool _bToogleOn) { if ( !m_pPropWin && _bToogleOn ) { - m_pPropWin = new PropBrw(Reference<XMultiServiceFactory>(getController().getORB()->getServiceManager(), UNO_QUERY_THROW), m_pTaskPane,this); + m_pPropWin = new PropBrw(getController().getORB(), m_pTaskPane,this); m_pPropWin->Invalidate(); static_cast<OTaskWindow*>(m_pTaskPane)->setPropertyBrowser(m_pPropWin); notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::AddWindow)); diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index d7f4e22054dc..0b14f2a267cd 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -25,8 +25,13 @@ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <com/sun/star/awt/XLayoutConstrains.hpp> +#include <com/sun/star/awt/PosSize.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/inspection/ObjectInspector.hpp> #include <com/sun/star/inspection/DefaultHelpProvider.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/report/inspection/DefaultComponentInspectorModel.hpp> #include <svx/svxids.hrc> #include <vcl/stdtext.hxx> #include <svx/svdview.hxx> @@ -40,10 +45,6 @@ #include <comphelper/stl_types.hxx> #include <comphelper/types.hxx> #include <comphelper/sequence.hxx> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/report/inspection/DefaultComponentInspectorModel.hpp> #include <comphelper/processfactory.hxx> #include "SectionView.hxx" #include "ReportSection.hxx" @@ -92,7 +93,7 @@ DBG_NAME( rpt_PropBrw ) //---------------------------------------------------------------------------- -PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParent,ODesignView* _pDesignView) +PropBrw::PropBrw(const Reference< XComponentContext >& _xORB, Window* pParent, ODesignView* _pDesignView) :DockingWindow(pParent,WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_3DLOOK|WB_ROLLABLE)) ,m_xORB(_xORB) ,m_pDesignView(_pDesignView) @@ -107,12 +108,9 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen try { // create a frame wrapper for myself - m_xMeAsFrame = Reference< XFrame >(m_xORB->createInstance(OUString("com.sun.star.frame.Frame")), UNO_QUERY); - if (m_xMeAsFrame.is()) - { - m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); - m_xMeAsFrame->setName(OUString("report property browser")); // change name! - } + m_xMeAsFrame = Frame::create( m_xORB ); + m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); + m_xMeAsFrame->setName( OUString("report property browser") ); // change name! } catch (Exception&) { @@ -123,8 +121,6 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen if (m_xMeAsFrame.is()) { - Reference< XComponentContext > xOwnContext( - comphelper::getComponentContext( m_xORB ) ); try { ::cppu::ContextEntry_Init aHandlerContextInfo[] = @@ -135,9 +131,9 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen }; m_xInspectorContext.set( ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), - xOwnContext ) ); + m_xORB ) ); // create a property browser controller - bool bEnableHelpSection = lcl_shouldEnableHelpSection( xOwnContext ); + bool bEnableHelpSection = lcl_shouldEnableHelpSection( m_xORB ); Reference< inspection::XObjectInspectorModel> xInspectorModel( bEnableHelpSection ? report::inspection::DefaultComponentInspectorModel::createWithHelpSection( m_xInspectorContext, 3, 8 ) : report::inspection::DefaultComponentInspectorModel::createDefault( m_xInspectorContext ) ); @@ -150,7 +146,7 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen } else { - m_xBrowserController->attachFrame(m_xMeAsFrame); + m_xBrowserController->attachFrame( Reference<XFrame>(m_xMeAsFrame, UNO_QUERY_THROW)); m_xBrowserComponentWindow = m_xMeAsFrame->getComponentWindow(); OSL_ENSURE(m_xBrowserComponentWindow.is(), "PropBrw::PropBrw: attached the controller, but have no component window!"); if ( bEnableHelpSection ) diff --git a/sfx2/inc/sfx2/templateinfodlg.hxx b/sfx2/inc/sfx2/templateinfodlg.hxx index db5c11da0ac6..69d79b20da9a 100644 --- a/sfx2/inc/sfx2/templateinfodlg.hxx +++ b/sfx2/inc/sfx2/templateinfodlg.hxx @@ -18,7 +18,7 @@ namespace svtools { } namespace com{ namespace sun { namespace star { namespace awt { class XWindow; } } } } -namespace com{ namespace sun { namespace star { namespace frame { class XFrame; } } } } +namespace com{ namespace sun { namespace star { namespace frame { class XFrame2; } } } } class SfxTemplateInfoDlg : public ModalDialog { @@ -41,7 +41,7 @@ private: Window *mpPreviewView; // gets released when xWindows get destroyed (dont delete in constructor) svtools::ODocumentInfoPreview *mpInfoView; - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame; + ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > m_xFrame; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow; }; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index b75168c91ca9..5078c95e57e9 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -42,18 +42,13 @@ #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <com/sun/star/util/XModifiable.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/util/XCloseable.hpp> -#include <com/sun/star/util/CloseVetoException.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/beans/Property.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/XTitle.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/DispatchResultState.hpp> @@ -61,9 +56,11 @@ #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XDispatchProviderInterception.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/i18n/XBreakIterator.hpp> #include <com/sun/star/i18n/WordType.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/text/XText.hpp> @@ -78,9 +75,12 @@ #include <com/sun/star/util/XSearchDescriptor.hpp> #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> +#include <com/sun/star/util/XModifiable.hpp> +#include <com/sun/star/util/XCloseable.hpp> +#include <com/sun/star/util/CloseVetoException.hpp> +#include <com/sun/star/ui/XDockingAreaAcceptor.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> -#include <com/sun/star/ui/XDockingAreaAcceptor.hpp> #include <svtools/helpopt.hxx> #include <unotools/historyoptions.hxx> #include <svtools/menuoptions.hxx> @@ -1480,7 +1480,7 @@ void SfxHelpWindow_Impl::loadHelpContent(const OUString& sHelpURL, sal_Bool bAdd return; // If a print job runs do not open a new page - Reference< XFrame > xTextFrame = pTextWin->getFrame(); + Reference< XFrame2 > xTextFrame = pTextWin->getFrame(); Reference< XController > xTextController ; if (xTextFrame.is()) xTextController = xTextFrame->getController (); @@ -2004,12 +2004,11 @@ long TextWin_Impl::Notify( NotifyEvent& rNEvt ) // ----------------------------------------------------------------------- // remove docking area acceptor from layoutmanager, so it will not layout anything further .-) -static void lcl_disableLayoutOfFrame(const Reference< XFrame >& xFrame) +static void lcl_disableLayoutOfFrame(const Reference< XFrame2 >& xFrame) { static const OUString PROP_LAYOUT_MANAGER("LayoutManager"); - Reference< XPropertySet > xPropSet(xFrame, UNO_QUERY_THROW); - xPropSet->setPropertyValue(PROP_LAYOUT_MANAGER, makeAny(Reference< XLayoutManager >())); + xFrame->setLayoutManager( Reference< XLayoutManager >() ); } // class SfxHelpTextWindow_Impl ------------------------------------------ @@ -2037,8 +2036,7 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : { sfx2::AddToTaskPaneList( &aToolBox ); - xFrame = Reference < XFrame > ( ::comphelper::getProcessServiceFactory()->createInstance( - "com.sun.star.frame.Frame" ), UNO_QUERY ); + xFrame = Frame::create( ::comphelper::getProcessComponentContext() ); xFrame->initialize( VCLUnoHelper::GetInterface ( pTextWin ) ); xFrame->setName( "OFFICE_HELP" ); lcl_disableLayoutOfFrame(xFrame); @@ -2570,12 +2568,10 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu.InsertSeparator(); aMenu.InsertItem( TBI_SELECTIONMODE, SfxResId( STR_HELP_MENU_TEXT_SELECTION_MODE ).toString() ); aMenu.SetHelpId( TBI_SELECTIONMODE, HID_HELP_TEXT_SELECTION_MODE ); - Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); URL aURL; aURL.Complete = ".uno:SelectTextMode"; PARSE_URL( aURL ); - Reference < XDispatch > xDisp = xProv.is() ? - xProv->queryDispatch( aURL, OUString(), 0 ) : Reference < XDispatch >(); + Reference < XDispatch > xDisp = xFrame->queryDispatch( aURL, OUString(), 0 ); if(xDisp.is()) { HelpStatusListener_Impl* pStateListener; @@ -3148,7 +3144,7 @@ void SfxHelpWindow_Impl::openDone(const OUString& sURL , // ----------------------------------------------------------------------- SfxHelpWindow_Impl::SfxHelpWindow_Impl( - const ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >& rFrame, + const ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >& rFrame, Window* pParent, WinBits ) : SplitWindow( pParent, WB_3DLOOK | WB_NOSPLITDRAW ), @@ -3177,12 +3173,11 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl( pIndexWin->SetSelectFactoryHdl( LINK( this, SfxHelpWindow_Impl, SelectFactoryHdl ) ); pIndexWin->Show(); pTextWin = new SfxHelpTextWindow_Impl( this ); - Reference < XFramesSupplier > xSup( rFrame, UNO_QUERY ); - Reference < XFrames > xFrames = xSup->getFrames(); - xFrames->append( pTextWin->getFrame() ); + Reference < XFrames > xFrames = rFrame->getFrames(); + xFrames->append( Reference<XFrame>(pTextWin->getFrame(), UNO_QUERY_THROW) ); pTextWin->SetSelectHdl( LINK( this, SfxHelpWindow_Impl, SelectHdl ) ); pTextWin->Show(); - pHelpInterceptor->setInterception( pTextWin->getFrame() ); + pHelpInterceptor->setInterception( Reference<XFrame>(pTextWin->getFrame(), UNO_QUERY_THROW) ); pHelpListener->SetChangeHdl( LINK( this, SfxHelpWindow_Impl, ChangeHdl ) ); LoadConfig(); } diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index a3ed34e3ccb9..fe84268c9e64 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -23,10 +23,9 @@ #include <com/sun/star/uno/Reference.h> #include <com/sun/star/frame/XDispatchResultListener.hpp> #include <com/sun/star/frame/XDispatch.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> namespace com { namespace sun { namespace star { namespace awt { class XWindow; } } } } -namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } } namespace com { namespace sun { namespace star { namespace i18n { class XBreakIterator; } } } } namespace com { namespace sun { namespace star { namespace text { class XTextRange; } } } } @@ -445,7 +444,7 @@ private: SfxHelpWindow_Impl* pHelpWin; Window* pTextWin; sfx2::SearchDialog* pSrchDlg; - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > + ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > xFrame; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBreakIterator; @@ -483,7 +482,7 @@ public: virtual void GetFocus(); virtual void DataChanged( const DataChangedEvent& rDCEvt ); - inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > + inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > getFrame() const { return xFrame; } inline void SetSelectHdl( const Link& rLink ) { aToolBox.SetSelectHdl( rLink ); } @@ -508,7 +507,7 @@ friend class SfxHelpIndexWindow_Impl; xWindow; ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchResultListener > xOpenListener; - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > + ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > xFrame; SfxHelpIndexWindow_Impl* pIndexWin; @@ -543,7 +542,7 @@ friend class SfxHelpIndexWindow_Impl; DECL_LINK( ChangeHdl, HelpListener_Impl* ); public: - SfxHelpWindow_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >& rFrame, + SfxHelpWindow_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >& rFrame, Window* pParent, WinBits nBits ); ~SfxHelpWindow_Impl(); @@ -551,7 +550,7 @@ public: void setContainerWindow( ::com::sun::star::uno::Reference < ::com::sun::star::awt::XWindow > xWin ); - inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > + inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > getTextFrame() const { return pTextWin->getFrame(); } inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchResultListener > getOpenListener() const { return xOpenListener; } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 297e356a943f..d37f618aef3f 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -23,7 +23,7 @@ #include <algorithm> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/frame/Desktop.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <comphelper/processfactory.hxx> @@ -526,15 +526,15 @@ OUString SfxHelp::CreateHelpURL_Impl( const OUString& aCommandURL, const OUStrin return aHelpURL.makeStringAndClear(); } -SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , +SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , Reference< XFrame >& rHelpContent) { Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); // otherwise - create new help task - Reference< XFrame > xHelpTask = xDesktop->findFrame( - OUString("OFFICE_HELP_TASK"), - FrameSearchFlag::TASKS | FrameSearchFlag::CREATE); + Reference< XFrame2 > xHelpTask( + xDesktop->findFrame( "OFFICE_HELP_TASK", FrameSearchFlag::TASKS | FrameSearchFlag::CREATE), + UNO_QUERY_THROW); if (!xHelpTask.is()) return 0; @@ -753,9 +753,9 @@ sal_Bool SfxHelp::Start_Impl(const OUString& rURL, const Window* pWindow, const // check if help window is still open // If not, create a new one and return access directly to the internal sub frame showing the help content // search must be done here; search one desktop level could return an arbitraty frame - Reference< XFrame > xHelp = xDesktop->findFrame( - OUString("OFFICE_HELP_TASK"), - FrameSearchFlag::CHILDREN); + Reference< XFrame2 > xHelp( + xDesktop->findFrame( "OFFICE_HELP_TASK", FrameSearchFlag::CHILDREN), + UNO_QUERY_THROW); Reference< XFrame > xHelpContent = xDesktop->findFrame( OUString("OFFICE_HELP"), FrameSearchFlag::CHILDREN); diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx index 4530ecf3b3e2..fb0058f9cb22 100644 --- a/sfx2/source/dialog/partwnd.cxx +++ b/sfx2/source/dialog/partwnd.cxx @@ -18,19 +18,19 @@ */ #include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/awt/PosSize.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/Frame.hpp> +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/util/URL.hpp> -#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/util/CloseVetoException.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/DisposedException.hpp> -#include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/awt/PosSize.hpp> #include <comphelper/processfactory.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -105,40 +105,32 @@ SfxPartDockWnd_Impl::SfxPartDockWnd_Impl ) : SfxDockingWindow( pBind, pChildWin, pParent, nBits ) { - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame( - ::comphelper::getProcessServiceFactory()->createInstance( - "com.sun.star.frame.Frame" ), ::com::sun::star::uno::UNO_QUERY ); + css::uno::Reference < css::frame::XFrame2 > xFrame = css::frame::Frame::create( + ::comphelper::getProcessComponentContext() ); xFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet( - xFrame, ::com::sun::star::uno::UNO_QUERY ); try { - const OUString aLayoutManager( "LayoutManager" ); - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xLMPropSet; + css::uno::Reference< css::beans::XPropertySet > xLMPropSet( xFrame->getLayoutManager(), css::uno::UNO_QUERY_THROW ); - ::com::sun::star::uno::Any a = xPropSet->getPropertyValue( aLayoutManager ); - if ( a >>= xLMPropSet ) - { - const OUString aAutomaticToolbars( "AutomaticToolbars" ); - xLMPropSet->setPropertyValue( aAutomaticToolbars, ::com::sun::star::uno::Any( sal_False )); - } + const OUString aAutomaticToolbars( "AutomaticToolbars" ); + xLMPropSet->setPropertyValue( aAutomaticToolbars, css::uno::Any( sal_False )); } - catch( ::com::sun::star::uno::RuntimeException& ) + catch( css::uno::RuntimeException& ) { throw; } - catch( ::com::sun::star::uno::Exception& ) + catch( css::uno::Exception& ) { } - pChildWin->SetFrame( xFrame ); + pChildWin->SetFrame( css::uno::Reference<css::frame::XFrame>(xFrame,css::uno::UNO_QUERY_THROW) ); if ( pBind->GetDispatcher() ) { - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFramesSupplier > - xSupp ( pBind->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); + css::uno::Reference < css::frame::XFramesSupplier > + xSupp ( pBind->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), css::uno::UNO_QUERY ); if ( xSupp.is() ) - xSupp->getFrames()->append( xFrame ); + xSupp->getFrames()->append( css::uno::Reference<css::frame::XFrame>(xFrame, css::uno::UNO_QUERY_THROW) ); } else { OSL_FAIL("Bindings without Dispatcher!"); diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx index 32fa7d89f6d1..9437f3308e11 100644 --- a/sfx2/source/dialog/templateinfodlg.cxx +++ b/sfx2/source/dialog/templateinfodlg.cxx @@ -17,7 +17,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/document/DocumentProperties.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/util/URL.hpp> @@ -53,8 +53,8 @@ SfxTemplateInfoDlg::SfxTemplateInfoDlg (Window *pParent) xWindow = VCLUnoHelper::GetInterface(mpPreviewView); - xFrame.set(comphelper::getProcessServiceFactory()->createInstance("com.sun.star.frame.Frame"), uno::UNO_QUERY ); - xFrame->initialize( xWindow ); + m_xFrame = Frame::create( comphelper::getProcessComponentContext() ); + m_xFrame->initialize( xWindow ); mpPreviewView->Show(); mpInfoView->Show(); @@ -62,7 +62,7 @@ SfxTemplateInfoDlg::SfxTemplateInfoDlg (Window *pParent) SfxTemplateInfoDlg::~SfxTemplateInfoDlg() { - xFrame->dispose(); + m_xFrame->dispose(); delete mpInfoView; } @@ -97,10 +97,7 @@ void SfxTemplateInfoDlg::loadDocument(const OUString &rURL) aURL.Complete = rURL; xTrans->parseStrict(aURL); - uno::Reference<frame::XDispatchProvider> xProv( xFrame, uno::UNO_QUERY ); - - uno::Reference<frame::XDispatch> xDisp = xProv.is() ? - xProv->queryDispatch( aURL, "_self", 0 ) : uno::Reference<XDispatch>(); + uno::Reference<frame::XDispatch> xDisp = m_xFrame->queryDispatch( aURL, "_self", 0 ); if ( xDisp.is() ) { diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index a93d5bc301dc..d43d3383e3fe 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -23,7 +23,7 @@ #include <sfx2/sfxsids.hrc> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XDispatch.hpp> -#include <com/sun/star/frame/XFramesSupplier.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> @@ -42,7 +42,7 @@ namespace sfx2 class IFrameWindow_Impl : public Window { - uno::Reference < frame::XFrame > mxFrame; + uno::Reference < frame::XFrame2 > mxFrame; sal_Bool bBorder; public: @@ -92,11 +92,11 @@ const SfxItemPropertyMapEntry* lcl_GetIFramePropertyMap_Impl() return aIFramePropertyMap_Impl; } -SFX_IMPL_XSERVICEINFO( IFrameObject, "com.sun.star.embed.SpecialEmbeddedObject", "com.sun.star.comp.sfx2.IFrameObject" ) +SFX_IMPL_XSERVICEINFO_CTX( IFrameObject, "com.sun.star.embed.SpecialEmbeddedObject", "com.sun.star.comp.sfx2.IFrameObject" ) SFX_IMPL_SINGLEFACTORY( IFrameObject ); -IFrameObject::IFrameObject( const uno::Reference < lang::XMultiServiceFactory >& rFact ) - : mxFact( rFact ) +IFrameObject::IFrameObject( const uno::Reference < uno::XComponentContext >& rxContext ) + : mxContext( rxContext ) , maPropMap( lcl_GetIFramePropertyMap_Impl() ) { } @@ -132,7 +132,7 @@ throw( uno::RuntimeException ) // we must destroy the IFrame before the parent is destroyed xWindow->addEventListener( this ); - mxFrame = uno::Reference< frame::XFrame >( mxFact->createInstance( "com.sun.star.frame.Frame" ),uno::UNO_QUERY ); + mxFrame = frame::Frame::create( mxContext ); uno::Reference < awt::XWindow > xWin( pWin->GetComponentInterface(), uno::UNO_QUERY ); mxFrame->initialize( xWin ); mxFrame->setName( maFrmDescr.GetName() ); @@ -141,11 +141,9 @@ throw( uno::RuntimeException ) if ( xFramesSupplier.is() ) mxFrame->setCreator( xFramesSupplier ); - uno::Reference< frame::XDispatchProvider > xProv( mxFrame, uno::UNO_QUERY ); - util::URL aTargetURL; aTargetURL.Complete = OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); - uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getComponentContext(mxFact) ) ); + uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) ); xTrans->parseStrict( aTargetURL ); uno::Sequence < beans::PropertyValue > aProps(2); @@ -153,7 +151,7 @@ throw( uno::RuntimeException ) aProps[0].Value <<= (sal_Int16) 2; aProps[1].Name = "ReadOnly"; aProps[1].Value <<= (sal_Bool) sal_True; - uno::Reference < frame::XDispatch > xDisp = xProv->queryDispatch( aTargetURL, "_self", 0 ); + uno::Reference < frame::XDispatch > xDisp = mxFrame->queryDispatch( aTargetURL, "_self", 0 ); if ( xDisp.is() ) xDisp->dispatch( aTargetURL, aProps ); diff --git a/sfx2/source/inc/iframe.hxx b/sfx2/source/inc/iframe.hxx index 0dfc1c3c5a53..965550de57bf 100644 --- a/sfx2/source/inc/iframe.hxx +++ b/sfx2/source/inc/iframe.hxx @@ -26,9 +26,8 @@ #include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/frame/XSynchronousFrameLoader.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <cppuhelper/implbase6.hxx> @@ -51,13 +50,13 @@ class IFrameObject : public ::cppu::WeakImplHelper6 < com::sun::star::lang::XInitialization, com::sun::star::beans::XPropertySet > { - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > mxFact; - com::sun::star::uno::Reference < com::sun::star::frame::XFrame > mxFrame; + com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > mxContext; + com::sun::star::uno::Reference < com::sun::star::frame::XFrame2 > mxFrame; com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > mxObj; SfxItemPropertyMap maPropMap; SfxFrameDescriptor maFrmDescr; - IFrameObject( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rFact ); + IFrameObject( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext>& rxContext ); ~IFrameObject(); virtual sal_Bool SAL_CALL load( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& lDescriptor, diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 8d3507f468ef..c3a2a50cdd4d 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> @@ -246,11 +246,11 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, sal_uInt16 nV // create and initialize new top level frame for this window Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference < XDesktop2 > xDesktop = Desktop::create( xContext ); - Reference < XFrame > xFrame( xContext->getServiceManager()->createInstanceWithContext("com.sun.star.frame.Frame", xContext), UNO_QUERY_THROW ); + Reference < XFrame2 > xFrame = Frame::create( xContext ); Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW ); xFrame->initialize( xWin.get() ); - xDesktop->getFrames()->append( xFrame ); + xDesktop->getFrames()->append( Reference<XFrame>(xFrame, uno::UNO_QUERY_THROW) ); if ( xWin->isActive() ) xFrame->activate(); diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx b/slideshow/source/engine/shapes/viewappletshape.cxx index 0d6dbe0f1109..87175eeb3d8a 100644 --- a/slideshow/source/engine/shapes/viewappletshape.cxx +++ b/slideshow/source/engine/shapes/viewappletshape.cxx @@ -47,7 +47,7 @@ #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/VclWindowPeerAttribute.hpp> #include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/frame/XSynchronousFrameLoader.hpp> #include "viewappletshape.hxx" @@ -170,18 +170,13 @@ namespace slideshow // create a frame, and load the applet into it // =========================================== - mxFrame.set( - xFactory->createInstanceWithContext( - OUString("com.sun.star.frame.Frame" ), - mxComponentContext ), - uno::UNO_QUERY_THROW ); - + mxFrame = frame::Frame::create( mxComponentContext ); mxFrame->initialize( xOwnWindow ); uno::Reference < frame::XSynchronousFrameLoader > xLoader( mxViewer, uno::UNO_QUERY_THROW ); xLoader->load( uno::Sequence < beans::PropertyValue >(), - mxFrame ); + uno::Reference<frame::XFrame>(mxFrame, uno::UNO_QUERY_THROW) ); // resize surrounding window and applet to current shape size diff --git a/slideshow/source/engine/shapes/viewappletshape.hxx b/slideshow/source/engine/shapes/viewappletshape.hxx index 92514d942f36..d852ebd9ef76 100644 --- a/slideshow/source/engine/shapes/viewappletshape.hxx +++ b/slideshow/source/engine/shapes/viewappletshape.hxx @@ -31,7 +31,7 @@ namespace com { namespace sun { namespace star { namespace frame { class XSynchronousFrameLoader; - class XFrame; + class XFrame2; } namespace uno { class XComponentContext; @@ -148,7 +148,7 @@ namespace slideshow /// the frame containing the applet ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XFrame> mxFrame; + ::com::sun::star::frame::XFrame2> mxFrame; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> mxComponentContext; }; diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 793485cbf84f..a682b86fdc45 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -39,7 +39,7 @@ #include "unotools/configmgr.hxx" #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/util/URL.hpp> #include <com/sun/star/util/URLTransformer.hpp> @@ -595,21 +595,18 @@ OUString SvtDocInfoTable_Impl::GetString( long nId ) const // class SvtFrameWindow_Impl --------------------------------------------- -SvtFrameWindow_Impl::SvtFrameWindow_Impl( Window* pParent ) : - - Window( pParent ) - +SvtFrameWindow_Impl::SvtFrameWindow_Impl( Window* pParent ) + : Window( pParent ) { // detect application language - aLocale= SvtPathOptions().GetLocale(); + aLocale = SvtPathOptions().GetLocale(); // create windows and frame pEditWin = new ODocumentInfoPreview( this ,WB_LEFT | WB_VSCROLL | WB_READONLY | WB_BORDER | WB_3DLOOK); pTextWin = new Window( this ); - xFrame = Reference < XFrame > ( ::comphelper::getProcessServiceFactory()-> - createInstance( "com.sun.star.frame.Frame" ), UNO_QUERY ); + m_xFrame = Frame::create( ::comphelper::getProcessComponentContext() ); xWindow = VCLUnoHelper::GetInterface( pTextWin ); - xFrame->initialize( xWindow ); + m_xFrame->initialize( xWindow ); // create docinfo instance m_xDocProps.set( document::DocumentProperties::create(::comphelper::getProcessComponentContext()) ); @@ -621,7 +618,7 @@ SvtFrameWindow_Impl::~SvtFrameWindow_Impl() { delete pEditWin; delete pEmptyWin; - xFrame->dispose(); + m_xFrame->dispose(); } void SvtFrameWindow_Impl::ViewEditWin() @@ -693,7 +690,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B if ( rURL.Len() == 0 ) { - xFrame->setComponent( Reference < com::sun::star::awt::XWindow >(), Reference < XController >() ); + m_xFrame->setComponent( Reference < com::sun::star::awt::XWindow >(), Reference < XController >() ); ViewEmptyWin(); } else if ( !::utl::UCBContentHelper::IsFolder( rURL ) ) @@ -705,7 +702,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B xTrans->parseStrict( aURL ); String aTarget; - Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); + Reference < XDispatchProvider > xProv( m_xFrame, UNO_QUERY_THROW ); if ( bPreview ) aTarget = "_self"; else @@ -752,8 +749,8 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B aArgs[2].Value.setValue( &b, ::getBooleanCppuType() ); xDisp->dispatch( aURL, aArgs ); - OUString aDispURL; - Reference< ::com::sun::star::frame::XController > xCtrl = xFrame->getController(); + OUString aDispURL; + Reference< ::com::sun::star::frame::XController > xCtrl = m_xFrame->getController(); if( xCtrl.is() ) { Reference< ::com::sun::star::frame::XModel > xMdl = xCtrl->getModel(); @@ -763,7 +760,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B if( aDispURL != aURL.Complete ) { - xFrame->setComponent( Reference < com::sun::star::awt::XWindow >(), Reference < XController >() ); + m_xFrame->setComponent( Reference < com::sun::star::awt::XWindow >(), Reference < XController >() ); ViewEmptyWin(); m_aOpenURL = OUString(); } diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx index 6de3ba541d1d..3d2240c32072 100644 --- a/svtools/source/contnr/templwin.hxx +++ b/svtools/source/contnr/templwin.hxx @@ -32,7 +32,7 @@ #include <com/sun/star/lang/Locale.hpp> namespace com{ namespace sun { namespace star { namespace awt { class XWindow; } } } } -namespace com{ namespace sun { namespace star { namespace frame { class XFrame; } } } } +namespace com{ namespace sun { namespace star { namespace frame { class XFrame2; } } } } namespace com{ namespace sun { namespace star { namespace document { class XDocumentProperties; } } } } @@ -167,8 +167,8 @@ public: class SvtFrameWindow_Impl : public Window { private: - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > - xFrame; + ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > + m_xFrame; ::com::sun::star::uno::Reference < ::com::sun::star::document::XDocumentProperties> m_xDocProps; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index c18e01056a25..e62eb9776fb3 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -35,16 +35,17 @@ #include "svx/svdpagv.hxx" #include "svx/svxids.hrc" -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/form/XForm.hpp> -#include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/awt/XLayoutConstrains.hpp> #include <com/sun/star/awt/XControlContainer.hpp> +#include <com/sun/star/awt/PosSize.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/form/XForm.hpp> +#include <com/sun/star/form/FormComponentType.hpp> +#include <com/sun/star/form/inspection/DefaultFormComponentInspectorModel.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/inspection/ObjectInspector.hpp> #include <com/sun/star/inspection/ObjectInspectorModel.hpp> -#include <com/sun/star/form/inspection/DefaultFormComponentInspectorModel.hpp> #include <com/sun/star/inspection/XObjectInspectorUI.hpp> #include <com/sun/star/inspection/DefaultHelpProvider.hpp> @@ -85,7 +86,7 @@ FmPropBrwMgr::FmPropBrwMgr( Window* _pParent, sal_uInt16 _nId, SfxBindings* _pBindings, SfxChildWinInfo* _pInfo) :SfxChildWindow(_pParent, _nId) { - pWindow = new FmPropBrw( ::comphelper::getProcessServiceFactory(), _pBindings, this, _pParent, _pInfo ); + pWindow = new FmPropBrw( ::comphelper::getProcessComponentContext(), _pBindings, this, _pParent, _pInfo ); eChildAlignment = SFX_ALIGN_NOALIGNMENT; ((SfxFloatingWindow*)pWindow)->Initialize( _pInfo ); } @@ -190,7 +191,7 @@ OUString GetUIHeadlineName(sal_Int16 nClassId, const Any& aUnoObj) //======================================================================== DBG_NAME(FmPropBrw); //------------------------------------------------------------------------ -FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBindings* _pBindings, +FmPropBrw::FmPropBrw( const Reference< XComponentContext >& _xORB, SfxBindings* _pBindings, SfxChildWindow* _pMgr, Window* _pParent, const SfxChildWinInfo* _pInfo ) :SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_3DLOOK|WB_ROLLABLE) ) ,SfxControllerItem(SID_FM_PROPERTY_CONTROL, *_pBindings) @@ -208,30 +209,19 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding try { // create a frame wrapper for myself - m_xMeAsFrame = Reference< XFrame >(m_xORB->createInstance(OUString("com.sun.star.frame.Frame") ), UNO_QUERY); - if (m_xMeAsFrame.is()) - { - // create an intermediate window, which is to be the container window of the frame - // Do *not* use |this| as container window for the frame, this would result in undefined - // responsibility for this window (as soon as we initialize a frame with a window, the frame - // is responsible for it's life time, but |this| is controlled by the belonging SfxChildWindow) - // #i34249# - Window* pContainerWindow = new Window( this ); - pContainerWindow->Show(); - m_xFrameContainerWindow = VCLUnoHelper::GetInterface ( pContainerWindow ); - - m_xMeAsFrame->initialize( m_xFrameContainerWindow ); - m_xMeAsFrame->setName(OUString("form property browser") ); - if ( _pBindings->GetDispatcher() ) - { - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFramesSupplier > - xSupp ( _pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); -// if ( xSupp.is() ) -// xSupp->getFrames()->append( m_xMeAsFrame ); - // Don't append frame to frame hierachy to prevent UI_DEACTIVATE messages - // #i31834# - } - } + m_xMeAsFrame = Frame::create(m_xORB); + + // create an intermediate window, which is to be the container window of the frame + // Do *not* use |this| as container window for the frame, this would result in undefined + // responsibility for this window (as soon as we initialize a frame with a window, the frame + // is responsible for it's life time, but |this| is controlled by the belonging SfxChildWindow) + // #i34249# + Window* pContainerWindow = new Window( this ); + pContainerWindow->Show(); + m_xFrameContainerWindow = VCLUnoHelper::GetInterface ( pContainerWindow ); + + m_xMeAsFrame->initialize( m_xFrameContainerWindow ); + m_xMeAsFrame->setName( OUString("form property browser") ); } catch (Exception&) { @@ -240,7 +230,7 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding } if (m_xMeAsFrame.is()) - _pMgr->SetFrame( m_xMeAsFrame ); + _pMgr->SetFrame( Reference<XFrame>(m_xMeAsFrame,UNO_QUERY_THROW) ); if ( m_xBrowserComponentWindow.is() ) @@ -558,8 +548,6 @@ void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell ) xControlMap = pFormPage->GetImpl().getControlToShapeMap(); // our own component context - Reference< XComponentContext > xOwnContext( - comphelper::getComponentContext( m_xORB ) ); // a ComponentContext for the ::cppu::ContextEntry_Init aHandlerContextInfo[] = @@ -571,9 +559,9 @@ void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell ) }; m_xInspectorContext.set( ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), - xOwnContext ) ); + m_xORB ) ); - bool bEnableHelpSection = lcl_shouldEnableHelpSection( xOwnContext ); + bool bEnableHelpSection = lcl_shouldEnableHelpSection( m_xORB ); // an object inspector model m_xInspectorModel = @@ -594,7 +582,7 @@ void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell ) } else { - m_xBrowserController->attachFrame( m_xMeAsFrame ); + m_xBrowserController->attachFrame( Reference<XFrame>(m_xMeAsFrame,UNO_QUERY_THROW) ); m_xBrowserComponentWindow = m_xMeAsFrame->getComponentWindow(); DBG_ASSERT( m_xBrowserComponentWindow.is(), "FmPropBrw::impl_createPropertyBrowser_throw: attached the controller, but have no component window!" ); } diff --git a/svx/source/inc/fmPropBrw.hxx b/svx/source/inc/fmPropBrw.hxx index 50ef095c47aa..6cc7fd81743c 100644 --- a/svx/source/inc/fmPropBrw.hxx +++ b/svx/source/inc/fmPropBrw.hxx @@ -19,9 +19,8 @@ #ifndef SVX_FMPROPBRW_HXX #define SVX_FMPROPBRW_HXX -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/inspection/XObjectInspectorModel.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -48,9 +47,9 @@ class FmPropBrw : public SfxFloatingWindow, public SfxControllerItem OUString m_sLastActivePage; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xInspectorContext; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xORB; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xMeAsFrame; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xLastKnownDocument; @@ -77,7 +76,7 @@ protected: public: FmPropBrw( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB, SfxBindings* pBindings, SfxChildWindow* pMgr, Window* pParent, diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx index e150f8912c4c..f9d2dafe17c7 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx @@ -20,9 +20,7 @@ #include <swtypes.hxx> #include <dbtablepreviewdialog.hxx> #include <comphelper/processfactory.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <toolkit/unohlp.hxx> #include <dbui.hrc> @@ -67,13 +65,8 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b try { // create a frame wrapper for myself - uno::Reference< lang::XMultiServiceFactory > - xMgr = comphelper::getProcessServiceFactory(); - m_xFrame = uno::Reference< frame::XFrame >(xMgr->createInstance("com.sun.star.frame.Frame"), uno::UNO_QUERY); - if(m_xFrame.is()) - { - m_xFrame->initialize( VCLUnoHelper::GetInterface ( m_pBeamerWIN ) ); - } + m_xFrame = frame::Frame::create( comphelper::getProcessComponentContext() ); + m_xFrame->initialize( VCLUnoHelper::GetInterface( m_pBeamerWIN ) ); } catch (uno::Exception const &) { @@ -81,10 +74,9 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b } if(m_xFrame.is()) { - uno::Reference<frame::XDispatchProvider> xDP(m_xFrame, uno::UNO_QUERY); util::URL aURL; aURL.Complete = ".component:DB/DataSourceBrowser"; - uno::Reference<frame::XDispatch> xD = xDP->queryDispatch(aURL, "", 0x0C); + uno::Reference<frame::XDispatch> xD = m_xFrame->queryDispatch(aURL, "", 0x0C); if(xD.is()) { xD->dispatch(aURL, rValues); diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.hxx b/sw/source/ui/dbui/dbtablepreviewdialog.hxx index 5d58ef83a9fe..826a9fd78604 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.hxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.hxx @@ -26,7 +26,7 @@ namespace com{ namespace sun{ namespace star{ namespace beans{ struct PropertyValue; } - namespace frame{ class XFrame; } + namespace frame{ class XFrame2; } }}} class SwDBTablePreviewDialog : public SfxModalDialog @@ -35,7 +35,7 @@ class SwDBTablePreviewDialog : public SfxModalDialog Window* m_pBeamerWIN; OKButton m_aOK; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xFrame; public: SwDBTablePreviewDialog(Window* pParent, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rValues ); diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index d6c235048c78..077ad274273d 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -42,19 +42,20 @@ #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> #include <comphelper/sequenceashashmap.hxx> -#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/container/XContainerQuery.hpp> +#include <com/sun/star/container/XEnumeration.hpp> +#include <com/sun/star/form/runtime/XFormController.hpp> +#include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbcx/XRowLocate.hpp> #include <com/sun/star/sdb/XResultSetAccess.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> +#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <toolkit/unohlp.hxx> #include <comphelper/processfactory.hxx> -#include <com/sun/star/form/runtime/XFormController.hpp> #include <cppuhelper/implbase1.hxx> -#include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/container/XContainerQuery.hpp> -#include <com/sun/star/container/XEnumeration.hpp> #include <unomid.h> @@ -267,24 +268,17 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, try { // create a frame wrapper for myself - uno::Reference< XMultiServiceFactory > - xMgr = comphelper::getProcessServiceFactory(); - xFrame = uno::Reference< XFrame >(xMgr->createInstance("com.sun.star.frame.Frame"), UNO_QUERY); - if(xFrame.is()) - { - xFrame->initialize( VCLUnoHelper::GetInterface ( pBeamerWin ) ); - } + m_xFrame = frame::Frame::create( comphelper::getProcessComponentContext() ); } catch (const Exception&) { - xFrame.clear(); + m_xFrame.clear(); } - if(xFrame.is()) + if(m_xFrame.is()) { - uno::Reference<XDispatchProvider> xDP(xFrame, UNO_QUERY); URL aURL; aURL.Complete = ".component:DB/DataSourceBrowser"; - uno::Reference<XDispatch> xD = xDP->queryDispatch(aURL, + uno::Reference<XDispatch> xD = m_xFrame->queryDispatch(aURL, "", 0x0C); if(xD.is()) @@ -300,7 +294,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, xD->dispatch(aURL, aProperties); pBeamerWin->Show(); } - uno::Reference<XController> xController = xFrame->getController(); + uno::Reference<XController> xController = m_xFrame->getController(); pImpl->xFController = uno::Reference<runtime::XFormController>(xController, UNO_QUERY); if(pImpl->xFController.is()) { @@ -452,10 +446,10 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, SwMailMergeDlg::~SwMailMergeDlg() { - if(xFrame.is()) + if(m_xFrame.is()) { - xFrame->setComponent(NULL, NULL); - xFrame->dispose(); + m_xFrame->setComponent(NULL, NULL); + m_xFrame->dispose(); } else delete pBeamerWin; diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx index e170af00f748..e3ebd534ac3c 100644 --- a/sw/source/ui/inc/mailmrge.hxx +++ b/sw/source/ui/inc/mailmrge.hxx @@ -39,7 +39,7 @@ class SwXSelChgLstnr_Impl; struct SwMailMergeDlg_Impl; namespace com{namespace sun{namespace star{ namespace frame{ - class XFrame; + class XFrame2; } namespace sdbc{ class XResultSet; @@ -110,7 +110,7 @@ class SwMailMergeDlg : public SvxStandardDialog sal_uInt16 nMergeType; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aSelection; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xFrame; Size m_aDialogSize; OUString m_sSaveFilter; |