sw/source/uibase/dochdl/swdtflvr.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 996b912b10cadcddb52f7cbe124f05edeee9fbab
Author:     Skyler Grey <[email protected]>
AuthorDate: Tue Mar 10 09:08:02 2026 +0000
Commit:     Szymon Kłos <[email protected]>
CommitDate: Tue Mar 10 15:27:07 2026 +0100

    fix: gate new clipboard link behavior to LOK
    
    In Id7d85333f76f06d83a4966deb551f3846a6a6964 I forced link pasting
    when a link was detected. Unfortunately this works poorly in classic
    where pasting a file creates a link and should instead open the "insert
    section" dialog. It's better to restrict this fix only to LOK to avoid
    breaking this other case
    
    Change-Id: I807509541419b7465ca66d85e9c497266a6a6964
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201357
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 974b1323b386..7df122750b53 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3384,15 +3384,17 @@ bool SwTransferable::PasteFileList( const 
TransferableDataHelper& rData,
                                     SwWrtShell& rSh, bool bLink,
                                     const Point* pPt, bool bMsg )
 {
-    for( sal_uInt32 i = 0, nFormatCount = rData.GetFormatCount(); ( i < 
nFormatCount ) && !bLink; ++i )
-    {
-        if( SotClipboardFormatId::FILE_LIST == rData.GetFormat( i ) )
+    if ( comphelper::LibreOfficeKit::isActive() ) {
+        for( sal_uInt32 i = 0, nFormatCount = rData.GetFormatCount(); ( i < 
nFormatCount ) && !bLink; ++i )
         {
-            const DataFlavor aFlavor( rData.GetFormatDataFlavor( i ) );
-
-            if( aFlavor.MimeType.indexOf( "text/uri-list" ) > -1 )
+            if( SotClipboardFormatId::FILE_LIST == rData.GetFormat( i ) )
             {
-                bLink = true;
+                const DataFlavor aFlavor( rData.GetFormatDataFlavor( i ) );
+
+                if( aFlavor.MimeType.indexOf( "text/uri-list" ) > -1 )
+                {
+                    bLink = true;
+                }
             }
         }
     }
commit 916b58986d6f0d2becf855bb41895e5285367503
Author:     Skyler Grey <[email protected]>
AuthorDate: Mon Mar 2 15:49:28 2026 +0000
Commit:     Szymon Kłos <[email protected]>
CommitDate: Tue Mar 10 15:26:57 2026 +0100

    fix: correct copy/paste behavior with links
    
    In online, links copied on iOS/MacOS systems are sometimes pasted into
    a document without bLink being set. This goes through a path that pops
    up an "Insert section" dialog rather than pasting a link. To fix this,
    when we're pasting a file list, we can detect if one of the elements is
    a link. If so, we can override this so we are pasting a link
    
    Change-Id: Ic012926bc502d5d99fca7d095badaf196a6a6964
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201356
    Reviewed-by: Szymon Kłos <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 952030882f95..974b1323b386 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3384,6 +3384,19 @@ bool SwTransferable::PasteFileList( const 
TransferableDataHelper& rData,
                                     SwWrtShell& rSh, bool bLink,
                                     const Point* pPt, bool bMsg )
 {
+    for( sal_uInt32 i = 0, nFormatCount = rData.GetFormatCount(); ( i < 
nFormatCount ) && !bLink; ++i )
+    {
+        if( SotClipboardFormatId::FILE_LIST == rData.GetFormat( i ) )
+        {
+            const DataFlavor aFlavor( rData.GetFormatDataFlavor( i ) );
+
+            if( aFlavor.MimeType.indexOf( "text/uri-list" ) > -1 )
+            {
+                bLink = true;
+            }
+        }
+    }
+
     bool bRet = false;
     FileList aFileList;
     if( rData.GetFileList( SotClipboardFormatId::FILE_LIST, aFileList ) &&

Reply via email to