diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-08-21 21:53:52 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-08-21 22:07:39 -0400 |
commit | ba03f2dc817c692fa8709391ec83d8e01a0f8b28 (patch) | |
tree | 93415b497c5088d2302b9f9ad7f18c2eeb21d180 /sfx2/source/bastyp/fltfnc.cxx | |
parent | 601bfe2ce3113719b2f8edaba2ccb6b630051a9a (diff) |
fdo#52451: Ensure that the extension for text is .txt from writer.
Added a preferred extension property to the filter which overwrites
one(s) given by the default file format type associated with it.
Normally this property is not used for the majority of the filters,
but for plain text filters, we need to use .txt when saving from
writer whereas we do .csv from calc.
Change-Id: I3453ad084e4379e5cc1101daeb9d2c3ddd919e92
Diffstat (limited to 'sfx2/source/bastyp/fltfnc.cxx')
-rw-r--r-- | sfx2/source/bastyp/fltfnc.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 4fe76029276b..b1c47238d7eb 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -979,6 +979,12 @@ void SfxFilterContainer::ReadSingleFilter_Impl( { lFilterProperties[nFilterProperty].Value >>= sServiceName; } + else if (lFilterProperties[nFilterProperty].Name == "FileSaveExtension") + { + // Extension preferred by the filter. This takes precedence + // over those that are given in the file format type. + lFilterProperties[nFilterProperty].Value >>= sExtension; + } else if ( lFilterProperties[nFilterProperty].Name == "Type" ) { lFilterProperties[nFilterProperty].Value >>= sType; @@ -1015,9 +1021,12 @@ void SfxFilterContainer::ReadSingleFilter_Impl( } else if ( lTypeProperties[nTypeProperty].Name == "Extensions" ) { - ::com::sun::star::uno::Sequence< ::rtl::OUString > lExtensions; - lTypeProperties[nTypeProperty].Value >>= lExtensions; - sExtension = implc_convertStringlistToString( lExtensions, ';', DEFINE_CONST_UNICODE("*.") ); + if (sExtension.isEmpty()) + { + ::com::sun::star::uno::Sequence< ::rtl::OUString > lExtensions; + lTypeProperties[nTypeProperty].Value >>= lExtensions; + sExtension = implc_convertStringlistToString( lExtensions, ';', DEFINE_CONST_UNICODE("*.") ); + } } else if ( lTypeProperties[nTypeProperty].Name == "URLPattern" ) { |