summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-04-05 21:45:20 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-04-10 11:18:21 +0200
commit1576908dd0b5b275f90b50c0794559547aa0a25e (patch)
tree8003def9d2e93eb27354cb5eae611a8c0e9a98fd
parentMerge in Flatpak improvements (diff)
downloadcore-1576908dd0b5b275f90b50c0794559547aa0a25e.tar.gz
core-1576908dd0b5b275f90b50c0794559547aa0a25e.zip
tdf#115407: preselect sound file saved
To display the sound in the dropbox, the complete filename (eg: file:///home/julien/lo/libreoffice/instdir/share/gallery/sounds/pluck.wav) was compared with items of the sound list formed like this: file:///home/julien/lo/libreoffice/instdir/program/../share/gallery/sounds/pluck.wav See https://bugs.documentfoundation.org/show_bug.cgi?id=115407#c1 Since listbox displays only basename, let's just compare basenames Change-Id: I5fb49990322423fa7818e5d6e1cafd828e3500ec Reviewed-on: https://gerrit.libreoffice.org/52476 (cherry picked from commit 23c82e1a377ea6fce65d71277ec59b3ca150b98a) Reviewed-on: https://gerrit.libreoffice.org/52489 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index fc01f7b7547e..5ca0ea8227c9 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -269,10 +269,11 @@ struct lcl_EqualsSoundFileName
{
// note: formerly this was a case insensitive search for all
// platforms. It seems more sensible to do this platform-dependent
+ INetURLObject aURL(rStr);
#if defined(_WIN32)
- return maStr.equalsIgnoreAsciiCase( rStr );
+ return maStr.equalsIgnoreAsciiCase( aURL.GetBase() );
#else
- return maStr == rStr;
+ return maStr == aURL.GetBase();
#endif
}
@@ -285,9 +286,10 @@ bool lcl_findSoundInList( const ::std::vector< OUString > & rSoundList,
const OUString & rFileName,
::std::vector< OUString >::size_type & rOutPosition )
{
+ INetURLObject aURL(rFileName);
::std::vector< OUString >::const_iterator aIt =
::std::find_if( rSoundList.begin(), rSoundList.end(),
- lcl_EqualsSoundFileName( rFileName ));
+ lcl_EqualsSoundFileName( aURL.GetBase()));
if( aIt != rSoundList.end())
{
rOutPosition = ::std::distance( rSoundList.begin(), aIt );