Kaydet (Commit) 34da7fbc authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, convert embed::MSOLEObjectSystemCreator to new style

the service already existed, it just needed an IDL file

Change-Id: Iccd283f3537f8c8d57b2c2d68609dd9ef025da0b
üst 332b4286
......@@ -17,19 +17,20 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/embed/XInsertObjectDialog.hpp>
#include <com/sun/star/embed/MSOLEObjectSystemCreator.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/FilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/embed/XInsertObjectDialog.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include "insdlg.hxx"
#include <dialmgr.hxx>
......@@ -227,8 +228,7 @@ short SvInsertOleDlg::Execute()
try
{
uno::Reference < embed::XInsertObjectDialog > xDialogCreator(
::comphelper::getProcessServiceFactory()->createInstance(
"com.sun.star.embed.MSOLEObjectSystemCreator" ),
embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() ),
uno::UNO_QUERY );
if ( xDialogCreator.is() )
......
......@@ -137,6 +137,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\
FileSystemStorageFactory \
HatchWindowFactory \
InstanceLocker \
MSOLEObjectSystemCreator \
OLESimpleStorage \
OLEEmbeddedObjectFactory \
OOoEmbeddedObjectFactory \
......
/* -*- 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_MSOLEObjectSystemCreator_idl__
#define __com_sun_star_embed_MSOLEObjectSystemCreator_idl__
#include <com/sun/star/embed/XEmbedObjectClipboardCreator.idl>
module com { module sun { module star { module embed {
/**
@since LibreOffice 4.1
*/
service MSOLEObjectSystemCreator : XEmbedObjectClipboardCreator;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,6 +19,7 @@
#include <com/sun/star/embed/XEmbedObjectClipboardCreator.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/MSOLEObjectSystemCreator.hpp>
#include <svx/unomodel.hxx>
......@@ -215,9 +216,8 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
try
{
uno::Reference< embed::XStorage > xTmpStor = ::comphelper::OStorageHelper::GetTemporaryStorage();
uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator(
::comphelper::getProcessServiceFactory()->createInstance( OUString("com.sun.star.embed.MSOLEObjectSystemCreator") ),
uno::UNO_QUERY_THROW );
uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator =
embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() );
embed::InsertedObjectInfo aInfo = xClipboardCreator->createInstanceInitFromClipboard(
xTmpStor,
......
......@@ -20,6 +20,7 @@
#include "View.hxx"
#include <com/sun/star/embed/XEmbedObjectClipboardCreator.hpp>
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/embed/MSOLEObjectSystemCreator.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <sot/filelist.hxx>
#include <unotools/pathoptions.hxx>
......@@ -1007,9 +1008,8 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
try
{
uno::Reference< embed::XStorage > xTmpStor = ::comphelper::OStorageHelper::GetTemporaryStorage();
uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator(
::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.embed.MSOLEObjectSystemCreator"),
uno::UNO_QUERY_THROW );
uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator =
embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() );
embed::InsertedObjectInfo aInfo = xClipboardCreator->createInstanceInitFromClipboard(
xTmpStor,
......
......@@ -22,6 +22,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XEmbedObjectClipboardCreator.hpp>
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/embed/MSOLEObjectSystemCreator.hpp>
#include <svtools/embedtransfer.hxx>
#include <svtools/insdlg.hxx>
......@@ -1733,9 +1734,8 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
try
{
xTmpStor = ::comphelper::OStorageHelper::GetTemporaryStorage();
uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator(
::comphelper::getProcessServiceFactory()->createInstance( OUString("com.sun.star.embed.MSOLEObjectSystemCreator") ),
uno::UNO_QUERY_THROW );
uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator =
embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() );
embed::InsertedObjectInfo aInfo = xClipboardCreator->createInstanceInitFromClipboard(
xTmpStor,
......
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