diff options
-rw-r--r-- | cui/source/options/optpath.cxx | 8 | ||||
-rw-r--r-- | fpicker/source/win32/IVistaFilePickerInternalNotify.hxx | 2 | ||||
-rw-r--r-- | fpicker/source/win32/VistaFilePicker.cxx | 13 | ||||
-rw-r--r-- | fpicker/source/win32/VistaFilePickerEventHandler.cxx | 1 | ||||
-rw-r--r-- | fpicker/source/win32/VistaFilePickerImpl.cxx | 28 | ||||
-rw-r--r-- | fpicker/source/win32/VistaFilePickerImpl.hxx | 4 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 12 |
7 files changed, 20 insertions, 48 deletions
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index a35f98ec3248..5f304327ce87 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -449,14 +449,6 @@ void SvxPathTabPage::ChangeCurrentEntry( const OUString& _rFolder ) // Reset also last used dir in the sfx application instance SfxApplication *pSfxApp = SfxGetpApp(); pSfxApp->ResetLastDir(); - - // Set configuration flag to notify file picker that it's necessary - // to take over the path provided. - std::shared_ptr< comphelper::ConfigurationChanges > batch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Path::Info::WorkPathChanged::set( - true, batch); - batch->commit(); } } } diff --git a/fpicker/source/win32/IVistaFilePickerInternalNotify.hxx b/fpicker/source/win32/IVistaFilePickerInternalNotify.hxx index 3501a37c94f9..57f995715719 100644 --- a/fpicker/source/win32/IVistaFilePickerInternalNotify.hxx +++ b/fpicker/source/win32/IVistaFilePickerInternalNotify.hxx @@ -46,6 +46,8 @@ class IVistaFilePickerInternalNotify virtual bool onFileTypeChanged( UINT nTypeIndex ) = 0; + virtual void onDirectoryChanged() = 0; + protected: ~IVistaFilePickerInternalNotify() {} }; diff --git a/fpicker/source/win32/VistaFilePicker.cxx b/fpicker/source/win32/VistaFilePicker.cxx index a7ded90f6d60..34b983c7ae51 100644 --- a/fpicker/source/win32/VistaFilePicker.cxx +++ b/fpicker/source/win32/VistaFilePicker.cxx @@ -169,22 +169,9 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory) { ensureInit(); - bool bChanged = officecfg::Office::Common::Path::Info::WorkPathChanged::get( - comphelper::getComponentContext(m_xSMGR)); - if (bChanged ) - { - std::shared_ptr< comphelper::ConfigurationChanges > batch( - comphelper::ConfigurationChanges::create( - comphelper::getComponentContext(m_xSMGR))); - officecfg::Office::Common::Path::Info::WorkPathChanged::set( - false, batch); - batch->commit(); - } - 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); } diff --git a/fpicker/source/win32/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/VistaFilePickerEventHandler.cxx index e770bef25406..b9ac5a3d28b8 100644 --- a/fpicker/source/win32/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/VistaFilePickerEventHandler.cxx @@ -111,6 +111,7 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* /*pDialo STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog*/) { impl_sendEvent(E_DIRECTORY_CHANGED, 0); + m_pInternalNotify->onDirectoryChanged(); return S_OK; } diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx index ba20ef75e64f..b4829126a0f6 100644 --- a/fpicker/source/win32/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/VistaFilePickerImpl.cxx @@ -756,7 +756,6 @@ void VistaFilePickerImpl::impl_sta_SetFileName(const RequestRef& rRequest) void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest) { OUString sDirectory = rRequest->getArgumentOrDefault(PROP_DIRECTORY, OUString()); - bool bForce = rRequest->getArgumentOrDefault(PROP_FORCE, false); if( !m_bInExecute) { @@ -778,27 +777,25 @@ void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest) if ( !createFolderItem(sDirectory, pFolder) ) return; - if ( m_bInExecute || bForce ) - iDialog->SetFolder(pFolder); - else - { - // Use set default folder as Microsoft recommends in the IFileDialog documentation. - iDialog->SetDefaultFolder(pFolder); - } + iDialog->SetFolder(pFolder); } -void VistaFilePickerImpl::impl_sta_GetDirectory(const RequestRef& rRequest) +OUString VistaFilePickerImpl::GetDirectory() { TFileDialog iDialog = impl_getBaseDialogInterface(); ComPtr< IShellItem > pFolder; HRESULT hResult = iDialog->GetFolder( &pFolder ); if ( FAILED(hResult) ) - return; - OUString sFolder = lcl_getURLFromShellItem ( pFolder ); - if( sFolder.getLength()) - rRequest->setArgument( PROP_DIRECTORY, sFolder ); + return OUString(); + return lcl_getURLFromShellItem(pFolder); } +void VistaFilePickerImpl::impl_sta_GetDirectory(const RequestRef& rRequest) +{ + const OUString sFolder = m_sDirectory.isEmpty() ? GetDirectory() : m_sDirectory; + if (!sFolder.isEmpty()) + rRequest->setArgument(PROP_DIRECTORY, sFolder); +} void VistaFilePickerImpl::impl_sta_SetDefaultName(const RequestRef& rRequest) { @@ -1324,6 +1321,11 @@ bool VistaFilePickerImpl::onFileTypeChanged( UINT /*nTypeIndex*/ ) return true; } +void VistaFilePickerImpl::onDirectoryChanged() +{ + m_sDirectory = GetDirectory(); +} + } // namespace vista } // namespace win32 } // namespace fpicker diff --git a/fpicker/source/win32/VistaFilePickerImpl.hxx b/fpicker/source/win32/VistaFilePickerImpl.hxx index 9cce75b5714f..e5d2d88e4391 100644 --- a/fpicker/source/win32/VistaFilePickerImpl.hxx +++ b/fpicker/source/win32/VistaFilePickerImpl.hxx @@ -71,7 +71,6 @@ static const OUString PROP_FEATURES("features" ); // [sal_Int32] static const OUString PROP_TEMPLATE_DESCR("templatedescription"); // [sal_Int32] static const OUString PROP_FILTER_TITLE("filter_title" ); // [OUString] static const OUString PROP_FILTER_VALUE("filter_value" ); // [OUString] -static const OUString PROP_FORCE("force" ); // [sal_Bool] static const OUString PROP_FILTER_GROUP("filter-group" ); // [seq< css:beans::StringPair >] contains a group of filters static const OUString PROP_CONTROL_ID("control_id" ); // [sal_Int16] @@ -147,9 +146,10 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex virtual void onAutoExtensionChanged (bool bChecked) override; virtual bool onFileTypeChanged( UINT nTypeIndex ) override; + virtual void onDirectoryChanged() override; private: - + OUString GetDirectory(); /// implementation of request E_ADD_FILEPICKER_LISTENER void impl_sta_addFilePickerListener(const RequestRef& rRequest); diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index d3056a325eba..cebb7d7ec0ef 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -1560,18 +1560,6 @@ <desc>Contains the current and default path settings used by the Office.</desc> </info> - <group oor:name="Info"> - <info> - <desc>Contains various properties information purpose only.</desc> - </info> - <prop oor:name="WorkPathChanged" oor:type="xs:boolean" oor:nillable="false"> - <info> - <desc>A flag which is set by the tools options dialog whenever a - user changed the work path.</desc> - </info> - <value>true</value> - </prop> - </group> <group oor:name="Current"> <info> <desc>Contains the global path settings, mainly those of the Options |