officecfg/registry/data/org/openoffice/Office/Impress.xcu   |    5 +++
 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |   16 +++++++++++-
 sd/source/ui/animations/CustomAnimationDialog.cxx           |    5 ---
 sd/source/ui/animations/SlideTransitionPane.cxx             |    6 ----
 sd/source/ui/dlg/filedlg.cxx                                |   10 +++++++
 sd/source/ui/dlg/tpaction.cxx                               |    6 +---
 6 files changed, 34 insertions(+), 14 deletions(-)

New commits:
commit cdb14b4f079e56243c55029e4322f587fd6335b0
Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
Date:   Tue Jul 5 09:03:59 2016 +0000

    tdf#100715 Slide transition sound: Remember remember last folder
    
    Change-Id: I37bfb088a167464cdbd93a1f993a8161d12b379a
    Reviewed-on: https://gerrit.libreoffice.org/26937
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/officecfg/registry/data/org/openoffice/Office/Impress.xcu 
b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
index accf3471a3f1..72d2fb8b4155 100644
--- a/officecfg/registry/data/org/openoffice/Office/Impress.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
@@ -200,4 +200,9 @@
       <value>$(work)</value>
     </prop>
   </node>
+  <node oor:name="Sound" oor:op="fuse" oor:mandatory="true">
+    <prop oor:name="Path">
+      <value>$(work)</value>
+    </prop>
+  </node>
 </oor:component-data>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index e27df89f8129..7a2a7b7ec0d6 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -1632,7 +1632,7 @@
     </group>
     <group oor:name="Pictures">
       <info>
-        <desc>Contains configuration items form Impress Photo Album 
function.</desc>
+        <desc>Contains configuration items for Impress Photo Album 
function.</desc>
       </info>
       <prop oor:name="Path" oor:type="xs:string" oor:nillable="false">
         <info>
@@ -1644,5 +1644,19 @@
         <value>$(work)</value>
       </prop>
     </group>
+    <group oor:name="Sound">
+      <info>
+        <desc>Contains configuration items for Sound related functions.</desc>
+      </info>
+      <prop oor:name="Path" oor:type="xs:string" oor:nillable="false">
+        <info>
+          <desc>
+            Access path, where sounds were loaded last time.
+            The default is work directory.
+          </desc>
+        </info>
+        <value>$(work)</value>
+      </prop>
+    </group>
   </component>
 </oor:component-schema>
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx 
b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 72df60f6dab4..4012cf686649 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -1496,16 +1496,13 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
 {
     SdOpenSoundFileDialog aFileDialog(GetFrameWeld());
 
-    OUString aFile( SvtPathOptions().GetWorkPath() );
-    aFileDialog.SetPath( aFile );
-
     bool bValidSoundFile = false;
     bool bQuitLoop = false;
     long nPos = 0;
 
     while( !bQuitLoop && (aFileDialog.Execute() == ERRCODE_NONE) )
     {
-        aFile = aFileDialog.GetPath();
+        OUString aFile = aFileDialog.GetPath();
         nPos = getSoundObject( aFile );
 
         if( nPos < 0 ) // not in Soundliste
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index 1ada6a56eac5..c7384415d1a5 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -735,12 +735,8 @@ void SlideTransitionPane::openSoundFileDialog()
 
     SdOpenSoundFileDialog aFileDialog(GetFrameWeld());
 
-    OUString aFile;
     DBG_ASSERT( mpLB_SOUND->GetSelectedEntryPos() == 2,
                 "Dialog should only open when \"Other sound\" is selected" );
-    aFile = SvtPathOptions().GetWorkPath();
-
-    aFileDialog.SetPath( aFile );
 
     bool bValidSoundFile( false );
     bool bQuitLoop( false );
@@ -748,7 +744,7 @@ void SlideTransitionPane::openSoundFileDialog()
     while( ! bQuitLoop &&
            aFileDialog.Execute() == ERRCODE_NONE )
     {
-        aFile = aFileDialog.GetPath();
+        OUString aFile = aFileDialog.GetPath();
         tSoundListType::size_type nPos = 0;
         bValidSoundFile = lcl_findSoundInList( maSoundList, aFile, nPos );
 
diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx
index 25f07dca28e3..56688e35932a 100644
--- a/sd/source/ui/dlg/filedlg.cxx
+++ b/sd/source/ui/dlg/filedlg.cxx
@@ -38,6 +38,7 @@
 #include <sdresid.hxx>
 #include <strings.hrc>
 #include <vcl/graphicfilter.hxx>
+#include <officecfg/Office/Impress.hxx>
 
 // -----------      SdFileDialog_Imp        ---------------------------
 
@@ -235,6 +236,9 @@ SdOpenSoundFileDialog::SdOpenSoundFileDialog(weld::Window 
*pParent)
     aDescr = SdResId(STR_MIDI_FILE);
     mpImpl->AddFilter( aDescr, "*.mid" );
 #endif
+
+    // Restore last selected path
+    
mpImpl->SetDisplayDirectory(officecfg::Office::Impress::Sound::Path::get());
 }
 
 SdOpenSoundFileDialog::~SdOpenSoundFileDialog()
@@ -248,6 +252,12 @@ ErrCode SdOpenSoundFileDialog::Execute()
 
 OUString SdOpenSoundFileDialog::GetPath() const
 {
+    // Save last selected path
+    std::shared_ptr<comphelper::ConfigurationChanges> batch(
+        comphelper::ConfigurationChanges::create());
+    officecfg::Office::Impress::Sound::Path::set(mpImpl->GetPath(), batch);
+    batch->commit();
+
     return mpImpl->GetPath();
 }
 
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 643a7c6fa460..406062052629 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -411,10 +411,8 @@ void SdTPAction::OpenFileDialog()
         {
             SdOpenSoundFileDialog aFileDialog(GetFrameWeld());
 
-            if( aFile.isEmpty() )
-                aFile = SvtPathOptions().GetWorkPath();
-
-            aFileDialog.SetPath( aFile );
+            if( !aFile.isEmpty() )
+                aFileDialog.SetPath( aFile );
 
             if( aFileDialog.Execute() == ERRCODE_NONE )
             {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to