summaryrefslogtreecommitdiff
path: root/fpicker/source
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-03-18 16:30:23 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-03-18 16:30:23 +0000
commitc9ff9861532b274f89387a39a1f0ab4eaed376cc (patch)
treef568889f5c10b445c495e791da78296f3f5f6e9c /fpicker/source
parent5c2010f02f9e9a838e86d8b5efde2f4fdf0410de (diff)
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
Diffstat (limited to 'fpicker/source')
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx45
1 files changed, 38 insertions, 7 deletions
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 <com/sun/star/uno/Sequence.hxx>
#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
#ifndef _UNOTOOLS_UCBHELPER_HXX
#include <unotools/ucbhelper.hxx>
@@ -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;
+ }
+ }
+ }
}
}