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 /UnoControls | |
parent | c68b934cd03e60ab6e0579108089b0e834ac47ad (diff) |
fdo#46808, Convert frame::Frame to new style
Change-Id: I74427d1e0059808f04960c648b93245b06c20f7f
Diffstat (limited to 'UnoControls')
-rw-r--r-- | UnoControls/source/controls/framecontrol.cxx | 54 | ||||
-rw-r--r-- | UnoControls/source/inc/framecontrol.hxx | 4 |
2 files changed, 27 insertions, 31 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 ; |