diff options
author | Guillaume Smaha <guillaume.smaha@gmail.com> | 2016-05-18 09:33:07 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-05-24 07:03:45 +0000 |
commit | 2986e54412bbaf95ef768b9ffc18c9a465678337 (patch) | |
tree | 2b9809b9180927a7eae749184fc403d2cc009f32 | |
parent | 3650eacc9e4bf230d892eaac9366b7ebc16ed5c1 (diff) |
Fix tdf#99506: Insert OLE object with icon failed
Change-Id: I7fe5814b268e4c70977699edaa89926ca3fda92e
Reviewed-on: https://gerrit.libreoffice.org/25080
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | embeddedobj/source/inc/oleembobj.hxx | 2 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/embed/XEmbeddedOleObject.idl | 37 | ||||
-rw-r--r-- | sfx2/source/view/ipclient.cxx | 9 |
4 files changed, 48 insertions, 1 deletions
diff --git a/embeddedobj/source/inc/oleembobj.hxx b/embeddedobj/source/inc/oleembobj.hxx index 84680366b5db..6b914f47172b 100644 --- a/embeddedobj/source/inc/oleembobj.hxx +++ b/embeddedobj/source/inc/oleembobj.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <com/sun/star/embed/XEmbeddedOleObject.hpp> #include <com/sun/star/embed/XInplaceObject.hpp> #include <com/sun/star/embed/XVisualObject.hpp> #include <com/sun/star/embed/XEmbedPersist.hpp> @@ -104,6 +105,7 @@ class OleComponent; class OwnView_Impl; class OleEmbeddedObject : public ::cppu::WeakImplHelper < css::embed::XEmbeddedObject + , css::embed::XEmbeddedOleObject , css::embed::XEmbedPersist , css::embed::XLinkageSupport , css::embed::XInplaceObject diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 5346f26f931d..ad793bdf6c93 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -2437,6 +2437,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/embed,\ XEmbedPersist2 \ XEmbeddedClient \ XEmbeddedObject \ + XEmbeddedOleObject \ XEncryptionProtectedSource \ XEncryptionProtectedSource2 \ XEncryptionProtectedStorage \ diff --git a/offapi/com/sun/star/embed/XEmbeddedOleObject.idl b/offapi/com/sun/star/embed/XEmbeddedOleObject.idl new file mode 100644 index 000000000000..d626f7b6f3b7 --- /dev/null +++ b/offapi/com/sun/star/embed/XEmbeddedOleObject.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_XEmbeddedOleObject_idl__ +#define __com_sun_star_embed_XEmbeddedOleObject_idl__ + + module com { module sun { module star { module embed { + +/** Represents a marker for embedded OLE objects. + * + * @since LibreOffice 5.2 + */ +interface XEmbeddedOleObject +{ +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 6b7f0adf0e01..1f2b56b56eb2 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/embed/XWindowSupplier.hpp> #include <com/sun/star/embed/XEmbedPersist.hpp> #include <com/sun/star/embed/EmbedVerbs.hpp> +#include <com/sun/star/embed/XEmbeddedOleObject.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -911,7 +912,13 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) { if ( m_pImp->m_nAspect == embed::Aspects::MSOLE_ICON ) { - if ( nVerb == embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb == embed::EmbedVerbs::MS_OLEVERB_SHOW ) + // the common persistence is supported by objects and links + + uno::Reference< embed::XEmbeddedOleObject > xEmbeddedOleObject( m_pImp->m_xObject, uno::UNO_QUERY ); + + if ( xEmbeddedOleObject.is() && (nVerb == embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb == embed::EmbedVerbs::MS_OLEVERB_OPEN || nVerb == embed::EmbedVerbs::MS_OLEVERB_SHOW )) + nVerb = embed::EmbedVerbs::MS_OLEVERB_SHOW; + else if ( nVerb == embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb == embed::EmbedVerbs::MS_OLEVERB_SHOW ) nVerb = embed::EmbedVerbs::MS_OLEVERB_OPEN; // outplace activation else if ( nVerb == embed::EmbedVerbs::MS_OLEVERB_UIACTIVATE || nVerb == embed::EmbedVerbs::MS_OLEVERB_IPACTIVATE ) |