diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-20 09:22:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-08 13:53:03 +0200 |
commit | 34da7fbcc643ad209290c6da456dbfb17aeb9ac0 (patch) | |
tree | 585dc1b17dadd4913aee79ec74c3f0d0b41b27fa | |
parent | 332b42860ed5503f4661d38e2745191b7039c275 (diff) |
fdo#46808, convert embed::MSOLEObjectSystemCreator to new style
the service already existed, it just needed an IDL file
Change-Id: Iccd283f3537f8c8d57b2c2d68609dd9ef025da0b
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 20 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/embed/MSOLEObjectSystemCreator.idl | 37 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun5.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dochdl/swdtflvr.cxx | 6 |
6 files changed, 57 insertions, 19 deletions
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 80c91331f4f9..08f8dd395ff0 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -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() ) diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 9a6e6faf1b2d..092cefb7c3ee 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -137,6 +137,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\ FileSystemStorageFactory \ HatchWindowFactory \ InstanceLocker \ + MSOLEObjectSystemCreator \ OLESimpleStorage \ OLEEmbeddedObjectFactory \ OOoEmbeddedObjectFactory \ diff --git a/offapi/com/sun/star/embed/MSOLEObjectSystemCreator.idl b/offapi/com/sun/star/embed/MSOLEObjectSystemCreator.idl new file mode 100644 index 000000000000..05f830824d83 --- /dev/null +++ b/offapi/com/sun/star/embed/MSOLEObjectSystemCreator.idl @@ -0,0 +1,37 @@ +/* -*- 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: */ diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index ecd015242c4e..c320fc1dbe9b 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -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, diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index cc201163496d..867d06bdf1c0 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -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, diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 6f65056af733..c61c0ece5d65 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -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, |