[Libreoffice-commits] core.git: oox/source sw/qa
Caolán McNamara
caolanm at redhat.com
Wed Jun 10 05:22:18 PDT 2015
oox/source/export/drawingml.cxx | 41 +++++++++++++++++++-------
sw/qa/extras/ooxmlexport/data/kde216114-1.odt |binary
sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 6 +++
3 files changed, 36 insertions(+), 11 deletions(-)
New commits:
commit 80fbd731d8b8b101a10466a4d16d4867e9de968b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 10 13:05:51 2015 +0100
similarly fix fatal export of kde216114-1.odt to docx
Change-Id: I78478de91473681fd8d836293dabe7b790dda516
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index e510eb8..df535f8 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2282,9 +2282,11 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
}
else
{
- sal_Int32 nXMin = aPairs[0].First.Value.get<sal_Int32>();
+ sal_Int32 nXMin(0);
+ aPairs[0].First.Value >>= nXMin;
sal_Int32 nXMax = nXMin;
- sal_Int32 nYMin = aPairs[0].Second.Value.get<sal_Int32>();
+ sal_Int32 nYMin(0);
+ aPairs[0].Second.Value >>= nYMin;
sal_Int32 nYMax = nYMin;
for ( int j = 0; j < aPairs.getLength(); ++j )
@@ -2321,9 +2323,13 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
{
mpFS->startElementNS( XML_a, XML_moveTo, FSEND );
+ sal_Int32 nX(0), nY(0);
+ aPairs[nPairIndex].First.Value >>= nX;
+ aPairs[nPairIndex].Second.Value >>= nY;
+
mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, I64S( aPairs[nPairIndex].First.Value.get<sal_Int32>() ),
- XML_y, I64S( aPairs[nPairIndex].Second.Value.get<sal_Int32>() ),
+ XML_x, I64S(nX),
+ XML_y, I64S(nY),
FSEND );
mpFS->endElementNS( XML_a, XML_moveTo );
@@ -2333,9 +2339,14 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
case drawing::EnhancedCustomShapeSegmentCommand::LINETO :
{
mpFS->startElementNS( XML_a, XML_lnTo, FSEND );
+
+ sal_Int32 nX(0), nY(0);
+ aPairs[nPairIndex].First.Value >>= nX;
+ aPairs[nPairIndex].Second.Value >>= nY;
+
mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, I64S( aPairs[nPairIndex].First.Value.get<sal_Int32>() ),
- XML_y, I64S( aPairs[nPairIndex].Second.Value.get<sal_Int32>() ),
+ XML_x, I64S(nX),
+ XML_y, I64S(nY),
FSEND );
mpFS->endElementNS( XML_a, XML_lnTo );
nPairIndex++;
@@ -2346,9 +2357,13 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
mpFS->startElementNS( XML_a, XML_cubicBezTo, FSEND );
for( sal_uInt8 l = 0; l <= 2; ++l )
{
+ sal_Int32 nX(0), nY(0);
+ aPairs[nPairIndex+l].First.Value >>= nX;
+ aPairs[nPairIndex+l].Second.Value >>= nY;
+
mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, I64S( aPairs[nPairIndex+l].First.Value.get<sal_Int32>() ),
- XML_y, I64S( aPairs[nPairIndex+l].Second.Value.get<sal_Int32>() ),
+ XML_x, I64S( nX ),
+ XML_y, I64S( nY ),
FSEND );
}
@@ -2381,10 +2396,14 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
mpFS->startElementNS( XML_a, XML_quadBezTo, FSEND );
for( sal_uInt8 l = 0; l < 2; ++l )
{
+ sal_Int32 nX(0), nY(0);
+ aPairs[nPairIndex+l].First.Value >>= nX;
+ aPairs[nPairIndex+l].Second.Value >>= nY;
+
mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, I64S( aPairs[nPairIndex+l].First.Value.get<sal_Int32>() ),
- XML_y, I64S( aPairs[nPairIndex+l].Second.Value.get<sal_Int32>() ),
- FSEND );
+ XML_x, I64S( nX ),
+ XML_y, I64S( nY ),
+ FSEND );
}
mpFS->endElementNS( XML_a, XML_quadBezTo );
diff --git a/sw/qa/extras/ooxmlexport/data/kde216114-1.odt b/sw/qa/extras/ooxmlexport/data/kde216114-1.odt
new file mode 100644
index 0000000..536da72
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/kde216114-1.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 67ad8df..14be93e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -837,6 +837,12 @@ DECLARE_OOXMLEXPORT_TEST(testKDE302504, "kde302504-1.odt")
assertXPath(pXmlDoc, "//v:shape", "ID", "KoPathShape");
}
+DECLARE_OOXMLEXPORT_TEST(testKDE216114, "kde216114-1.odt")
+{
+ if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
+ assertXPath(pXmlDoc, "//w:pict", 1);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list