sd/source/ui/animations/SlideTransitionPane.cxx |   30 ++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

New commits:
commit 46f5e4151ec2fb308960db31253f09351cfa8fd2
Author:     Zeki Bildirici <[email protected]>
AuthorDate: Mon Feb 23 22:30:30 2026 +0300
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Fri Feb 27 16:26:39 2026 +0100

    tdf#67544 Embed transition sound when Link is unchecked
    
    The Link checkbox in the sound file dialog was being ignored.
    When the user selects a sound file with Link unchecked, we now
    call avmedia::EmbedMedia() to copy the sound into the document
    package, matching the behavior of Insert -> Audio or Video.
    
    Change-Id: Id1c441ecd47c5fbc5bd285912fbf13a6c8346f1d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200083
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <[email protected]>
    (cherry picked from commit 507e1aeadf74cfa58ed30872a3bd858a96cbcb58)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200393
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index 3a680e223087..c37dafbafc5f 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -51,6 +51,9 @@
 
 #include <algorithm>
 
+#include <avmedia/mediaitem.hxx>
+#include <sfx2/objsh.hxx>
+
 using namespace ::com::sun::star;
 
 using ::com::sun::star::uno::Reference;
@@ -730,6 +733,24 @@ void SlideTransitionPane::openSoundFileDialog()
            aFileDialog.Execute() == ERRCODE_NONE )
     {
         OUString aFile = aFileDialog.GetPath();
+        bool bEmbedded = false;
+
+        // tdf#67544: Embed the sound file if "Link" is not checked
+        if (!aFileDialog.IsInsertAsLinkSelected())
+        {
+            SfxObjectShell* pShell = SfxObjectShell::Current();
+            if (pShell)
+            {
+                OUString aEmbeddedURL;
+                bool bSuccess = ::avmedia::EmbedMedia(pShell->GetModel(), 
aFile, aEmbeddedURL);
+                if (bSuccess && !aEmbeddedURL.isEmpty())
+                {
+                    aFile = aEmbeddedURL;
+                    bEmbedded = true;
+                }
+            }
+        }
+
         std::vector<OUString>::size_type nPos = 0;
         bValidSoundFile = lcl_findSoundInList( maSoundList, aFile, nPos );
 
@@ -737,6 +758,15 @@ void SlideTransitionPane::openSoundFileDialog()
         {
             bQuitLoop = true;
         }
+        else if( bEmbedded )
+        {
+            // Embedded URL: add directly to sound list, skip gallery
+            maSoundList.push_back( aFile );
+            lcl_FillSoundListBox( maSoundList, *mxLB_SOUND );
+            nPos = maSoundList.size() - 1;
+            bValidSoundFile = true;
+            bQuitLoop = true;
+        }
         else // not in sound list
         {
             // try to insert into gallery

Reply via email to