To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=82210
                 Issue #|82210
                 Summary|bootstrap hangs one second run of program
               Component|udk
                 Version|OOo 2.2.1
                Platform|All
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|kr
             Reported by|gbo





------- Additional comments from [EMAIL PROTECTED] Wed Oct  3 10:52:09 +0000 
2007 -------
I have a simple c# program that opens a doc hidden and closes it again, This is 
to just show this issue.

When I run the program a second time the call to bootstrap hangs, I have to 
then kill the program and soffice.bin before I can use any openoffice programs.

The document I am opening is the rtf spec saves a a odt file.

If I run it without hidden it does not have the issue. also if I run and 
connect to a socket its works.

I think it is to do with the number of tables in the document.

The code is in c# and run on windows XP.

Open Office is quick start is running.

Code...
###########################
using System;
using System.Collections.Generic;
using System.Text;
using unoidl.com.sun.star.lang;
using unoidl.com.sun.star.uno;
using unoidl.com.sun.star.bridge;
using unoidl.com.sun.star.frame;
using unoidl.com.sun.star.beans;


namespace OpenOfficeText
{
    class Program
    {
        //Define a file name. Change this to an existing path!  

        // file to open.
        private static string FileName = @"C:\Word 2002 RTF Specification\Word 
2002 RTF Specification Final.odt";

        [STAThread]
        static void Main(string[] args)
        {
            TestOpenOffice();
        }

        static void TestOpenOffice()
        {

            //Call the bootstrap method to get a new ComponentContext  
            //object. If OpenOffice isn't already started this will  
            //start it and then return the ComponentContext.  

            // this lines hangs on second run of program.
            unoidl.com.sun.star.uno.XComponentContext localContext =
              uno.util.Bootstrap.bootstrap();



            //Get a new service manager of the MultiServiceFactory type  
            //we need this to get a desktop object and create new CLI  
            //objects.  

            unoidl.com.sun.star.lang.XMultiServiceFactory multiServiceFactory =
                (unoidl.com.sun.star.lang.XMultiServiceFactory)
                localContext.getServiceManager();


            //Create a new Desktop instance using our service manager  
            //Notice: We cast our desktop object to XComponent loader  
            //so that we could load or create new documents.  

            XComponentLoader componentLoader =
               (XComponentLoader)multiServiceFactory.createInstance(
                  "com.sun.star.frame.Desktop");


            // Create without the GUI
            //sett the property 
            unoidl.com.sun.star.beans.PropertyValue[] propertyValue = new 
unoidl.com.sun.star.beans.PropertyValue[1];
            unoidl.com.sun.star.beans.PropertyValue aProperty = new 
unoidl.com.sun.star.beans.PropertyValue();
            aProperty.Name = "Hidden";
            aProperty.Value = new uno.Any(true);
            propertyValue[0] = aProperty;

            //Create a new blank writer document using our component  
            //loader object.  

            XComponent xComponent = componentLoader.loadComponentFromURL(
                //"private:stream",
               PathConverter(FileName),  
               "_blank", 0,       //into a blank frame use no searchflag  
                propertyValue
               );

            xComponent.dispose();
        }


         /// The converted file to URL 
        private static string PathConverter(string file)
        {
            try
            {
                file = file.Replace(@"\", "/");
                return "file:///" + file;
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
    } 
}
###########################

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to