diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-08-21 21:53:52 -0400 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-08-22 20:55:28 +0200 |
commit | d632fa4d8fc6a42a58cb981865d6267d90951b69 (patch) | |
tree | 73219935d13668cc7d666aaf1f6e8ca00783d5ce /sfx2 | |
parent | f49be70f1859a2734e9516a5036adb2426939e68 (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.
(cherry picked from commit ba03f2dc817c692fa8709391ec83d8e01a0f8b28)
(cherry picked from commit 84d1ff7be178ec3572710e092e85fe548ce3042b)
(cherry picked from commit 45b03c888042052a47cb79bc5a2837d04e115c5e)
Squashed these 3 commits into 1.
Also needed rtl::OUString("*.") instead of OUString("*.") in
sfx2/source/bastyp/fltfnc.cxx
Change-Id: Ic6d769bc1180f88fd75f40909e5e054d45719178
Signed-off-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/bastyp/fltfnc.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 72b35900575e..4a13f997e9b9 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -989,6 +989,13 @@ void SfxFilterContainer::ReadSingleFilter_Impl( { lFilterProperties[nFilterProperty].Value >>= sServiceName; } + else if (lFilterProperties[nFilterProperty].Name == "ExportExtension") + { + // Extension preferred by the filter. This takes precedence + // over those that are given in the file format type. + lFilterProperties[nFilterProperty].Value >>= sExtension; + sExtension = rtl::OUString("*.") + sExtension; + } else if ( lFilterProperties[nFilterProperty].Name == "Type" ) { lFilterProperties[nFilterProperty].Value >>= sType; @@ -1025,9 +1032,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" ) { |