From 138bd3d656c30911d5f45a8b6804e50857f6b30c Mon Sep 17 00:00:00 2001 From: Tushar Bende Date: Wed, 22 Jan 2014 20:00:17 +0530 Subject: [PATCH] fdo#72563 : PAGEREF field tag not preserved during Roundtrip There was a problem that in case of TOC,PAGEREF field tag was not preserved inside during Roundtrip. Reason found, there was no code support to handle PAGEREF in export. Added code support in export code to handle PAGEREF. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7605 Change-Id: I1785360684d8772b71c3f45fdd2c654f94777067 --- .../extras/ooxmlexport/data/testPageref.docx | Bin 0 -> 26321 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 16 +++++- sw/source/filter/ww8/docxattributeoutput.cxx | 47 +++++++++++++++++- sw/source/filter/ww8/docxattributeoutput.hxx | 3 +- 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/testPageref.docx diff --git a/sw/qa/extras/ooxmlexport/data/testPageref.docx b/sw/qa/extras/ooxmlexport/data/testPageref.docx new file mode 100644 index 0000000000000000000000000000000000000000..65ca38aedd573e6a9d8817b03bc055ad9d23594a GIT binary patch literal 26321 zcmeFY1D7mamn~ejU3JQ~ZQHhO`;=|lwoci$ZQHI>zV-CmeMfiS{>JwM?v0UiXXaWv zcI?P8=UTC2MaoM7gP;I_0YCr%01yCl_gC2G00ICo{Cq_QfB@1Gva@wIv31r{_OLf` z(xG*?vBoa|0V2->0Q%|w|F-{&e}Tc|3E2U91d$i<51~UE%S~5*1k3S&5hO}LB(0U4 zMl_$X9KrV&>9;Th$;=3(`tT(8&BWjQ((4@ou=l(Zy%M#JnW&dfNBM3; z4MF`B2AzQc)%f+9cdu)wCaCx(i&u($$6BICaS#Hfm6Rq?xqG2sQfBQb9c zdVI%<-5}t+)Gg}nPT?f$>C?98&K^RD10<+Bwop`cL6HeCXh7#VzwOUMrR*-^lup`7 zr(DF*m3!R_g_;_6^fz9F=Y*^AGsD7S`x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odeTab[0]; OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content)); CPPUNIT_ASSERT(contents.match("15")); @@ -2845,6 +2845,20 @@ DECLARE_OOXMLEXPORT_TEST(testGradientFillPreservation, "gradient-fill-preservati "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr/a:satMod", "val", "160000"); } + +DECLARE_OOXMLEXPORT_TEST(testPageref, "testPageref.docx") +{ + // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip + // This test case is to verify that PAGEREF tag is coming with proper values inside tag. + xmlDocPtr pXmlDoc = parseExport(); + if (!pXmlDoc) + return; + xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:hyperlink/w:r[3]/w:instrText"); + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; + OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content)); + CPPUNIT_ASSERT(contents.match("PAGEREF _Toc355095261 \\h")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 6e0b428896a1..46d862e322ce 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -685,10 +685,35 @@ void DocxAttributeOutput::EndRun() // write the run start + the run content m_pSerializer->mergeTopMarks(); // merges the "actual run start" - // append the actual run end m_pSerializer->endElementNS( XML_w, XML_r ); + if(m_startedHyperlink && m_hyperLinkAnchor != "") + { + OUString sToken; + m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS( XML_w, XML_fldChar, + FSNS( XML_w, XML_fldCharType ), "begin", + FSEND ); + m_pSerializer->endElementNS( XML_w, XML_fldChar ); + m_pSerializer->endElementNS( XML_w, XML_r ); + + + m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + sToken = "PAGEREF " + m_hyperLinkAnchor + " \\h"; // '\h' Creates a hyperlink to the bookmarked paragraph. + DoWriteCmd( sToken ); + m_pSerializer->endElementNS( XML_w, XML_r ); + + + // Write the Field separator + m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_fldChar, + FSNS( XML_w, XML_fldCharType ), "separate", + FSEND ); + m_pSerializer->endElementNS( XML_w, XML_r ); + + } + WritePostponedMath(); WritePendingPlaceholder(); @@ -701,6 +726,17 @@ void DocxAttributeOutput::EndRun() { if ( m_startedHyperlink ) { + if( m_endPageRef ) + { + // Hyperlink is started and fldchar "end" needs to be written for PAGEREF + m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_fldChar, + FSNS( XML_w, XML_fldCharType ), "end", + FSEND ); + m_pSerializer->endElementNS( XML_w, XML_r ); + m_endPageRef = false; + } + m_pSerializer->endElementNS( XML_w, XML_hyperlink ); m_startedHyperlink = false; } @@ -935,6 +971,7 @@ void DocxAttributeOutput::CmdField_Impl( FieldInfos& rInfos ) sToken = sToken.replaceAll("NNNN", "dddd"); sToken = sToken.replaceAll("NN", "ddd"); } + // Write the Field command DoWriteCmd( sToken ); @@ -1402,6 +1439,8 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge bool bBookmarkOnly = AnalyzeURL( rUrl, rTarget, &sUrl, &sMark ); + m_hyperLinkAnchor = sMark; + if ( !sMark.isEmpty() && !bBookmarkOnly ) { m_rExport.OutputField( NULL, ww::eHYPERLINK, sUrl ); @@ -1461,6 +1500,11 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge bool DocxAttributeOutput::EndURL() { m_closeHyperlinkInThisRun = true; + if(m_hyperLinkAnchor != "") + { + m_endPageRef = true; + m_hyperLinkAnchor = ""; + } return true; } @@ -6172,6 +6216,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_pHyperlinkAttrList( NULL ), m_pColorAttrList( NULL ), m_pBackgroundAttrList( NULL ), + m_endPageRef( false ), m_pFootnotesList( new ::docx::FootnotesList() ), m_pEndnotesList( new ::docx::FootnotesList() ), m_footnoteEndnoteRefTag( 0 ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 3466f3dd2dfc..5c628c6f50ad 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -685,7 +685,8 @@ private: ::sax_fastparser::FastAttributeList *m_pColorAttrList; /// Attributes of the paragraph background ::sax_fastparser::FastAttributeList *m_pBackgroundAttrList; - + OUString m_hyperLinkAnchor; + bool m_endPageRef; ::docx::FootnotesList *m_pFootnotesList; ::docx::FootnotesList *m_pEndnotesList; int m_footnoteEndnoteRefTag;