summaryrefslogtreecommitdiff
path: root/embeddedobj/source/commonembedding
diff options
context:
space:
mode:
Diffstat (limited to 'embeddedobj/source/commonembedding')
-rw-r--r--embeddedobj/source/commonembedding/xfactory.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx
index 77b87436c5e2..050a4bfe8375 100644
--- a/embeddedobj/source/commonembedding/xfactory.cxx
+++ b/embeddedobj/source/commonembedding/xfactory.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xfactory.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: hr $ $Date: 2004-05-10 17:51:47 $
+ * last change: $Author: hr $ $Date: 2004-08-02 17:44:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -282,6 +282,26 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
for ( sal_Int32 nInd = 0; nInd < aTempMedDescr.getLength(); nInd++ )
if ( aTempMedDescr[nInd].Name.equalsAscii( "FilterName" ) )
aTempMedDescr[nInd].Value >>= aFilterName;
+
+ 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;
+ for( sal_Int32 nInd = 0; nInd < aTypes.getLength(); nInd++ )
+ if ( aTypes[nInd].Name.equalsAscii("PreferredFilter") )
+ {
+ aTypes[nInd].Value >>= aFilterName;
+ sal_Int32 nLen = aTempMedDescr.getLength();
+ aTempMedDescr.realloc(nLen+1);
+ aTempMedDescr[nLen].Value = aTypes[nInd].Value;
+ aTempMedDescr[nLen].Name = ::rtl::OUString::createFromAscii( "FilterName" );
+ break;
+ }
+ }
+ }
}
uno::Reference< uno::XInterface > xResult;