summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-03-22 09:24:15 +0200
committerNoel Grandin <noel@peralex.com>2013-04-08 13:53:04 +0200
commitb248624126c271c88381d3dad6e04fc954f65779 (patch)
tree989f9131b865ea470ced1317834b91de06efd9e4 /sfx2
parentc68b934cd03e60ab6e0579108089b0e834ac47ad (diff)
fdo#46808, Convert frame::Frame to new style
Change-Id: I74427d1e0059808f04960c648b93245b06c20f7f
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/templateinfodlg.hxx4
-rw-r--r--sfx2/source/appl/newhelp.cxx39
-rw-r--r--sfx2/source/appl/newhelp.hxx13
-rw-r--r--sfx2/source/appl/sfxhelp.cxx16
-rw-r--r--sfx2/source/dialog/partwnd.cxx44
-rw-r--r--sfx2/source/dialog/templateinfodlg.cxx13
-rw-r--r--sfx2/source/doc/iframe.cxx18
-rw-r--r--sfx2/source/inc/iframe.hxx9
-rw-r--r--sfx2/source/view/frame2.cxx6
9 files changed, 71 insertions, 91 deletions
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();