Bug 72563

Summary: PAGEREF field flags are not preserved in Roundtrip file
Product: LibreOffice Reporter: Rajashri <rajashri.udhoji>
Component: LibreOfficeAssignee: Tushar Bende <tushar.bende>
Status: RESOLVED FIXED    
Severity: major    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=134801
Whiteboard: target:4.3.0
Crash report or crash signature: Regression By:
Attachments: Document to test PAGEREF
RoundTrip Document after fix
Original document for PAGEREF
This is the file which is getting corrupt after RT with patch applied
This is the file which is getting corrupt after RT with patch applied

Description Rajashri 2013-12-10 12:33:45 UTC
Created attachment 90570 [details]
Document to test PAGEREF

PAGEREF filed is not preserved in RT.
Comment 1 Tushar Bende 2014-01-23 06:02:50 UTC
There is a problem that in case of TOC,PAGEREF field tag was not preserved inside <hyperlink> during Roundtrip.
Reason found is there is support available in export.

Steps to reproduce:
1. Open the attached file "y13.01.07 - Table of Contents - Same Even and Odd.docx" in LibreOffice.
2. Click File -> Save As (Microsoft Word 2007/2010 (.docx))
3. Open in MS Office 2010 and compare with original document
Expected:
1. File should contain PAGEREF field tag inside <hyperlink>.
Actual:
PAGEREF field tag missing inside <hyperlink>.
Comment 2 Tushar Bende 2014-01-23 06:49:56 UTC
Created attachment 92638 [details]
RoundTrip Document after fix
Comment 3 Tushar Bende 2014-01-23 06:54:52 UTC
This is how PAGEREF field tag is coming in <w:hyperlink> after fix

<w:hyperlink w:anchor="_Toc355095261">
	<w:r>
		<w:rPr>
			<w:webHidden />
			<w:rStyle w:val="IndexLink" />
		</w:rPr>
		<w:t>
			Heading 1

		</w:t>
	</w:r>
	<w:r>
		<w:fldChar w:fldCharType="begin" />
	</w:r>
	<w:r>
		<w:instrText>
			PAGEREF _Toc355095261 \h

		</w:instrText>
	</w:r>
	<w:r>
		<w:fldChar w:fldCharType="separate" />
	</w:r>
	<w:r>
		<w:rPr>
			<w:rStyle w:val="IndexLink" />
			<w:vanish w:val="false" />
		</w:rPr>
		<w:tab />
		<w:t>
			2

		</w:t>
	</w:r>
	<w:r>
		<w:fldChar w:fldCharType="end" />
	</w:r>
</w:hyperlink>
Comment 4 Commit Notification 2014-02-07 09:44:25 UTC
Tushar Bende committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=138bd3d656c30911d5f45a8b6804e50857f6b30c

fdo#72563 : PAGEREF field tag not preserved during Roundtrip



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Nikhil Walvekar 2014-02-11 08:37:24 UTC
Created attachment 93847 [details]
Original document for PAGEREF

merged patch corrupting this document.
Comment 6 Miklos Vajna 2014-02-11 08:41:56 UTC
OK, as requested I'll just revert the fix in master till we have a better one.
Comment 7 Tushar Bende 2014-02-11 08:50:15 UTC
Created attachment 93849 [details]
This is the file which is getting corrupt after RT with patch applied
Comment 8 Commit Notification 2014-02-11 08:51:37 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=be7d41a2bed7f424f38e2e7340f9b98c3f4f8fa2

Revert "fdo#72563 : PAGEREF field tag not preserved during Roundtrip"



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Tushar Bende 2014-02-11 08:52:02 UTC
Created attachment 93851 [details]
This is the file which is getting corrupt after RT with patch applied
Comment 10 Commit Notification 2014-02-26 10:44:32 UTC
Tushar Bende committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0fb3bdc5d3aa47a61affc67b20bdbb775808fb66

fdo#72563 : PAGEREF field tag not preserved during Roundtrip



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.