summaryrefslogtreecommitdiff
path: root/fpicker/source/office/OfficeFilePicker.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fpicker/source/office/OfficeFilePicker.cxx')
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index cdf83c2cdc1a..269e666453b1 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -140,18 +140,28 @@ void SvtFilePicker::prepareExecute()
// --**-- doesn't match the spec yet
if ( !m_aDisplayDirectory.isEmpty() || !m_aDefaultName.isEmpty() )
{
+ bool isFileSet = false;
if ( !m_aDisplayDirectory.isEmpty() )
{
- INetURLObject aPath( m_aDisplayDirectory );
+ INetURLObject aPath;
+ INetURLObject givenPath( m_aDisplayDirectory );
+ if (!givenPath.HasError())
+ aPath = givenPath;
+ else
+ {
+ INetURLObject aStdDirObj( SvtPathOptions().GetWorkPath() );
+ aPath = aStdDirObj;
+ }
if ( !m_aDefaultName.isEmpty() )
{
aPath.insertName( m_aDefaultName );
getDialog()->SetHasFilename( true );
}
getDialog()->SetPath( aPath.GetMainURL( INetURLObject::NO_DECODE ) );
+ isFileSet = true;
}
- else if ( !m_aDefaultName.isEmpty() )
+ if ( !isFileSet && !m_aDefaultName.isEmpty() )
{
getDialog()->SetPath( m_aDefaultName );
getDialog()->SetHasFilename( true );