diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2003-12-08 13:39:15 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2003-12-08 13:39:15 +0000 |
commit | cea282a900c0b7da3d48a3f4024ccfa7bf953ea0 (patch) | |
tree | 5bec8e424e7f83f4a0711d8a8f6e4bbdb68cbd40 /embeddedobj/test/Container1 | |
parent | 8c69a890ed83014953896af1c43d6a1d0ff59fc6 (diff) |
#112923# creation of new object requires detection of object factory
Diffstat (limited to 'embeddedobj/test/Container1')
-rw-r--r-- | embeddedobj/test/Container1/EmbedContApp.java | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/embeddedobj/test/Container1/EmbedContApp.java b/embeddedobj/test/Container1/EmbedContApp.java index 1165b11b7992..4a01c25757c8 100644 --- a/embeddedobj/test/Container1/EmbedContApp.java +++ b/embeddedobj/test/Container1/EmbedContApp.java @@ -860,7 +860,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie // Helper methods public XEmbeddedObject createEmbedObject( String aServiceName ) { - String aFactoryServiceName = null; XEmbeddedObject xEmbObj = null; byte[] pClassID = new byte[16]; @@ -870,8 +869,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0xAA, 0x47, 0xDA, 0xE2, 0xEE, 0x68, 0x9D, 0xD6 }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OOoEmbeddedObjectFactory"; } else if ( aServiceName.equals( "com.sun.star.comp.Writer.GlobalDocument" ) ) { @@ -879,8 +876,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0x95, 0x62, 0xBD, 0x13, 0xEA, 0x6F, 0x15, 0xA0 }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OOoEmbeddedObjectFactory"; } else if ( aServiceName.equals( "com.sun.star.comp.Writer.WebDocument" ) ) { @@ -888,8 +883,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0x91, 0xCE, 0x39, 0xC3, 0x90, 0x3F, 0xAC, 0x5E }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OOoEmbeddedObjectFactory"; } else if ( aServiceName.equals( "com.sun.star.comp.Calc.SpreadsheetDocument" ) ) { @@ -897,8 +890,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0xA5, 0x91, 0x42, 0xD9, 0xAE, 0x74, 0x95, 0x0F }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OOoEmbeddedObjectFactory"; } else if ( aServiceName.equals( "com.sun.star.comp.Draw.PresentationDocument" ) ) { @@ -906,8 +897,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0x80, 0x3B, 0x99, 0xD9, 0xBF, 0xAC, 0x10, 0x47 }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OOoEmbeddedObjectFactory"; } else if ( aServiceName.equals( "com.sun.star.comp.Draw.DrawingDocument" ) ) { @@ -915,8 +904,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0x99, 0x1C, 0xCB, 0xEE, 0xAC, 0x6B, 0xD5, 0xE3 }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OOoEmbeddedObjectFactory"; } else if ( aServiceName.equals( "com.sun.star.comp.Math.FormulaDocument" ) ) { @@ -924,8 +911,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0x85, 0x51, 0x61, 0x47, 0xE7, 0x76, 0xA9, 0x97 }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OOoEmbeddedObjectFactory"; } else if ( aServiceName.equals( "BitmapImage" ) ) { @@ -933,21 +918,19 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie 0x8C, 0x3D, 0x00, 0xAA, 0x00, 0x1A, 0x16, 0x52 }; for ( int ind = 0; ind < 16; ind++ ) pClassID[ind] = (byte)pTempClassID[ind]; - - aFactoryServiceName = "com.sun.star.embed.OleEmbeddedObjectFactory"; } if ( pClassID != null ) { // create embedded object based on the class ID try { - Object oEmbedFactory = m_xServiceFactory.createInstance( aFactoryServiceName ); - XEmbedObjectFactory xEmbedFactory = (XEmbedObjectFactory)UnoRuntime.queryInterface( - XEmbedObjectFactory.class, - oEmbedFactory ); - if ( xEmbedFactory != null ) + Object oEmbedCreator = m_xServiceFactory.createInstance( "com.sun.star.embed.EmbeddedObjectCreator" ); + XEmbedObjectCreator xEmbedCreator = (XEmbedObjectCreator)UnoRuntime.queryInterface( + XEmbedObjectCreator.class, + oEmbedCreator ); + if ( xEmbedCreator != null ) { - Object oEmbObj = xEmbedFactory.createInstanceInitNew( pClassID, + Object oEmbObj = xEmbedCreator.createInstanceInitNew( pClassID, "Dummy name", m_xStorage, "EmbedSub", |