sd/source/ui/animations/SlideTransitionPane.cxx | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
New commits: commit 8f01e4ab0ec7e032c33aa6f8f77e3a79a0aeabc9 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:27:07 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/+/200394 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 0ffc7b19b290..4997e6a48842 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; @@ -691,6 +694,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 ); @@ -698,6 +719,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
