Bug 63026 - FILEOPEN: OLE-Objects cannot be opened within a Writer-Document if loaded via Java and loadComponentFromUrl
Summary: FILEOPEN: OLE-Objects cannot be opened within a Writer-Document if loaded via...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.1.2 release
Hardware: x86-64 (AMD64) All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-02 13:35 UTC by mathias.supp
Modified: 2015-04-26 04:14 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Writer-Document with a trivial embedded Excel 2010 OLE (14.17 KB, application/vnd.oasis.opendocument.text)
2013-04-02 13:35 UTC, mathias.supp
Details

Note You need to log in before you can comment on or make changes to this bug.
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)