Bug 43326

Summary: TransferTab mixes used formulas
Product: LibreOffice Reporter: Laurent Godard <lgodard.libre>
Component: CalcAssignee: Markus Mohrhard <markus.mohrhard>
Status: RESOLVED FIXED    
Severity: major CC: lgodard.libre, LibreOffice, markus.mohrhard
Priority: medium    
Version: Master old -3.6   
Hardware: Other   
OS: Linux (All)   
Whiteboard: target:3.6 target:3.5
Crash report or crash signature: Regression By:
Attachments: first file to import
second file to import

Description Laurent Godard 2011-11-29 01:44:36 UTC
Created attachment 53943 [details]
first file to import

2 files (file1, file8 attached), defining there own range names, and use them in formulas

using a macro, transferttab in an empty document (see below)

result :

- the sheets are transfered (ok)
- the formulas of the sheets coming from file1 are now using wrong formula (see D1_sheet1$A2 - the formula is d8_name1 instead of d1_name1)

note also that named ranges are not defined correctly (based on the index of the sheets, and not names) and d1_name1 and d8_name1 points on the same sheet. maybe the source of the problem ?

'------------------
sub problemFormulatranfertTab

	docDest = thisComponent
	
	files = array("/home/lgodard/Bureau/DTEPoc/calc/transfertTab/file1.ods","/home/lgodard/Bureau/DTEPoc/calc/transfertTab/file8.ods")

	for c = 0 to 1
		
		docSrc = stardesktop.loadComponentFromUrl(convertToUrl(files(c)),"_blank",0, array())
		
		for i = 0 to docSrc.sheets.count-1
		
			nomfeuille = docSrc.sheets(i)
			
			if not docDest.sheets.hasByName(nomFeuille.name) then
			
				docDest.sheets.importSheet(docSrc, nomfeuille.name,docDest.sheets.count)
			
			endif
		
		next i
	
		docSrc.close(true)
	
	next c	

	print "ok"

end sub
Comment 1 Laurent Godard 2011-11-29 01:45:10 UTC
Created attachment 53944 [details]
second file to import
Comment 2 Laurent Godard 2011-11-29 01:54:17 UTC
the problem may be due to ill-imported ranegnames, may be first address this point
Comment 3 Rainer Bielefeld Retired 2011-11-29 22:26:52 UTC
@Laurent Godard:
Please contribute
- build ID of the Version you used for your tests.
- info concerning last Version where you saw it working correctly
- a sample document containing the macro and a button to proceed
Comment 4 Markus Mohrhard 2011-11-29 23:07:23 UTC
Rainer this is a developer bug for me.

Laurent is another developer.
Comment 5 Rainer Bielefeld Retired 2011-12-18 07:45:57 UTC
@Markus:
Please feel free to reassign (or reset Assignee to default) if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 6 Markus Mohrhard 2011-12-18 10:23:25 UTC
Already discussed he underlying problem with Eike and Kohei. I hope that all this will make it into 3.5.

Some changs for this are already in master.
Comment 7 Markus Mohrhard 2011-12-20 22:49:46 UTC
should be fixed now in master, will discuss backporting with eike