Kaydet (Commit) 02d52734 authored tarafından Caolán McNamara's avatar Caolán McNamara

fix fatal attempt to export kde302504-1.odt to docx

the enhanced-path contains decimal points so the
last element is a double not an integer

Change-Id: I90be76a2d4cb90ee7a904aa72fe65770c675fc53
(cherry picked from commit aeb52a85)
üst 7d60c076
......@@ -2289,14 +2289,15 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
for ( int j = 0; j < aPairs.getLength(); ++j )
{
if ( aPairs[j].First.Value.get<sal_Int32>() < nXMin )
nXMin = aPairs[j].First.Value.get<sal_Int32>();
if ( aPairs[j].Second.Value.get<sal_Int32>() < nYMin )
nYMin = aPairs[j].Second.Value.get<sal_Int32>();
if ( aPairs[j].First.Value.get<sal_Int32>() > nXMax )
nXMax = aPairs[j].First.Value.get<sal_Int32>();
if ( aPairs[j].Second.Value.get<sal_Int32>() > nYMax )
nYMax = aPairs[j].Second.Value.get<sal_Int32>();
sal_Int32 nCandidate(0);
if ((aPairs[j].First.Value >>= nCandidate) && nCandidate < nXMin)
nXMin = nCandidate;
if ((aPairs[j].Second.Value >>= nCandidate) && nCandidate < nYMin)
nYMin = nCandidate;
if ((aPairs[j].First.Value >>= nCandidate) && nCandidate > nXMax)
nXMax = nCandidate;
if ((aPairs[j].Second.Value >>= nCandidate) && nCandidate > nYMax)
nYMax = nCandidate;
}
mpFS->startElementNS( XML_a, XML_path,
XML_w, I64S( nXMax - nXMin ),
......
......@@ -831,6 +831,12 @@ DECLARE_OOXMLEXPORT_TEST(testOO67471, "ooo67471-2.odt")
assertXPathContent(pXmlDoc, "(//w:t)[2]", "B");
}
DECLARE_OOXMLEXPORT_TEST(testKDE302504, "kde302504-1.odt")
{
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
assertXPath(pXmlDoc, "//v:shape", "ID", "KoPathShape");
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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