diff options
Diffstat (limited to 'fpicker/source/win32/filepicker/VistaFilePicker.cxx')
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePicker.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index eb26f23952d7..84d17dbbc0b1 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -51,6 +51,7 @@ #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <cppuhelper/interfacecontainer.h> +#include <comphelper/configurationhelper.hxx> #include <osl/diagnose.h> #include <osl/mutex.hxx> #include <osl/file.hxx> @@ -294,9 +295,24 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const ::rtl::OUString& sDirec throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) { + const ::rtl::OUString aPackage( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/")); + const ::rtl::OUString aRelPath( RTL_CONSTASCII_USTRINGPARAM("Path/Info")); + const ::rtl::OUString aKey( RTL_CONSTASCII_USTRINGPARAM("WorkPathChanged")); + + css::uno::Any aValue = ::comphelper::ConfigurationHelper::readDirectKey( + m_xSMGR, aPackage, aRelPath, aKey, ::comphelper::ConfigurationHelper::E_READONLY); + + bool bChanged(false); + if (( aValue >>= bChanged ) && bChanged ) + { + ::comphelper::ConfigurationHelper::writeDirectKey( + m_xSMGR, aPackage, aRelPath, aKey, css::uno::makeAny(false), ::comphelper::ConfigurationHelper::E_STANDARD); + } + RequestRef rRequest(new Request()); rRequest->setRequest (VistaFilePickerImpl::E_SET_DIRECTORY); rRequest->setArgument(PROP_DIRECTORY, sDirectory); + rRequest->setArgument(PROP_FORCE, bChanged); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } |