diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-13 23:21:33 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-14 02:40:17 +0100 |
commit | 81b4ac4f8c405243db5949ea39f2abf8d77c9bb1 (patch) | |
tree | 7212f30977b886597e48d4b0e499f01cc1cc7cf5 /chart2 | |
parent | 785e07b3ac5ca80957b9042f42f4cb1f8b03644e (diff) |
add more code to the chart dumper
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/inc/ShapeFactory.hxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 45 |
2 files changed, 45 insertions, 2 deletions
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<double>& 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<awt::Point>& 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& ) |