https://bz.apache.org/ooo/show_bug.cgi?id=126131

          Issue ID: 126131
        Issue Type: DEFECT
           Summary: Open office process not releasing file lock on
                    temporary files.
           Product: Writer
           Version: 4.1.1
          Hardware: PC
                OS: Windows 7
            Status: UNCONFIRMED
          Severity: major
          Priority: P5
         Component: programming
          Assignee: [email protected]
          Reporter: [email protected]

We recently upgraded to open office 4.0.1/4.1.1
version(Apache_OpenOffice_incubating_4.1.1_Win_x86_install_en-US.exe).We
installed it and and connect to open office 4.1.1 with UNO Java API.
We used to start the open office from commnad prompt by issue the below
command.

Our application used to embed image in word report(.doc file) using UNO Java
API.
Original image is copied to temporary location and after embedding to word
report we used to delete the temporary file from temporary location.
After upgrading open office version from 3.3.0 to 4.0.1/4.1.1. We observed that
the open office process is holding lock on these temporary files. The problem
started after upgrading open office version from 3.3.0.
 The issue happens in windows environment only.
 The below is the code snippet which we use to embed the images.Open office is
holding lock on the file as soon as the below statement is executed.The file is
delete-able only after killing the open office process.PFA for screenshot of
file deletion.
xBitmapContainer.insertByName("someID", url);


Code Snippet:
********************************************

                        xBitmapContainer = (XNameContainer)
UnoRuntime.queryInterface(
                                XNameContainer.class, xMSF.createInstance(
                                "com.sun.star.drawing.BitmapTable"));
                        xImage = (XTextContent) UnoRuntime.queryInterface(
                                XTextContent.class,     xMSF.createInstance(
                                "com.sun.star.text.TextGraphicObject"));
                        XPropertySet xProps = (XPropertySet)
UnoRuntime.queryInterface(
                                XPropertySet.class, xImage);

                   xBitmapContainer.insertByName("someID", url);
                        internalURL = AnyConverter.toString(xBitmapContainer
                                .getByName("someID"));

                        xProps.setPropertyValue("AnchorType",
                               
com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH);
                        xProps.setPropertyValue("GraphicURL", internalURL);

                        textCursor.getText().insertTextContent(textCursor,
xImage, false);

                        XGraphic xGraphic =
getGraphicFromURL(xRemoteContext.get("8100")==null?xRemoteContext.get("8600"):xRemoteContext.get("8600"),
url);

                        xProps.setPropertyValue("Graphic", xGraphic);



                        // remove the helper-entry
             ***           xBitmapContainer.removeByName("someID");

-- 
You are receiving this mail because:
You are the assignee for the issue.

Reply via email to