Kaydet (Commit) 552bebe6 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

When the caller specifies filter type, stick to it and don't overwrite it.

Change-Id: I35a3efc506bbcc33ea4c3d2466929f8227dae102
üst e5ace9ef
...@@ -143,9 +143,18 @@ TypeDetection::~TypeDetection() ...@@ -143,9 +143,18 @@ TypeDetection::~TypeDetection()
css::uno::Reference< css::util::XURLTransformer > xParser(m_xSMGR->createInstance(SERVICE_URLTRANSFORMER), css::uno::UNO_QUERY); css::uno::Reference< css::util::XURLTransformer > xParser(m_xSMGR->createInstance(SERVICE_URLTRANSFORMER), css::uno::UNO_QUERY);
xParser->parseStrict(aURL); xParser->parseStrict(aURL);
//******************************************* rtl::OUString aSelectedFilter = stlDescriptor.getUnpackedValueOrDefault(
// preselected filter, type or document service? comphelper::MediaDescriptor::PROP_FILTERNAME(), rtl::OUString());
// use it as first "flat" detected type later! if (!aSelectedFilter.isEmpty())
{
// Caller specified the filter type. Honor it. Just get the default
// type for that filter, and bail out.
if (impl_validateAndSetFilterOnDescriptor(stlDescriptor, aSelectedFilter))
return stlDescriptor[comphelper::MediaDescriptor::PROP_TYPENAME()].get<rtl::OUString>();
}
// preselected type or document service? use it as first "flat" detected
// type later!
FlatDetection lFlatTypes; FlatDetection lFlatTypes;
impl_getPreselection(aURL, stlDescriptor, lFlatTypes); impl_getPreselection(aURL, stlDescriptor, lFlatTypes);
...@@ -682,10 +691,6 @@ void TypeDetection::impl_getPreselection(const css::util::URL& aP ...@@ -682,10 +691,6 @@ void TypeDetection::impl_getPreselection(const css::util::URL& aP
if (!sSelectedType.isEmpty()) if (!sSelectedType.isEmpty())
impl_getPreselectionForType(sSelectedType, aParsedURL, rFlatTypes); impl_getPreselectionForType(sSelectedType, aParsedURL, rFlatTypes);
::rtl::OUString sSelectedFilter = rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_FILTERNAME(), ::rtl::OUString());
if (!sSelectedFilter.isEmpty())
impl_getPreselectionForFilter(sSelectedFilter, aParsedURL, rFlatTypes);
::rtl::OUString sSelectedDoc = rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE(), ::rtl::OUString()); ::rtl::OUString sSelectedDoc = rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE(), ::rtl::OUString());
if (!sSelectedDoc.isEmpty()) if (!sSelectedDoc.isEmpty())
impl_getPreselectionForDocumentService(sSelectedDoc, aParsedURL, rFlatTypes); impl_getPreselectionForDocumentService(sSelectedDoc, aParsedURL, rFlatTypes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment