Apache OpenOffice (AOO) Bugzilla – Issue 100227
Macros using user-defined DocumentInfo do not run anymore
Last modified: 2013-02-24 21:09:14 UTC
When do some test with dev 3.1 (latest snapshot) i found a anoying regressing in the use of the User Defined DocumentInfo oDocuInfo = oDocument.getDocumentInfo() dim str1 ,str2 as string str1 = oDocuInfo.PMG_StylesVakjes str2 = oDocuInfo.PMG_KolommenCitaten sinds 2.3 this works fine with 3.1 i got null strings now i must use oDocuInfo.GetpropertieValue(" PMG_StylesVakjes") to set the User info I used oDocuInfo.PMG_StylesVakjes = "UserInfoString" this code is also no longer working Changing this few lines is not the problem, but The code is around in Thousands of documents.... Myself and others find this as a 3.1 blocker !!!!
jsc -> mba: you probably know the changes better. can you please comment this issue.
Michael, please comment.
Adjusting summary, set keyword "regression". Please attach a small sample macro showing this problem, thx.
this is a regression in OOo 3.0 from OOo 2.4 the PropertySetInfo for the DocumentInfo implementation is not correct; it contains handles from the underlying PropertyBag of the DocumentProperties service, which are not valid for the DocumentInfo itself.
fixed in cws sw31bf08 (sfx2/source/doc/objuno.cxx@269562)
' please verify ' test case should pop up 2 boxes with "_zzz_" Sub Main c = ThisComponent di = c.getDocumentInfo() di.addProperty("ZZZ", 0, "_zzz_") ' N.B.: re-get document info because basic seems to cache its PropertySetInfo di = c.getDocumentInfo() msgbox di.getPropertyValue("ZZZ") msgbox di.ZZZ End Sub
> ' N.B.: re-get document info because basic seems to cache its PropertySetInfo fs->mst: Is there an issue for this already? There are interfaces XPropertySetInfoChangeNotifier/Listener defined in css.beans, but currently not supported by the property bag (nor the document info) implementation. I suppose we should add that support, and teach the Basic runtime to refresh its cache when the PropertySetInfo changes.
mst->fs: i am not aware of an issue (but i have not searched). maybe you should ask ab. the current basic behaviour is certainly somewhat confusing. enhancing the PropertyBag certainly makes sense. but i'm not very enthused about enhancing the DocumentInfo implementation, given that it has been superceded by DocumentProperties, and that is a prime candidate for removal of badly-designed deprecated published API in OOo 4.
Sorry to interupt, but it would be very handy if we can hide a UserDifinedProperty from the GUI. With DocumentInfo, it was hidden, so you can see it also as a regression :-) Greetz Fernand
hi sos, the fact that some of the user-defined properties were displayed in the gui and some were not is probably bug, not a feature. i guess that 15 years ago, someone designed that dialog and thought "well, 4 properties ought to be enough for everyone". if you look at the meta.xml of a ODF file, then you will see that all of the user-defined DocumentInfo properties are stored the same, whether displayed in the GUI or not.
Hi Michael, You are right, but you have to know we have in or organisation thousands of Documents around who uses this "probably bug" as a "save" way to store some information who is sinds 3.1 not only "seen" but also can been "altered" by a general user, kind of a nightmare no :-) So I propose thatyou produce a few lines off code :-) who store the "old" Documentinfo's as "hidden" and let us decide in the future if we will hide them or not. Thanks for your interest Fernand Fernand
it is fixed in sw31bf08 please wait till it is integrated
Mechtilde, You mean "both" regressions are repaired ? ( thats realy fast :-)) - basic API problem - Fact that users can seeing and altering the old "DocumentInfo's" I suposse the first is repaired an maybe Should I file a new issue for the second one ? Thanks for your interest Fernand
SBA: I can see the macro working in CWS sw31bf08. SBA->sos: You write "So I propose thatyou produce a few lines off code who store the "old" Documentinfo's as "hidden" and let us decide in the future if we will hide them or not." - Guess what? File an issue for that. This is "Fix showstopper" times. What garage do you think we are in? Toy with file formats and/or UI a week before delivery? How much time will YOU spend to test all this against regessions before millions of OTHERS will get exactly this version into exactly THEIR environment with THEIR document treatment habits and document and macro writing history? Note that THIS issue was reported "quite late" on the way to 3.1 but shows a problem introduced already with OOo 3.0. SBA->JSK: Given the technical discussion here, I propose that you to have a second look. Please decide what else must be looked after and be tested. I am not as much into the macro and API stuff as you are. In this case (one of the last showstopper CWSes to get integrated), there will be NO time to re-fix whatever regression this change will bring "elsewhere, under certain conditions, unexpected and unpredictable". Reassigned to JSK.
sos->SBAS sorry I do not intended to work on your nervs, just try to explain that sinds 2.4 your garage :-) introduced DocumentInfo as Hidden en Not changeable by the UI in 3.1 i found out dat DocumentInfo , no longer works and is replaced with DocumentProperties who are now visible and can been changed by the UI. For API users this is a showstopper ! Wy so late to report: well our garage has a anti Regression Ppolicy to stay 1 major version behind therefor we are still working with 2.4.1 and do our own testing with 3.1 in the hope that the regressions where found and repaired in 3.0. Anyway thanks for your interest and if nececarly we stick a bit longer to 2.4 Fernand
SBA->sos: (1) Please provide meaningful sample document(s) and macro(s) that show your multi-fold problem. (Working in 2.4, failing in 3.0). I regard the macro that mst provided as "not exactly from real life", unlike what you mentioned. Thx. (2) Note that what is always missing on the finishing line of a release: TIME. Now that you know what might happen, feel free to evaluating OOo versions earlier in order to give feedback in time. Otherwise this "version is unusable" scenario might repeat for you for whatever the next reason could be.
sos->SBA OK I attach a real live document. As Belgian Leading Editor off over 25 Trade Magzines 100 users we produce more than 6000 pages par year Using OO as the main adn ONLY editing tool ! Ar first You wil see that we uses DocumentInfo to find out who is editing (and at what computer) the document stays open. Further on we use DocumenInfo to store "Layout" related information, who may NOT BEEN ALTERED by a common user. Feel free to find also some enhancement idea's in the macro's we use to place and crop pictures who are also influencend by information stored in the DocumentInfo.
Created attachment 61111 [details] Document using DocumentInfo
Hi sos, i've tested the functionality using the included code snippet and it looks good so far. Please re-check it in ooo310m8 (which is the build i expect this CWS to go into). Regarding your document data: No specification exists that ensures that you can use the document info fields to safely store any document related data and thereby protect it against alterations by the user. One could say that you "misused" an undocumented and unsupported feature. However, the idea is a good one. Usually i would consider coding the document data into a macro (layout stuff and such), which should be a convenient way. For the rest i would suggest you write a Request for enhancement (RFE) that the document info page can be protected against user input via macro/api. Setting verified.
Good in m10, closing