[Libreoffice-commits] core.git: embeddedobj/source offapi/com offapi/UnoApi_offapi.mk sfx2/source

Guillaume Smaha guillaume.smaha at gmail.com
Tue May 24 07:04:09 UTC 2016


 embeddedobj/source/inc/oleembobj.hxx             |    2 +
 offapi/UnoApi_offapi.mk                          |    1 
 offapi/com/sun/star/embed/XEmbeddedOleObject.idl |   37 +++++++++++++++++++++++
 sfx2/source/view/ipclient.cxx                    |    9 ++++-
 4 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit 2986e54412bbaf95ef768b9ffc18c9a465678337
Author: Guillaume Smaha <guillaume.smaha at gmail.com>
Date:   Wed May 18 09:33:07 2016 +0200

    Fix tdf#99506: Insert OLE object with icon failed
    
    Change-Id: I7fe5814b268e4c70977699edaa89926ca3fda92e
    Reviewed-on: https://gerrit.libreoffice.org/25080
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/embeddedobj/source/inc/oleembobj.hxx b/embeddedobj/source/inc/oleembobj.hxx
index 8468036..6b914f4 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 5346f26..ad793bd 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 0000000..d626f7b
--- /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 6b7f0ad..1f2b56b 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 )


More information about the Libreoffice-commits mailing list