summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-05-07 12:23:35 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2010-05-07 12:23:35 +0200
commit5fad51e9db2be4affb53377bd5113346420c1c4b (patch)
treec3c63adf09969af481c5858f34e6ce43c0577e12
parentef12d8a69cdba75f75845432ea84f03f69502ea4 (diff)
#i109668# let the default filter be used for export
-rw-r--r--sfx2/source/doc/guisaveas.cxx28
1 files changed, 21 insertions, 7 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 3be1f4a79cc8..5b12ac5537f7 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -835,10 +835,16 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
}
::rtl::OUString aAdjustToType;
-
- // bSetStandardName == true means that user agreed to store document in the default (default default ;-)) format
- if ( !(( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED )) &&
- ( bSetStandardName || GetStorable()->hasLocation() ))
+ if ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ))
+ {
+ // it is export, set the preselected filter
+ ::rtl::OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
+ ::rtl::OUString::createFromAscii( "UIName" ),
+ ::rtl::OUString() );
+ pFileDlg->SetCurrentFilter( aFilterUIName );
+ }
+ // it is no export, bSetStandardName == true means that user agreed to store document in the default (default default ;-)) format
+ else if ( bSetStandardName || GetStorable()->hasLocation() )
{
uno::Sequence< beans::PropertyValue > aOldFilterProps;
::rtl::OUString aOldFilterName = GetDocProps().getUnpackedValueOrDefault(
@@ -1572,8 +1578,10 @@ uno::Sequence< beans::PropertyValue > SfxStoringHelper::SearchForFilter(
uno::Reference< container::XEnumeration > xFilterEnum =
xFilterQuery->createSubSetEnumerationByProperties( aSearchRequest );
- // use the first filter that is found
+ // the first default filter will be taken,
+ // if there is no filter with flag default the first acceptable filter will be taken
if ( xFilterEnum.is() )
+ {
while ( xFilterEnum->hasMoreElements() )
{
uno::Sequence< beans::PropertyValue > aProps;
@@ -1584,11 +1592,17 @@ uno::Sequence< beans::PropertyValue > SfxStoringHelper::SearchForFilter(
(sal_Int32)0 );
if ( ( ( nFlags & nMustFlags ) == nMustFlags ) && !( nFlags & nDontFlags ) )
{
- aFilterProps = aProps;
- break;
+ if ( ( nFlags & SFX_FILTER_DEFAULT ) == SFX_FILTER_DEFAULT )
+ {
+ aFilterProps = aProps;
+ break;
+ }
+ else if ( !aFilterProps.getLength() )
+ aFilterProps = aProps;
}
}
}
+ }
return aFilterProps;
}