sd/source/ui/slidesorter/controller/SlsClipboard.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 6ec012e2eecb7c6359b2e16730ea90da32845f3c
Author:     Jim Raykowski <[email protected]>
AuthorDate: Sat Oct 18 21:31:32 2025 -0800
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Thu Oct 23 20:21:05 2025 +0200

    tdf#168951 sd: fix crash when dragging an unnamed object from
    
    Navigator and dropping it in the Pages pane
    
    The patch prevents dropping of unnamed objects by checking
    SdTransferable::IsPageTransferable()
    
    Comment in SdPageObjsTLV::DoDrag():
    "For shapes without a user supplied name (the automatically created name
    does not count), a different drag and drop technique is used."
    
    std::shared_ptr<SdTransferable::UserData>
    Clipboard::CreateTransferableUserData (SdTransferable* pTransferable)
    if (nPageIndex == SDRPAGE_NOTFOUND) break;
    
    This is why SdTransferable::SetPageBookmarks does not get called and
    therefore mbPageTransferable is not set true.
    
    Change-Id: Ia4eddb6c384e6e73047a0cddd4cd59c20562aa5d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192675
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <[email protected]>
    (cherry picked from commit c78a692927ad85700e9121edecd32a263ba80a24)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192889
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx 
b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 1ded3c5ab719..709557a78840 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -660,7 +660,13 @@ sal_Int8 Clipboard::AcceptDrop (
             // explicitly set to move or link, and when the source and
             // target models are not the same.
             SdTransferable* pDragTransferable = SdModule::get()->pTransferDrag;
-            if (pDragTransferable != nullptr
+
+            if (eDropType == DT_PAGE_FROM_NAVIGATOR && pDragTransferable
+                && !pDragTransferable->IsPageTransferable())
+            {
+                nAction = DND_ACTION_NONE;
+            }
+            else if (pDragTransferable != nullptr
                 && pDragTransferable->IsPageTransferable()
                 && ((rEvent.maDragEvent.DropAction
                         & 
css::datatransfer::dnd::DNDConstants::ACTION_DEFAULT) != 0)

Reply via email to