diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-07-12 12:17:03 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2017-07-13 17:27:56 +0200 |
commit | d15d3d92a7297a57fafd9ed11c959bb8ec322b3a (patch) | |
tree | f0690930f50935cadd54d7b5d68935f376180c28 /sw | |
parent | 2caaf9bfe8d3f81517467daf36de0bd8ddd6b543 (diff) |
tdf#108545 editable DOC/XLS embeddings inside DOCX
Change-Id: Ia6cbe829f94b3f27e4ea633c02d6b1ec6e98e984
Reviewed-on: https://gerrit.libreoffice.org/39860
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index e666726b06dc..162f9f7102be 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2986,7 +2986,28 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::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(SwUndoId::INSERT, nullptr); pFrameFormat->Add(this); if(!m_sName.isEmpty()) |