[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - embeddedobj/source sw/source

Szymon Kłos szymon.klos at collabora.com
Fri Jul 14 13:46:11 UTC 2017


 embeddedobj/source/msole/oleembed.cxx |    6 +++---
 sw/source/core/unocore/unoframe.cxx   |   23 ++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 4 deletions(-)

New commits:
commit 0bd7b4ce4aa6ccce673947ab14d151e7f78ec221
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Wed Jul 12 12:17:03 2017 +0200

    tdf#108545 editable DOC/XLS embeddings inside DOCX
    
    Change-Id: Ia6cbe829f94b3f27e4ea633c02d6b1ec6e98e984
    Reviewed-on: https://gerrit.libreoffice.org/39860
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/39936
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index 17ba8ed59b8c..47c8bfbbe7e1 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -267,9 +267,9 @@ bool OleEmbeddedObject::TryToConvertToOOo( const uno::Reference< io::XStream >&
         xSeekable->seek( 0 );
         m_aFilterName = OwnView_Impl::GetFilterNameFromExtentionAndInStream( m_xFactory, OUString(), xStream->getInputStream() );
 
-        // use the solution only for OOXML format currently
         if ( !m_aFilterName.isEmpty()
-          && ( m_aFilterName == "Calc MS Excel 2007 XML" || m_aFilterName == "Impress MS PowerPoint 2007 XML" || m_aFilterName == "MS Word 2007 XML" ) )
+          && ( m_aFilterName == "Calc MS Excel 2007 XML" || m_aFilterName == "Impress MS PowerPoint 2007 XML" || m_aFilterName == "MS Word 2007 XML"
+              || m_aFilterName == "MS Excel 97 Vorlage/Template" || m_aFilterName == "MS Word 97 Vorlage" ) )
         {
             uno::Reference< container::XNameAccess > xFilterFactory(
                 m_xFactory->createInstance("com.sun.star.document.FilterFactory"),
@@ -921,7 +921,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
                 m_bTriedConversion = true;
                 if ( TryToConvertToOOo( m_xObjectStream ) )
                 {
-                    changeState( embed::EmbedStates::UI_ACTIVE );
+                    changeState( embed::EmbedStates::ACTIVE );
                     return;
                 }
             }
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 76d59e1a1d05..e428e5b51cda 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -3004,7 +3004,28 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
                 pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, nullptr);
 
                 SwFlyFrameFormat* pFrameFormat = nullptr;
-                pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( aPam, sStreamName, embed::Aspects::MSOLE_CONTENT, &aFrameSet, nullptr );
+                pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( aPam, sStreamName, m_nDrawAspect, &aFrameSet, nullptr );
+
+                // store main document name to show in the title bar
+                SwOLENode* pNd = nullptr;
+                const SwNodeIndex* pIdx = pFrameFormat->GetContent().GetContentIdx();
+                if( pIdx )
+                {
+                    SwNodeIndex aIdx( *pIdx, 1 );
+                    SwNoTextNode* pNoText = aIdx.GetNode().GetNoTextNode();
+                    pNd = pNoText->GetOLENode();
+                }
+                if( pNd )
+                {
+                    uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef();
+                    if( xObj.is() )
+                    {
+                        uno::Reference< frame::XTitle > xModelTitle( pDoc->GetDocShell()->GetModel(), css::uno::UNO_QUERY );
+                        if( xModelTitle.is() )
+                            xObj->setContainerName( xModelTitle->getTitle() );
+                    }
+                }
+
                 pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, nullptr);
                 pFrameFormat->Add(this);
                 if(!m_sName.isEmpty())


More information about the Libreoffice-commits mailing list