From 9a35b8f4478553fc314b9ce6b616d2d686867a3e Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Tue, 2 Nov 2021 15:34:08 +0530 Subject: sc: EMBED_SOURCE: also include objects on copy to clip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to match the behaviour of copy-pasting with the internal clipboard. If user copies a range that contains some images then on pasting these images are also included when using internal clipboard document. Change-Id: I61a6e71bd6afcace51230d1e7e7539e88404cbe5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124628 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 430a3e123c24ba2e87d89dddebb4fda4d3ff2e93) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124669 Reviewed-by: Luboš Luňák --- sc/source/ui/view/viewfun5.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 655d7a1554fa..d32ec61b38fd 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -160,7 +160,8 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, nFirstRow = nLastRow = 0; } ScClipParam aClipParam(ScRange(nFirstCol, nFirstRow, nSrcTab, nLastCol, nLastRow, nSrcTab), false); - rSrcDoc.CopyToClip(aClipParam, pClipDoc.get(), &aSrcMark, false, false); + bool bIncludeObjects = (nFormatId == SotClipboardFormatId::EMBED_SOURCE); + rSrcDoc.CopyToClip(aClipParam, pClipDoc.get(), &aSrcMark, false, bIncludeObjects); ScGlobal::SetClipDocName( xDocShRef->GetTitle( SFX_TITLE_FULLNAME ) ); SetCursor( nPosX, nPosY ); -- cgit