To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=72979





------- Additional comments from [EMAIL PROTECTED] Mon Jan 15 09:27:05 -0800 
2007 -------
Ok, here is simple POF

It breaks on line xSave.storeToURL or on xSave.store()

using System;
using System.Collections.Generic;
using System.Text;
using unoidl.com.sun.star.util;
using unoidl.com.sun.star.frame;
using unoidl.com.sun.star.beans;
using unoidl.com.sun.star.text;
using unoidl.com.sun.star.lang;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            OpenOfficeWriter oo = new OpenOfficeWriter();
            oo.LoadDoc(@"C:\example.odt");
            oo.SaveDoc();
        }

    }

    internal class OpenOfficeWriter
    {
        internal unoidl.com.sun.star.uno.XComponentContext xLocalContext;
        internal unoidl.com.sun.star.lang.XMultiServiceFactory xRemoteFactory;
        internal XComponentLoader aLoader;
        internal XComponent xComponent;
        internal XTextDocument xTextDocument;

        internal OpenOfficeWriter()
        {
        }

        public bool LoadDoc(string fajl)
        {

            xLocalContext = uno.util.Bootstrap.bootstrap();
            xRemoteFactory = 
(XMultiServiceFactory)xLocalContext.getServiceManager();
            aLoader = 
(XComponentLoader)xRemoteFactory.createInstance("com.sun.star.frame.Desktop");
            xComponent = aLoader.loadComponentFromURL("file:///" + fajl, 
"_blank", 0, new PropertyValue[0]);
            xTextDocument = (XTextDocument)xComponent;

            return true;
        }

        public bool SaveDoc()
        {

            XStorable xSave = (XStorable)xTextDocument;
            //xSave.store();
            PropertyValue[] pv = new PropertyValue[2];
            pv[0] = new PropertyValue();
            pv[0].Name = "FilterName";
            pv[0].Value = new uno.Any("StarOffice XML (Writer)");
            pv[1] = new PropertyValue();
            pv[1].Name = "Overwrite";
            pv[1].Value = new uno.Any("true");
            string fajl = xSave.getLocation();
            xSave.storeToURL(fajl.Replace('\\', '/'), pv);

            return true;
        }


    }

}


---------------------------------------------------------------------
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