Issue 27558 - createInstanceInitFromMediaDescriptor does not work when only a URL is given
Summary: createInstanceInitFromMediaDescriptor does not work when only a URL is given
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: ocke.janssen
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-07 12:37 UTC by ocke.janssen
Modified: 2013-02-24 21:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ocke.janssen 2004-04-07 12:37:48 UTC
calling createInstanceInitFromMediaDescriptor with a MediaDescriptor which only
contains a URL does not work. The typedection has to ask for the preferredFilter.

Best regards,

Ocke

// try another way to get the correct filter name
		if ( !aFilterName.getLength() && aTypeName.getLength() )
		{
			uno::Reference<container::XNameAccess>
xNameAccess(xTypeDetection,uno::UNO_QUERY);
			if ( xNameAccess.is() && xNameAccess->hasByName(aTypeName) )
			{
				uno::Sequence<beans::PropertyValue> aTypes;
				xNameAccess->getByName(aTypeName) >>= aTypes;
				const beans::PropertyValue* pIter = aTypes.getConstArray();
				const beans::PropertyValue* pEnd	  = pIter + aTypes.getLength();
				for(;pIter != pEnd && !pIter->Name.equalsAscii("PreferredFilter");++pIter)
					;
				if ( pIter != pEnd )
				{
					pIter->Value >>= aFilterName;
					sal_Int32 nLen = aTempMedDescr.getLength();
					aTempMedDescr.realloc(nLen+1);
					aTempMedDescr[nLen] = *pIter;
				}
			}
		}
Comment 1 mikhail.voytenko 2004-04-07 13:24:13 UTC
I have updated the code as you suggested.
Comment 2 mikhail.voytenko 2004-07-12 13:09:35 UTC
reoopen the issue
Comment 3 mikhail.voytenko 2004-07-12 13:11:36 UTC
to OJ: Please set the bug to verified if the problem disappeared after patch
applying.
Comment 4 mikhail.voytenko 2004-07-12 13:11:57 UTC
Set the bug back to fixed.
Comment 5 ocke.janssen 2004-07-12 14:35:33 UTC
verified
Comment 6 ocke.janssen 2004-09-06 11:56:56 UTC
.