Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | ISMISSING Function changes parameters status | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | App Dev | Reporter: | gregmcc <grmccormack> | ||||||||
Component: | api | Assignee: | ab | ||||||||
Status: | CLOSED WONT_FIX | QA Contact: | issues@api <issues> | ||||||||
Severity: | Trivial | ||||||||||
Priority: | P3 | CC: | ab, issues | ||||||||
Version: | 3.3.0 or older (OOo) | Keywords: | oooqa | ||||||||
Target Milestone: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||||||
Developer Difficulty: | --- | ||||||||||
Attachments: |
|
Description
gregmcc
2010-11-19 00:34:00 UTC
seems to be BASIC related; changing component to API Hi Greg, could you please attach a sample document containing the macro which seems to be working incorrectly? Thanks for supporting us! ja->ab: please have a look at this issue Created attachment 75071 [details]
Testing IsMissing functionality ...
Created attachment 75082 [details]
Optional Parameter Calling IMPROVED ODS
Oh goodness - I am trying to simplify some coding so I can just give you the core element that is giving the problem - and I can't replicate it when I convert it to a simple format - Can you just hold on this Issue - It is an issue: I just can't prove that it is an issue - I'll get back to you... This is in Calc. Reassigning. reassigning to owner of correct component Created attachment 75144 [details]
Spreadsheet that exhibits IsMissing function error
Right - I have cut down the spreadsheet in which the fault is exhibiting itself ( Attached ) - As I have said in my previous messages : I can't seem to replicate it in a clean spreadsheet. I can't believe that this is a corruption - because surely that would move focus and come up with different errors. But I am at a loss otherwise. The spreadsheet YYYYmmNN_EQIC_CutDown_Rev823e50 consists of three sheets. It is the ScheduleOfTestResults sheet that is of interest. When information is typed into a cell the first thing it does is to call the FindRow function. This function finds the row where a specific text exists - in this case 'Test Instruments'. It is doing this to find the lower boundary of the table. The table rows can be deleted or merged to suit the needs of the electrical installation. The FindRow Function is also used to find rows in remote spreadsheets ( when the parameters 'File' and 'Path' are set ), but this isn't the case in this instance. If you put a hold ( a Breakpoint ) on first few lines of the FindRow function - you be amazed to see that sSheet isn't passed into the routine and is therefore defined as a IsMissing parameter. If IsMissing(sSheet) Then sSheet = Divulge("Sheet") oSheet = ThisComponent.Sheets.getByName( sSheet ) else If IsMissing(sFile) then oSheet = ThisComponent.Sheets.getByName( sSheet ) else If IsMissing(sPath) then oSheet = oOpenRemoteSheet(sSheet,sFile) else oSheet = oOpenRemoteSheet(sSheet,sFile,sPath) end if end if End if And yet the 'else' aspect of the 'if' statement is the one that gets processed - with obvious errors being generated in the 'OpenRemoteSheet' function which is called in error ( with bad parameters ). So this seems to be the only way that I can get the fault over to you. Please advise ... If you don't want to swamp this 'issue' with comments and queries you can contact me at GregMcCormack@uwclub.net - and then we can leave the core comments on this web page. Thanks for your help in advance - I will be really embarrassed if it is something silly that I have overlooked - but it has been over week now since I got stuck on this issue. Regards Greg McC Liverpool, UK jsc -> ab: one for you Just put the spreadsheet on an old machine running OO 3.0.1 version - and the IsMissing function is correctly operating on that version. GregMcC Liverpool UK Hi Greg, I'm currently looking at this problem. What do I have to do in the spreadsheet to force FindRow to be called? Although typing information in a cell, FindRow is not called. Using the last attachment - '...EQIC_CutDown...' Macros have to be enabled. Once the spreadsheet is loaded - it comes up with a message telling you that the Workbook macros are working. If after an error or something - you need to restart them ( then there is a special button on the Reference Sheet for doing just that ). On the ScheduleOfTestResults sheet - change the value of a watched cell - such as H16. And the FindRow macro is called ... On the version of OO ( 3.2.1 ) that I am using it works fine ... ( I had to go back to using the older version ) ... But on the newer one OOO330m15 the IsMissing test was screwing up... Any more info - just ask ... ( I would have to reload 330m15 on another machine to replicate the error - I will do that soon - to enable me to help you further ) Regards Greg Hi Greg, I've found the reason for the problem. You are right, the behavior concerning missing parameters really has changed, but it has only changed for VBA mode (Option VBASupport 1). In VBA missing parameters of type object and string are handled differently. Objects simply become NULL, strings become empty, but IsMissing returns false. This has been fixed for VBA mode. That's exactly what the VBA mode is for: It allows to chan- ge the OOo Basic behavior in order to improve VBA compatibi- lity without breaking old OOo Basic programs *not* using this mode, but there's no way to avoid breaking non VBA programs that explicitely activate it. Otherwise it would be impossible to fix issues concerning VBA compatibility. I don't know why you use "Option VBASupport 1" in an ods do- cument without using (?) VBA API, but it's kind of "on own risk". Activating the VBASupport option actually should al- low to run original VBA macros from Excel documents. Chan- ging the runtime behavior in this context is no problem as long as the compatibility improves. Before it wouldn't have worked correctly anyway. So to have a stable API you should not use "Option VBASup- port 1". If you need it for some reason, you sometimes may have to change your code. In this case you will have to test for an empty string instead of using IsMissing. I hope this is acceptable. :-) Regards Andreas -> WONTFIX for the described reasons |