Issue 100227 - Macros using user-defined DocumentInfo do not run anymore
Summary: Macros using user-defined DocumentInfo do not run anymore
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: joerg.skottke
QA Contact: issues@api
URL:
Keywords: regression
Depends on:
Blocks: 95768
  Show dependency tree
 
Reported: 2009-03-16 11:41 UTC by sos
Modified: 2013-02-24 21:09 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Document using DocumentInfo (824.55 KB, application/vnd.sun.xml.writer)
2009-03-23 11:03 UTC, sos
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description sos 2009-03-16 11:41:47 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 !!!!
Comment 1 jsc 2009-03-16 11:48:41 UTC
jsc -> mba: you probably know the changes better. can you please comment this
issue. 
Comment 2 Mathias_Bauer 2009-03-16 12:23:42 UTC
Michael, please comment.
Comment 3 stefan.baltzer 2009-03-16 16:12:10 UTC
Adjusting summary, set keyword "regression".
Please attach a small sample macro showing this problem, thx.
Comment 4 mst.ooo 2009-03-16 17:32:45 UTC
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.
Comment 5 mst.ooo 2009-03-16 17:47:09 UTC
fixed in cws sw31bf08 (sfx2/source/doc/objuno.cxx@269562)
Comment 6 mst.ooo 2009-03-16 17:49:52 UTC
' 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
Comment 7 Frank Schönheit 2009-03-18 23:21:25 UTC
> ' 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.
Comment 8 mst.ooo 2009-03-19 10:25:35 UTC
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.
Comment 9 sos 2009-03-19 10:45:38 UTC
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
Comment 10 mst.ooo 2009-03-19 11:03:37 UTC
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.
Comment 11 sos 2009-03-19 11:37:42 UTC
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
Comment 12 Mechtilde 2009-03-19 11:49:32 UTC
it is fixed in sw31bf08

please wait till it is integrated
Comment 13 sos 2009-03-19 12:46:46 UTC
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
Comment 14 stefan.baltzer 2009-03-20 16:19:35 UTC
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.
Comment 15 sos 2009-03-20 17:51:46 UTC
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
Comment 16 stefan.baltzer 2009-03-23 08:42:41 UTC
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.
Comment 17 sos 2009-03-23 11:00:26 UTC
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.
 
Comment 18 sos 2009-03-23 11:04:01 UTC
Created attachment 61111 [details]
Document using DocumentInfo
Comment 19 joerg.skottke 2009-03-24 08:23:43 UTC
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.
Comment 20 joerg.skottke 2009-04-23 14:17:38 UTC
Good in m10, closing