From 81b4ac4f8c405243db5949ea39f2abf8d77c9bb1 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 13 Mar 2012 23:21:33 +0100 Subject: add more code to the chart dumper --- chart2/source/view/inc/ShapeFactory.hxx | 2 ++ chart2/source/view/main/ShapeFactory.cxx | 45 ++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) (limited to 'chart2') diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index 8fe7ba014c2d..f74d51c446ef 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -67,6 +67,8 @@ public: void writeAttribute(const char* pAttrName, const com::sun::star::drawing::PointSequenceSequence& rPoints); void writeAttribute(const char* pAttrName, const com::sun::star::drawing::PolyPolygonShape3D& rPoints); void writeAttribute(const char* pAttrName, const com::sun::star::drawing::PolyPolygonBezierCoords& rCoords); + void writePointElement(const com::sun::star::awt::Point& rPoint); + void writeDoubleSequence(const char* pName, const com::sun::star::drawing::DoubleSequenceSequence& rSequence); void endElement(); }; diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index f9589c28c401..4e35e1717b98 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -104,14 +104,55 @@ void DumpHelper::writeAttribute(const char* pAttrName, const sal_Int32 nValue) std::cout << pAttrName << " " << nValue << std::endl; } -void DumpHelper::writeAttribute(const char* pAttrName, const drawing::PointSequenceSequence& ) +void DumpHelper::writePointElement(const awt::Point& rPoint) +{ + std::cout << "Point" << " " << rPoint.X << "," << rPoint.Y << std::endl; +} + +void DumpHelper::writeDoubleSequence(const char* pName, const drawing::DoubleSequenceSequence& rSequence) +{ + writeElement(pName); + writeElement("OuterSequence"); + sal_Int32 nLength1 = rSequence.getLength(); + for (sal_Int32 i = 0; i < nLength1; ++i) + { + writeElement("InnerSequence"); + const uno::Sequence& aInnerSequence = rSequence[i]; + sal_Int32 nLength2 = aInnerSequence.getLength(); + for( sal_Int32 j = 0; j < nLength2; ++j) + { + std::cout << "Value: " << aInnerSequence[j]; + } + endElement(); + } + endElement(); +} + +void DumpHelper::writeAttribute(const char* pAttrName, const drawing::PointSequenceSequence& rSequence) { std::cout << pAttrName << " " << std::endl; + sal_Int32 nLength1 = rSequence.getLength(); + writeElement("OuterSequence"); + for (sal_Int32 i = 0; i < nLength1; ++i) + { + writeElement("InnerSequence"); + const uno::Sequence& aInnerSequence = rSequence[i]; + sal_Int32 nLength2 = aInnerSequence.getLength(); + for( sal_Int32 j = 0; j < nLength2; ++j) + { + writePointElement(aInnerSequence[j]); + } + endElement(); + } + endElement(); } -void DumpHelper::writeAttribute(const char* pAttrName, const drawing::PolyPolygonShape3D& ) +void DumpHelper::writeAttribute(const char* pAttrName, const drawing::PolyPolygonShape3D& rShape) { std::cout << pAttrName << " " << std::endl; + writeDoubleSequence("SequenceX", rShape.SequenceX); + writeDoubleSequence("SequenceY", rShape.SequenceY); + writeDoubleSequence("SequenceZ", rShape.SequenceZ); } void DumpHelper::writeAttribute(const char* pAttrName, const drawing::PolyPolygonBezierCoords& ) -- cgit