Kaydet (Commit) 981e2dcd authored tarafından Vinaya Mandke's avatar Vinaya Mandke Kaydeden (comit) Miklos Vajna

FILESAVE [DOCX] Hyperlink text is getting lost after RT fdo#81492

The fldData was getting added as instrText. It was handled as CT_Text and
hence appended to the fieldCommand in DomainMapper_Impl::AppendFieldCommand.
So in RT file the <w:instrText> has both the instrText and the fldData, from the
original file. This causes the hyperlink visual loss in RT file.

WordprocessingML Page# 5011  [ ISO/IEC 29500-1:2012 ]
WordprocessingML Page# 5552 [ ECMA-376 Part 1 ]
fldData has been removed. So ignore it while importing

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/10441

Change-Id: Ic2c06f1eb66639d36f3a27ae79181cdbde21b43c
üst 787ed0a2
......@@ -559,6 +559,12 @@ DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx")
}
}
DECLARE_OOXMLEXPORT_TEST(testFdo81492, "fdo81492.docx")
{
if (xmlDocPtr pXmlDoc = parseExport())
assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:instrText", "ADDIN EN.CITE.DATA");
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -745,6 +745,14 @@ void OOXMLFastContextHandler::positionOffset(const OUString & sText)
::writerfilter::dmapper::PositionHandler::setPositionOffset( sText, inPositionV );
}
void OOXMLFastContextHandler::fldData(const OUString & /* sText */)
{
// ignore --- As per ECMA fldData has been removed.
// WordprocessingML Page# 5011 [ ISO/IEC 29500-1:2012 ]
// WordprocessingML Page# 5552 [ ECMA-376 Part 1 ]
// Hack, so that fldData is not interpreted as field Command
}
void OOXMLFastContextHandler::alignH(const OUString & sText)
{
if (isForwardEvents())
......
......@@ -195,6 +195,7 @@ public:
void endOfParagraph();
void text(const OUString & sText);
void positionOffset(const OUString & sText);
void fldData(const OUString & sText);
void alignH(const OUString & sText);
void alignV(const OUString & sText);
void positivePercentage(const OUString& rText);
......
......@@ -400,6 +400,8 @@ def factoryChooseAction(actionNode):
ret.append(" pHandler->alignH(sText);")
elif actionNode.getAttribute("action") == "alignV":
ret.append(" pHandler->alignV(sText);")
elif actionNode.getAttribute("action") == "fldData":
ret.append(" pHandler->fldData(sText);")
elif actionNode.getAttribute("action") == "tokenproperty":
ret.append(" OOXMLFastHelper<OOXMLIntegerValue>::newProperty(pHandler, %s, pHandler->getToken());" % idToLabel("ooxml:token"))
else:
......
......@@ -17243,7 +17243,7 @@
<group>
<optional>
<element name="fldData">
<ref name="CT_Text"/>
<ref name="CT_FLDData"/>
</element>
</optional>
<zeroOrMore>
......@@ -17340,7 +17340,7 @@
<choice>
<optional>
<element name="fldData">
<ref name="CT_Text"/>
<ref name="CT_FLDData"/>
</element>
</optional>
<optional>
......@@ -17405,6 +17405,9 @@
<ref name="ST_String"/>
</attribute>
</define>
<define name="CT_FLDData">
<ref name="ST_String"/>
</define>
<define name="CT_FFData">
<oneOrMore>
<choice>
......@@ -24444,6 +24447,9 @@
<action name="start" action="fieldsep"/>
<action name="end" action="fieldend"/>
</resource>
<resource name="CT_FLDData" resource="Stream">
<action name="characters" action="fldData"/>
</resource>
<resource name="CT_FFData" resource="Properties">
<element name="name" tokenid="ooxml:CT_FFData_name"/>
<element name="enabled" tokenid="ooxml:CT_FFData_enabled"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment