sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
New commits: commit de9be6b3520f89f266e14ac1466ca05461b3df4c Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Jun 15 23:27:55 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Jun 15 22:19:46 2025 +0200 tdf#167023: only try PasteSlidesFromSystemClipboard with correct descriptor PasteSlidesFromSystemClipboard seems to have some serious side effects, making following paste of different flavors fail. So check the object descriptor, which allows to avoid the problematic code for non-Impress objects. This also improves performance. But the underlying problem is not fixed here. Change-Id: I3c58c502900eb7c76b08b77945049bfa6a149182 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186526 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 9661e98b0945..1ded3c5ab719 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -73,6 +73,7 @@ #include <rtl/ustring.hxx> #include <vcl/svapp.hxx> +#include <comphelper/classids.hxx> #include <comphelper/storagehelper.hxx> using namespace ::com::sun::star; @@ -950,6 +951,20 @@ bool Clipboard::PasteSlidesFromSystemClipboard() TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard(pDrawViewShell->GetActiveWindow())); + { + // Only attempt to load EMBED_SOURCE, if its descriptor is correct + if (!aDataHelper.HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR)) + return false; + + TransferableObjectDescriptor aObjDesc; + if (!aDataHelper.GetTransferableObjectDescriptor(SotClipboardFormatId::OBJECTDESCRIPTOR, + aObjDesc)) + return false; + + if (aObjDesc.maClassName != SvGlobalName(SO3_SIMPRESS_CLASSID)) + return false; + } + SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument(); assert(pDocument); OUString aDocShellID = SfxObjectShell::CreateShellID(pDocument->GetDocSh());