oox/source/export/drawingml.cxx | 17 +++++++++-------- sw/qa/extras/ooxmlexport/data/kde302504-1.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 6 ++++++ 3 files changed, 15 insertions(+), 8 deletions(-)
New commits: commit aeb52a855d55475ff2e74f5308ae580dce3e069f Author: Caolán McNamara <caol...@redhat.com> Date: Wed Jun 10 12:20:31 2015 +0100 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 diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 236678a..e510eb8 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -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 ), diff --git a/sw/qa/extras/ooxmlexport/data/kde302504-1.odt b/sw/qa/extras/ooxmlexport/data/kde302504-1.odt new file mode 100644 index 0000000..d0b7c60 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/kde302504-1.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index b63d755..67ad8df 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -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: */
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits