Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Regression from OOo1.1.x ThisComponent is not available | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | General | Reporter: | noel.power | ||||||
Component: | scripting | Assignee: | AOO issues mailing list <issues> | ||||||
Status: | ACCEPTED --- | QA Contact: | |||||||
Severity: | Trivial | ||||||||
Priority: | P3 | CC: | ab, issues | ||||||
Version: | 680m180 | ||||||||
Target Milestone: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux, all | ||||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||||
Developer Difficulty: | --- | ||||||||
Attachments: |
|
Description
noel.power
2006-08-18 11:35:50 UTC
Created attachment 38619 [details]
BugLib exported library ( in a zip file )
Created attachment 38620 [details]
test date ( Tab seperated values )
steps to reproduc ================= for OO1.5 and OOo2.0.x * unzip the buglib.zip somewhere * download the ( tab seperated values ) data file ( or create your own ) * append/import the BugLib/script.xlb from the macro organizer * open the basic IDE and edit the BugLib.Test.Main macro sUrl, the url to the test data needs to be re-defined to point to the name/location of your data file e.g. sUrl = "file:///data4/fluor.txt" * close the macro organiser * open a blank spreadsheet document * select tools/macro/macro organiser and from that dialog run BugLib.Test.Main what should you see? OOo1.5: 1) No basic errors 2) you get a message box with the dbg_supported interface output 3) and you are left with a spreadsheet with 1 sheet named RawData ( or something like that ) OOo2.0.x: 1) you get a message box with ""Dbg_SupportedInterfaces not available, (TypeClass is not TypeClass_Interface)" 2) followed by and "property or method not found" error at line 64 "if oDoc.sheets.hasbyName("Raw Data") then" Also, this particular behaviour ( orphaned ThisComponent ) seems to only happen when the library is and application one. andreas, I add you as cc, presume you are interested in this and may very well want to have a look yourself Some remarks, for what it's worth... 1 - Your code does not close the document, it close the current frame of the document. The result is a document without frame. I can't say if it is a legal use of the API. 2 - With 1.1.5 on Win XP I get the message "Dbg_SupportedInterfaces not available, (TypeClass is not TypeClass_Interface)" 2 - same result is obtained with this simple code: Sub Main1 dim oDoc as object, oFrame as object oDoc = StarDesktop.loadComponentFromUrl("private:factory/scalc", "_blank", 0, array()) oFrame = oDoc.CurrentController.Frame 'this checks to see which method should be used to close the FRAME If HasUnoInterfaces(oFrame, "com.sun.star.util.XCloseable") Then oFrame.close(true) Else oFrame.dispose End If oDoc = ThisComponent MsgBox oDoc.dbg_supportedInterfaces End Sub 3 - if what you want is to continue to work in hidden mode on your document there is a better way: oDoc.CurrentController.Frame.ContainerWindow.Visible = False ' - - - do what you want - - - oDoc.Close(True) cd: Accepted. I have to investigate why we have a regression here. For now I set it to OOo 2.x, may be the target has to be changed if I have more information. The sfx2 project is responsible to set ThisComponent correctly. npower->bmarcelly
>1 - Your code does not close the document, it close the current frame of the
>document.
>The result is a document without frame. I can't say if it is a legal use of the
>API.
well it's not my code ;-) but I do think you have a point with respect to
closing the Frame ( I didn't see that, I just assumed it was closing the
document ). But.... regardless, if I change the code in 'lcl_closedoc' to
actually close the model ( e.g. replacing the line
'oFrame = oDoc.CurrentController.Frame' with
'oFrame = oDoc' )
it makes no difference and the results I observe are exactly the same
Maybe the platform makes a difference, so I will mark this issue as Linux (
where I see the problem )
Also its worth noting that I run the macro from the document e.g. (
tools/macros/organiser, select MyMacros.Buglib.Main and press the run button )
IIRC running the macro from the IDE can yield slightly different results.
npower->cd
is the close operation asynchronous? if it is then the value of ThisComponent
really can't be gauranteed directly after a close I guess ( it will depend on
when the next window/frame get activated )
So, I suppose really the key question here is,
is it correct for the code that worked in OO1.5 to depend on the value of
ThisComponent in the scenario ( accessing ThisComponent directly after a close? )
if yes then there is a bug, if no then we can say in OO1.5 we just got away with
it
Regarding a workaround, thats quite simple, you just need to save ThisComponent
before you open/close the csv file.
. cd->npower: Looks like a problem with our ThisComponent management. As this code is old and therefore hard to maintain OOo 2.x is the correct target. We recommend to use your workaround as the way to go until we fixed this issue: "Save ThisComponent before you open/close the csv file.". according to release status meeting -> target 3.x |