Issue 9880 - Conditional text fields referencing database fields behave erratically
Summary: Conditional text fields referencing database fields behave erratically
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: eric.savary
QA Contact: issues@sw
Depends on:
Reported: 2002-12-05 18:58 UTC by brh
Modified: 2013-08-07 14:43 UTC (History)
2 users (show)

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

Document demonstrating the problem (6.84 KB, application/octet-stream)
2002-12-05 19:01 UTC, brh
no flags Details
simple document also showing the defect (5.35 KB, application/octet-stream)
2003-03-21 14:29 UTC, Oliver-Rainer Wittmann
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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
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
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
Comment 15 thorsten.ziehm 2003-05-20 10:26:17 UTC
All tasks are verified in OOo1.1 Beta2