Apache OpenOffice (AOO) Bugzilla – Issue 27558
createInstanceInitFromMediaDescriptor does not work when only a URL is given
Last modified: 2013-02-24 21:09:04 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; } } }
I have updated the code as you suggested.
reoopen the issue
to OJ: Please set the bug to verified if the problem disappeared after patch applying.
Set the bug back to fixed.
verified
.