From c9ff9861532b274f89387a39a1f0ab4eaed376cc Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 18 Mar 2008 16:30:23 +0000 Subject: INTEGRATION: CWS tkr11_DEV300 (1.14.18); FILE MERGED 2008/03/05 09:06:36 tkr 1.14.18.3: #154182# new property to set standard dir on open/save dialog 2008/03/03 08:13:43 tkr 1.14.18.2: #154182# new property to set standard dir on open/save dialog 2008/02/28 13:08:14 tkr 1.14.18.1: #154182# new member for standard dir --- fpicker/source/office/OfficeFilePicker.cxx | 45 +++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) (limited to 'fpicker/source') diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx index d52da919b522..a645fe235eba 100644 --- a/fpicker/source/office/OfficeFilePicker.cxx +++ b/fpicker/source/office/OfficeFilePicker.cxx @@ -4,9 +4,9 @@ * * $RCSfile: OfficeFilePicker.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: obo $ $Date: 2008-01-07 08:44:06 $ + * last change: $Author: vg $ $Date: 2008-03-18 17:30:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -88,6 +88,9 @@ #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ #include #endif +#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_ +#include +#endif #ifndef _UNOTOOLS_UCBHELPER_HXX #include @@ -540,7 +543,16 @@ SvtFileDialog* SvtFilePicker::implCreateDialog( Window* _pParent ) WinBits nExtraBits; WinBits nBits = getWinBits( nExtraBits ); - return new SvtFileDialog( _pParent, nBits, nExtraBits ); + SvtFileDialog* dialog = new SvtFileDialog( _pParent, nBits, nExtraBits ); + + // Set StandardDir if present + if ( m_aStandardDir.getLength() > 0) + { + String sStandardDir = String( m_aStandardDir ); + dialog->SetStandardDir( sStandardDir ); + } + + return dialog; } //------------------------------------------------------------------------------------ @@ -1093,13 +1105,32 @@ void SAL_CALL SvtFilePicker::initialize( const Sequence< Any >& _rArguments ) m_nServiceType = TemplateDescription::FILEOPEN_SIMPLE; - if ( _rArguments.getLength() == 1 ) + if ( _rArguments.getLength() >= 1 ) { // compatibility: one argument, type sal_Int16 , specifies the service type - if ( _rArguments.getLength() ) + _rArguments[0] >>= m_nServiceType; + + // NOTE: _rArguments[1] not used here + + for ( int i = 0; i < _rArguments.getLength(); i++) { - if ( _rArguments[0] >>= m_nServiceType ) - return; + NamedValue namedValue; + + if (_rArguments[i] >>= namedValue ) + { + if ( namedValue.Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StandardDir" ) ) ) ) + { + ::rtl::OUString sStandardDir; + + namedValue.Value >>= sStandardDir; + + // Set the directory for the "back to the default dir" button + if ( sStandardDir.getLength() > 0 ) + { + m_aStandardDir = sStandardDir; + } + } + } } } -- cgit