Issue 9880

Summary: Conditional text fields referencing database fields behave erratically
Product: Writer Reporter: brh <brian>
Component: codeAssignee: eric.savary
Status: CLOSED FIXED QA Contact: issues@sw <issues>
Severity: Trivial    
Priority: P3 CC: issues, orw
Version: OOo 1.0.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Document demonstrating the problem
none
simple document also showing the defect none

Description brh 2002-12-05 18:58:39 UTC
I have a document used for label printing that includes a conditional text field
for outputing spaces if the preceding field is non-null.  If the document is
loaded from a database, the spaces initially appear correctly, but they can
disappear if the document is manipulated at all.
The problem is demonstrated in the document ConditionalTest.sxw.
1) open this document.
2) Say no to 'Update Links'.
3) Observe the presence of three question marks between the address and author
fields (of the bibliography database).
3) Print the document (to file to save trees).
4) Observe the question marks are still present.
5) Print the document again -  poof ! The question marks disappear.
Comment 1 brh 2002-12-05 19:01:04 UTC
Created attachment 3926 [details]
Document demonstrating the problem
Comment 2 h.ilter 2002-12-09 15:05:42 UTC
Reassigned to ES
Comment 3 eric.savary 2002-12-12 00:53:05 UTC
ES->AMA: Indeed! As described! I have no idea who can be responsible
for this so a choose the nicest developper ever first :-)
Comment 4 michael.brauer 2003-03-12 09:21:14 UTC
.
Comment 5 michael.brauer 2003-03-12 09:21:48 UTC
.
Comment 6 michael.brauer 2003-03-12 09:28:04 UTC
.
Comment 7 Oliver-Rainer Wittmann 2003-03-12 13:37:32 UTC
OD (12.03.2003): accepted.
Comment 8 Oliver-Rainer Wittmann 2003-03-21 14:29:23 UTC
Created attachment 5193 [details]
simple document also showing the defect
Comment 9 Oliver-Rainer Wittmann 2003-03-21 14:34:19 UTC
OD->OS 21.03.2003:
Please take over.
I attached document <testdoc.sxw>, which also shows the defect -
follow the instructions at the beginning of the document.
I already figured out that the database manager doesn't seem to reset
the selection and the position, when its asked for the value of the
identifier.
Comment 10 Oliver Specht 2003-03-24 09:29:59 UTC
There are at least two different problems. 
One is that when database data is merged into the document and a field
update is done after that the database selection is not re-used. That
problem is fixed. 

The other one is what is done after a document like the attached
ConditionalTest.sxw is loaded and printed. 
Printing initiates an update of the fields. By evaluating the fields'
expressions an access to the database takes place. As the database
selection that created the document prior to saving it is not
restorable the wrong data is used for the expressions. 
This could only be prevented by storing all accessed data from the
database which is not a good idea ;-)

Another possibility is to detect such missing database selection and
providing an error message for it. Additionally locking of the fields
could be provided that allows to print the document 'as is' without
changing any of the fields and other expressions. 
Comment 11 Oliver Specht 2003-03-24 09:37:29 UTC
Filed issue 12608 as enhancement, brh set as CC.

The fix is contained in cws os7 in sw/source/ui/dbui/dbmgr.cxx
Comment 12 Oliver Specht 2003-04-02 09:16:09 UTC
os7 is available on so-cwsserv03, wntmsci9 and unxsols4.pro
Comment 13 eric.savary 2003-04-02 13:02:59 UTC
ES: verified in os7
Comment 14 eric.savary 2003-04-02 13:03:19 UTC
verified
Comment 15 thorsten.ziehm 2003-05-20 10:26:17 UTC
All tasks are verified in OOo1.1 Beta2