Kaydet (Commit) 42adbfcc authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Adapt embed::HatchWindowFactory UNO service to new style

The service already existed, it just did not have an IDL file.

Change-Id: If00396effd92ed72ea942da5eb1fe60b6380c665
üst 9c634c95
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <cppuhelper/typeprovider.hxx> #include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/interfacecontainer.h> #include <cppuhelper/interfacecontainer.h>
#include <comphelper/mimeconfighelper.hxx> #include <comphelper/mimeconfighelper.hxx>
#include <comphelper/processfactory.hxx>
#include "closepreventer.hxx" #include "closepreventer.hxx"
#include "intercept.hxx" #include "intercept.hxx"
...@@ -98,7 +99,7 @@ void OCommonEmbeddedObject::CommonInit_Impl( const uno::Sequence< beans::NamedVa ...@@ -98,7 +99,7 @@ void OCommonEmbeddedObject::CommonInit_Impl( const uno::Sequence< beans::NamedVa
if ( !m_xFactory.is() ) if ( !m_xFactory.is() )
throw uno::RuntimeException(); throw uno::RuntimeException();
m_pDocHolder = new DocumentHolder( m_xFactory, this ); m_pDocHolder = new DocumentHolder( comphelper::getComponentContext(m_xFactory), this );
m_pDocHolder->acquire(); m_pDocHolder->acquire();
// parse configuration entries // parse configuration entries
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include <com/sun/star/bridge/XBridgeSupplier2.hpp> #include <com/sun/star/bridge/XBridgeSupplier2.hpp>
#include <com/sun/star/bridge/ModelDependent.hpp> #include <com/sun/star/bridge/ModelDependent.hpp>
#include <com/sun/star/embed/XHatchWindow.hpp> #include <com/sun/star/embed/XHatchWindow.hpp>
#include <com/sun/star/embed/XHatchWindowFactory.hpp> #include <com/sun/star/embed/HatchWindowFactory.hpp>
#include <com/sun/star/embed/XInplaceClient.hpp> #include <com/sun/star/embed/XInplaceClient.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XMenuBarMergingAcceptor.hpp> #include <com/sun/star/frame/XMenuBarMergingAcceptor.hpp>
...@@ -150,11 +150,11 @@ static void InsertMenu_Impl( const uno::Reference< container::XIndexContainer >& ...@@ -150,11 +150,11 @@ static void InsertMenu_Impl( const uno::Reference< container::XIndexContainer >&
} }
//=========================================================================== //===========================================================================
DocumentHolder::DocumentHolder( const uno::Reference< lang::XMultiServiceFactory >& xFactory, DocumentHolder::DocumentHolder( const uno::Reference< uno::XComponentContext >& xContext,
OCommonEmbeddedObject* pEmbObj ) OCommonEmbeddedObject* pEmbObj )
: m_pEmbedObj( pEmbObj ), : m_pEmbedObj( pEmbObj ),
m_pInterceptor( NULL ), m_pInterceptor( NULL ),
m_xFactory( xFactory ), m_xContext( xContext ),
m_bReadOnly( sal_False ), m_bReadOnly( sal_False ),
m_bWaitForClose( sal_False ), m_bWaitForClose( sal_False ),
m_bAllowClosing( sal_False ), m_bAllowClosing( sal_False ),
...@@ -173,7 +173,7 @@ DocumentHolder::DocumentHolder( const uno::Reference< lang::XMultiServiceFactory ...@@ -173,7 +173,7 @@ DocumentHolder::DocumentHolder( const uno::Reference< lang::XMultiServiceFactory
aArg.Value <<= sal_False; aArg.Value <<= sal_False;
m_aOutplaceFrameProps[1] <<= aArg; m_aOutplaceFrameProps[1] <<= aArg;
uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( comphelper::getComponentContext(m_xFactory) ); uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( m_xContext );
m_refCount++; m_refCount++;
try try
{ {
...@@ -247,7 +247,7 @@ void DocumentHolder::CloseFrame() ...@@ -247,7 +247,7 @@ void DocumentHolder::CloseFrame()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void DocumentHolder::FreeOffice() void DocumentHolder::FreeOffice()
{ {
uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( comphelper::getComponentContext(m_xFactory) ); uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( m_xContext );
xDesktop->removeTerminateListener( this ); xDesktop->removeTerminateListener( this );
// the following code is commented out since for now there is still no completely correct way to detect // the following code is commented out since for now there is still no completely correct way to detect
...@@ -410,13 +410,8 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& ...@@ -410,13 +410,8 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >&
if ( xModel.is() ) if ( xModel.is() )
{ {
uno::Reference< embed::XHatchWindowFactory > xHatchFactory( uno::Reference< embed::XHatchWindowFactory > xHatchFactory =
m_xFactory->createInstance( embed::HatchWindowFactory::create(m_xContext);
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.HatchWindowFactory" )) ),
uno::UNO_QUERY );
if ( !xHatchFactory.is() )
throw uno::RuntimeException();
uno::Reference< embed::XHatchWindow > xHatchWindow = uno::Reference< embed::XHatchWindow > xHatchWindow =
xHatchFactory->createHatchWindowInstance( xParent, xHatchFactory->createHatchWindowInstance( xParent,
...@@ -446,8 +441,7 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& ...@@ -446,8 +441,7 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >&
awt::Rectangle(),//aOwnRectangle, awt::Rectangle(),//aOwnRectangle,
awt::WindowAttribute::SHOW | awt::VclWindowPeerAttribute::CLIPCHILDREN ); awt::WindowAttribute::SHOW | awt::VclWindowPeerAttribute::CLIPCHILDREN );
uno::Reference< awt::XToolkit2 > xToolkit = uno::Reference< awt::XToolkit2 > xToolkit = awt::Toolkit::create(m_xContext);
awt::Toolkit::create(comphelper::getComponentContext(m_xFactory));
uno::Reference< awt::XWindowPeer > xNewWinPeer = xToolkit->createWindow( aOwnWinDescriptor ); uno::Reference< awt::XWindowPeer > xNewWinPeer = xToolkit->createWindow( aOwnWinDescriptor );
uno::Reference< awt::XWindow > xOwnWindow( xNewWinPeer, uno::UNO_QUERY ); uno::Reference< awt::XWindow > xOwnWindow( xNewWinPeer, uno::UNO_QUERY );
...@@ -456,7 +450,7 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& ...@@ -456,7 +450,7 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >&
// create a frame based on the specified window // create a frame based on the specified window
uno::Reference< lang::XSingleServiceFactory > xFrameFact( uno::Reference< lang::XSingleServiceFactory > xFrameFact(
m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.TaskCreator" )) ), m_xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.frame.TaskCreator", m_xContext ),
uno::UNO_QUERY_THROW ); uno::UNO_QUERY_THROW );
uno::Sequence< uno::Any > aArgs( 2 ); uno::Sequence< uno::Any > aArgs( 2 );
...@@ -554,14 +548,14 @@ uno::Reference< container::XIndexAccess > DocumentHolder::RetrieveOwnMenu_Impl() ...@@ -554,14 +548,14 @@ uno::Reference< container::XIndexAccess > DocumentHolder::RetrieveOwnMenu_Impl()
if ( !xResult.is() ) if ( !xResult.is() )
{ {
// no internal document configuration, use the one from the module // no internal document configuration, use the one from the module
uno::Reference< frame::XModuleManager2 > xModuleMan( frame::ModuleManager::create(comphelper::getComponentContext(m_xFactory)) ); uno::Reference< frame::XModuleManager2 > xModuleMan = frame::ModuleManager::create(m_xContext);
::rtl::OUString aModuleIdent = ::rtl::OUString aModuleIdent =
xModuleMan->identify( uno::Reference< uno::XInterface >( m_xComponent, uno::UNO_QUERY ) ); xModuleMan->identify( uno::Reference< uno::XInterface >( m_xComponent, uno::UNO_QUERY ) );
if ( !aModuleIdent.isEmpty() ) if ( !aModuleIdent.isEmpty() )
{ {
uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModConfSupplier( uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModConfSupplier =
ui::ModuleUIConfigurationManagerSupplier::create(comphelper::getComponentContext(m_xFactory)) ); ui::ModuleUIConfigurationManagerSupplier::create(m_xContext);
uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > xModUIConfMan( uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > xModUIConfMan(
xModConfSupplier->getUIConfigurationManager( aModuleIdent ), xModConfSupplier->getUIConfigurationManager( aModuleIdent ),
uno::UNO_QUERY_THROW ); uno::UNO_QUERY_THROW );
...@@ -836,7 +830,7 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame() ...@@ -836,7 +830,7 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame()
if ( !m_xFrame.is() ) if ( !m_xFrame.is() )
{ {
uno::Reference< lang::XSingleServiceFactory > xFrameFact( uno::Reference< lang::XSingleServiceFactory > xFrameFact(
m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.TaskCreator" ) )), m_xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.frame.TaskCreator", m_xContext ),
uno::UNO_QUERY_THROW ); uno::UNO_QUERY_THROW );
m_xFrame.set(xFrameFact->createInstanceWithArguments( m_aOutplaceFrameProps ), uno::UNO_QUERY_THROW); m_xFrame.set(xFrameFact->createInstanceWithArguments( m_aOutplaceFrameProps ), uno::UNO_QUERY_THROW);
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/embed/XHatchWindowController.hpp> #include <com/sun/star/embed/XHatchWindowController.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase6.hxx> #include <cppuhelper/implbase6.hxx>
class OCommonEmbeddedObject; class OCommonEmbeddedObject;
...@@ -55,7 +56,7 @@ private: ...@@ -55,7 +56,7 @@ private:
Interceptor* m_pInterceptor; Interceptor* m_pInterceptor;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > m_xOutplaceInterceptor; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > m_xOutplaceInterceptor;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > m_xComponent; ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > m_xComponent;
...@@ -114,7 +115,7 @@ public: ...@@ -114,7 +115,7 @@ public:
throw ( ::com::sun::star::uno::Exception ); throw ( ::com::sun::star::uno::Exception );
DocumentHolder( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, DocumentHolder( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
OCommonEmbeddedObject* pEmbObj ); OCommonEmbeddedObject* pEmbObj );
~DocumentHolder(); ~DocumentHolder();
......
...@@ -111,6 +111,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing/fr ...@@ -111,6 +111,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing/fr
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\
DocumentCloser \ DocumentCloser \
FileSystemStorageFactory \ FileSystemStorageFactory \
HatchWindowFactory \
InstanceLocker \ InstanceLocker \
OLESimpleStorage \ OLESimpleStorage \
StorageFactory \ StorageFactory \
......
/* -*- 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_embed_HatchWindowFactory_idl__
#define __com_sun_star_embed_HatchWindowFactory_idl__
#include <com/sun/star/embed/XHatchWindowFactory.idl>
module com { module sun { module star { module embed {
/**
@since LibreOffice 4.1
*/
service HatchWindowFactory : XHatchWindowFactory;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment