Bug 63026

Summary: FILEOPEN: OLE-Objects cannot be opened within a Writer-Document if loaded via Java and loadComponentFromUrl
Product: LibreOffice Reporter: mathias.supp
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME    
Severity: major CC: barta, fdbugs, jmadero.dev, nopower, thb
Priority: medium    
Version: 4.0.1.2 release   
Hardware: x86-64 (AMD64)   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Writer-Document with a trivial embedded Excel 2010 OLE

Description mathias.supp 2013-04-02 13:35:41 UTC
Created attachment 77316 [details]
Writer-Document with a trivial embedded Excel 2010 OLE

Try the following:
==================
- run a Java-program loading the attached ODT
  - double click on the OLE-preview ("hallo")
  - an error occurs ("General OLE Error" or "Allgemeiner OLE Fehler")

Code (setup classpath property):
XComponentContext componentContext = Bootstrap.bootstrap();
XMultiServiceFactory serviceFactory = cast(XMultiServiceFactory.class, oOO.getServiceManager());
XDesktop desktop = UnoRuntime.queryInterface(XDesktop.class, serviceFactory.createInstance("com.sun.star.frame.Desktop"));
UnoRuntime.queryInterface(XComponentLoader.class, desktop).loadComponentFromURL("file:///C:/....../Desktop/Report1.odt", "_default", FrameSearchFlag.AUTO, new PropertyValue[] {});

(please replace C:/....../ properly)


Now try some other ways:

(1)
- run a Java-program loading the attached ODT (code see above)
  - perform a "Reload" either via Dispatch-Command or via UI
  - double click on the OLE-preview ("hallo")
  - Excel will open (if avaiable)

(2)
- open the attached odt (Report1.odt) with File/Open
  - double click on the OLE-preview ("hallo")
  - Excel will open (if avaiable)

(3)
- run a basic-macro loading the attached ODT
  - double click on the OLE-preview ("hallo")
  - Excel will open (if avaiable)
Code:
StarDesktop.loadComponentFromURL("file:///C:/....../Report1.odt", "_default", com.sun.star.frame.FrameSearchFlag.AUTO, Array())

(4)
- run a Visual-Basic-Macro loading the attached ODT
  - double click on the OLE-preview ("hallo")
  - Excel will open (if avaiable)
Code:
Dim arg()
Set oSM = CreateObject("com.sun.star.ServiceManager")
Set oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
Set oDoc = oDesk.loadComponentFromURL("file:///C:/Users/vikamsu/Desktop/Report1.odt", "_blank", 0, arg())
Comment 1 Joel Madero 2014-07-21 03:16:35 UTC
Noel - any thoughts on this one?

Definitely not a major bug - major is if there is data loss/crashes/etc...lowering to normal
Comment 2 mathias.supp 2014-07-21 07:11:58 UTC
I disagree: if you ever dare to open and save the document after loading it with loadComponentFromUrl the OLE is corrupt.
==> data loss.
Comment 3 Noel Power 2014-07-22 08:29:12 UTC
(In reply to comment #1)
> Noel - any thoughts on this one?
> 
> Definitely not a major bug - major is if there is data
> loss/crashes/etc...lowering to normal

sorry, I have no idea, seems strange that after a reload the ole will open correctly
Comment 4 tommy27 2015-01-18 11:00:14 UTC
@mathias.supp
is this bug still present with latest LibO 4.3.5.2 release?
Comment 5 mathias.supp 2015-01-20 07:11:21 UTC
Sorry, didn't test it, yet.
We currently use a workaround with the dispatch ".uno:Reload".
Comment 6 Matthew Francis 2015-04-26 04:14:47 UTC
I can reproduce this using a simple Basic macro on 4.0.6.2/OSX

Sub Foo
    Dim loadArgs(1) as New com.sun.star.beans.PropertyValue
    lUrl = "file:///DIRECTORY/CONTAINING/Report1.odt"
    lDoc = StarDesktop.LoadComponentFromURL(lUrl,"_blank",0,loadArgs())
End Sub

When this is run immediately upon loading LO, double clicking on the OLE object doesn't work.


However, on 4.4.2.2 there is no issue.

Setting -> RESOLVED WORKSFORME (as the specific commit hasn't been identified)