Issue 103160

Summary: Text variables references lose their content when pasted in a new document
Product: Writer Reporter: Rainer Bielefeld <rainerbielefeld_ooo_qa>
Component: editingAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 3.1Keywords: oooqa
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Test kit and PDF to show my results
none
Master and slave after copy/paste might help to understand reasons for the problem
none
testcase.zip none

Description Rainer Bielefeld 2009-06-27 17:42:03 UTC
I saw that problem with "Ooo 3.1.0 WIN XP multilingual version German UI
activated  [OOO310m11 (Build 9399)]"

when you copy and paste user variables, formatting of those variables will be
destroyed.

Steps to reproduce:

0. Download and unpack test kit
1. Open "Master.odm"
2. Open "Slave.odt" by double click in Master document view
3. Go back to Master document
4. Mark complete second page
5. <cntrl>+<c> for "Copy"
6. Change to end of page 2 of "Slave.odt"
7. <cntrl>+<v> (you can also use 'Paste special -> OOo Writer')
8. Save "Slave.odt"
9. Change to "Master.odm"
10. context menu in slave documents pane / update all
11. Go to page 3
    Expected: variables should be shown as on page 2
    Actual: Most Variables shown as "0" (pls.  See test kit)

This issue might be related to Issue 81766.
This problem is very annoying because of unfixed Issue 94073.
Comment 1 Rainer Bielefeld 2009-06-27 17:45:21 UTC
Created attachment 63246 [details]
Test kit and PDF to show my results
Comment 2 eric.savary 2009-06-29 10:48:48 UTC
I cannot reproduce what you describe and what the PDF shows.
On the page 3 (linked document) I get the fields filled as they are on the other
pages.

I don't think (?) this is due to the fact I am using Vista.
Could you please try this in a plain English version or at least in the English UI?

Comment 3 Rainer Bielefeld 2009-06-29 11:23:53 UTC
I checked "test_kit.zip" with "Ooo Dev 3.2.0 multilingual version English UI WIN
XP: [DEV300m50 (Build 9406)]" and also the reported effect. Application data
this version uses is different from application data 3.1 uses (as ou know).

I will check with a plain English version (and new application data) soon!
Comment 4 Rainer Bielefeld 2009-06-30 17:52:10 UTC
I checked "test_kit.zip" with "Ooo 3.1.0 WIN XP German version  [OOO310m11
(Build 9399)]", what is installed on an other PC (Laptop) installed using an
other install-exe and see just the same problem. Test with a fresh new
installation will follow when the next DEV build will be available.

@es:
Can you please send to me your test result documents?
Comment 5 Rainer Bielefeld 2009-06-30 18:06:14 UTC
I also checked "test_kit.zip" with "Ooo Dev 3.2.0 English installation WIN XP:
[DEV300m49 (Build 9403)]" and also see the problem. This Installation has been
created with completely new user application folder and without any import from
OOo 2
Comment 6 Rainer Bielefeld 2009-06-30 19:25:17 UTC
And the same on a 3rd PC with "Ooo 3.0.0 (DE) German version [OOO300m9
(Build9358)]". That should reach for NEW
Comment 7 Rainer Bielefeld 2009-06-30 19:28:52 UTC
Created attachment 63293 [details]
Master and slave after copy/paste might help to understand reasons for the problem
Comment 8 eric.savary 2009-06-30 20:13:30 UTC
@rainerbielefeld: I'm sorry for having let you check this in so many versions! :(

Now I see why I couldn't reproduce it: I probably copied the content of page 1
where the variables are *defined* and not page 2, where they are *referenced*!

Now I could surround the problem: "Show variable" field whose variable are
*formatted as text* will not preserve their content when pasted in a new document.

(I'll attach 2 documents)
- Open "master.odm"
- copy the line "Show Variable 123 ABC"
- Edit the sub document "sub.odt"
- Paste in the document
-> you get "Show Variable 123 " (with an empty field which should contain "ABC")

Note: when saving the sub doc and reloading the master document, the line
appears in the master document as "Show Variable 123 0".
So one might think the format has changed to "number" (showing "0") but editing
the variable (from the sub doc inside of the master document) still shows "Text"
as format.

So 2 problems with probably the same root cause:
- Text variables references lose their content when pasted in a new document
while numeric variables references don't
- Such variables are displayed as "number" though the UI (Edit dialog) still
shows "Text"

@rainerbielefeld: Do you see a difference with issue 103160 in which you talk
about this issue? ;) Duplicates?

@OS: Please have a look. 
Comment 9 eric.savary 2009-06-30 20:17:16 UTC
Created attachment 63295 [details]
testcase.zip
Comment 10 eric.savary 2009-06-30 20:20:23 UTC
@rainerbielefeld: Grrrr! Of course I meant, your comments in *issue 94073* about
the current one.
Comment 11 Rainer Bielefeld 2009-07-01 06:13:42 UTC
I found some further details that might be useful for fixing the bug:

The problem will not appear if you add some steps to my first report.

0. Download and unpack test kit
1. Open "Master.odm"
2. Open "Slave.odt" by double click in Master document view
3. Go back to Master document
3a. Mark complete area "Create Variables" with variables definition 
    until "HRP22"
3b. <cntrl>+<c> for "Copy"
3c. Change to top of "Slave.odt"
3d. Menu _Insert -> Page break'
3e Change to top of document
3f Modify Formatting from "heading" to "default"
4. Mark complete second page
5. <cntrl>+<c> for "Copy"
6. Change to end of page 2 of "Slave.odt"
7. <cntrl>+<v> (you can also use 'Paste special -> OOo Writer')
   you will see that all Variables will be inserted correctly
7a delete first page of "Slave.odt"
8. Save "Slave.odt"
9. Change to "Master.odm"
10. context menu in slave documents pane / update all
11. Go to page 3
    Expected: variables should be shown as on page 2
    actual: as expected!

Further information:
The problem also is visible when I create a second Slave and copy/paste "View
Variables" area from Slave created due to comments in this comment. 
1.1.4 worked without problem
Same as or related to Issue 81766? That one was never really "works for me"

@es:
Issue 94073 requests to have Variables of a master document available in the
dialog 'Insert -> Field -> others -> Variables -> Show variable' of a slave
document. This request will stay with a fixed  Issue 103160, but Issue 103160
might be a problem for creation of Issue 94073 enhancement.
Comment 12 eric.savary 2009-07-16 23:17:17 UTC
*** Issue 103590 has been marked as a duplicate of this issue. ***
Comment 13 Marcus 2017-05-20 11:15:26 UTC
Reset assigne to the default "issues@openoffice.apache.org".