[Libreoffice-commits] .: 5 commits - chart2/Library_chartview.mk chart2/source offapi/com offapi/UnoApi_offapi.mk sc/CppunitTest_sc_chart_regression_test.mk sc/qa

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Tue Mar 27 18:36:04 PDT 2012


 chart2/Library_chartview.mk                      |    5 
 chart2/source/model/main/ChartModel.cxx          |   12 
 chart2/source/model/main/ChartModel.hxx          |   14 -
 chart2/source/view/charttypes/AreaChart.cxx      |    6 
 chart2/source/view/charttypes/VSeriesPlotter.cxx |   37 ---
 chart2/source/view/inc/DumpHelper.hxx            |   71 -----
 chart2/source/view/inc/ShapeFactory.hxx          |   13 -
 chart2/source/view/inc/VSeriesPlotter.hxx        |    4 
 chart2/source/view/main/ChartView.cxx            |  113 +++++++++
 chart2/source/view/main/ChartView.hxx            |   10 
 chart2/source/view/main/DumpHelper.cxx           |  137 -----------
 chart2/source/view/main/ShapeFactory.cxx         |  278 -----------------------
 offapi/UnoApi_offapi.mk                          |    3 
 offapi/com/sun/star/modules.idl                  |    3 
 offapi/com/sun/star/qa/XDumper.idl               |   65 +++++
 sc/CppunitTest_sc_chart_regression_test.mk       |  150 ++++++++++++
 sc/qa/extras/regression-test.cxx                 |  167 +++++++++++++
 sc/qa/unit/data/ods/testChart.ods                |binary
 18 files changed, 539 insertions(+), 549 deletions(-)

New commits:
commit 608ac02d2d469f881659b0726315528d1185e673
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Mar 28 03:32:24 2012 +0200

    add chart regression test
    
    test is based on qa::Dumper and dumps the layout of the chart

diff --git a/sc/CppunitTest_sc_chart_regression_test.mk b/sc/CppunitTest_sc_chart_regression_test.mk
new file mode 100644
index 0000000..295015d
--- /dev/null
+++ b/sc/CppunitTest_sc_chart_regression_test.mk
@@ -0,0 +1,150 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2011 Red Hat, Inc., Caolán McNamara <caolanm at redhat.com>
+#  (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_CppunitTest_CppunitTest,sc_chart_regression_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_chart_regression_test, \
+    sc/qa/extras/regression-test \
+))
+
+$(eval $(call gb_CppunitTest_add_linked_libs,sc_chart_regression_test, \
+    avmedia \
+    basegfx \
+    comphelper \
+    cppu \
+    cppuhelper \
+    drawinglayer \
+    editeng \
+    fileacc \
+    for \
+    forui \
+    i18nisolang1 \
+    msfilter \
+    oox \
+    sal \
+    salhelper \
+    sax \
+    sb \
+    sc \
+    sfx \
+    sot \
+    svl \
+    svt \
+    svx \
+    svxcore \
+	test \
+    tl \
+    tk \
+    ucbhelper \
+	unotest \
+    utl \
+    vbahelper \
+    vcl \
+    xo \
+	$(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_chart_regression_test,\
+    -I$(SRCDIR)/sc/source/ui/inc \
+    -I$(SRCDIR)/sc/inc \
+    $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_add_api,sc_chart_regression_test,\
+    offapi \
+    oovbaapi \
+    udkapi \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,sc_chart_regression_test))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,sc_chart_regression_test,\
+    oovbaapi \
+    types \
+))
+
+$(eval $(call gb_CppunitTest_add_components,sc_chart_regression_test,\
+    basic/util/sb \
+    chart2/source/controller/chartcontroller \
+    chart2/source/model/chartmodel \
+    chart2/source/tools/charttools \
+    chart2/source/view/chartview \
+    comphelper/util/comphelp \
+    configmgr/source/configmgr \
+    dbaccess/util/dba \
+    embeddedobj/util/embobj \
+    eventattacher/source/evtatt \
+    fileaccess/source/fileacc \
+    filter/source/config/cache/filterconfig1 \
+    forms/util/frm \
+    framework/util/fwk \
+    i18npool/util/i18npool \
+    oox/util/oox \
+    package/source/xstor/xstor \
+    package/util/package2 \
+    sax/source/expatwrap/expwrap \
+    sax/source/fastparser/fastsax \
+    sc/util/sc \
+    sc/util/scd \
+    sc/util/scfilt \
+    sc/util/vbaobj \
+    scaddins/source/analysis/analysis \
+    scaddins/source/datefunc/date \
+    scripting/source/basprov/basprov \
+    scripting/util/scriptframe \
+    sfx2/util/sfx \
+    sot/util/sot \
+    svl/source/fsstor/fsstorage \
+    svl/util/svl \
+    svx/util/svx \
+    toolkit/util/tk \
+    ucb/source/core/ucb1 \
+    ucb/source/ucp/file/ucpfile1 \
+    ucb/source/ucp/tdoc/ucptdoc1 \
+    unotools/util/utl \
+    unoxml/source/rdf/unordf \
+    unoxml/source/service/unoxml \
+    xmloff/util/xo \
+))
+
+$(eval $(call gb_CppunitTest_set_args,sc_chart_regression_test,\
+    --headless \
+    --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) module:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool) xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/unittest/registry)" \
+))
+    # .../spool is required for the (somewhat strange) filter configuration
+
+# we need to
+# a) explicitly depend on library msword because it is not implied by a link
+#    relation
+# b) explicitly depend on the sc resource files needed at unit-test runtime
+$(call gb_CppunitTest_get_target,sc_chart_regression_test) : \
+    $(WORKDIR)/AllLangRes/sc \
+    $(call gb_Library_get_target,localedata_en) \
+    $(call gb_Library_get_target,scfilt) \
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/qa/extras/regression-test.cxx b/sc/qa/extras/regression-test.cxx
new file mode 100644
index 0000000..89d9d87
--- /dev/null
+++ b/sc/qa/extras/regression-test.cxx
@@ -0,0 +1,167 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2010 Red Hat, Inc., Caolán McNamara <caolanm at redhat.com>
+ *  (initial developer)
+ * Copyright (C) 2011 Markus Mohrhard <markus.mohrhard at googlemail.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <sal/config.h>
+#include <test/bootstrapfixture.hxx>
+#include <unotest/macros_test.hxx>
+#include <rtl/strbuf.hxx>
+#include <osl/file.hxx>
+#include <rtl/oustringostreaminserter.hxx>
+
+#include <sfx2/app.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
+#include <svl/intitem.hxx>
+
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/table/XTableChartsSupplier.hpp>
+#include <com/sun/star/table/XTableCharts.hpp>
+#include <com/sun/star/table/XTableChart.hpp>
+#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/qa/XDumper.hpp>
+
+#include <basic/sbxdef.hxx>
+
+#include "docsh.hxx"
+#include "patattr.hxx"
+#include "scitems.hxx"
+#include "document.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+/* Implementation of Macros test */
+
+class ScChartRegressionTest : public test::BootstrapFixture, public unotest::MacrosTest
+{
+public:
+    ScChartRegressionTest();
+
+    void createFileURL(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath);
+
+    virtual void setUp();
+    virtual void tearDown();
+
+    void test();
+
+    CPPUNIT_TEST_SUITE(ScChartRegressionTest);
+    CPPUNIT_TEST(test);
+    CPPUNIT_TEST_SUITE_END();
+
+private:
+    uno::Reference<uno::XInterface> m_xCalcComponent;
+    rtl::OUString m_aBaseString;
+};
+
+
+void ScChartRegressionTest::createFileURL(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath)
+{
+    rtl::OUString aSep(RTL_CONSTASCII_USTRINGPARAM("/"));
+    rtl::OUStringBuffer aBuffer( getSrcRootURL() );
+    aBuffer.append(m_aBaseString).append(aSep).append(aFileExtension);
+    aBuffer.append(aSep).append(aFileBase).append(aFileExtension);
+    rFilePath = aBuffer.makeStringAndClear();
+}
+
+void ScChartRegressionTest::test()
+{
+    rtl::OUString aFileName;
+    createFileURL( "testChart.", "ods", aFileName);
+    uno::Reference< com::sun::star::lang::XComponent > xComponent = loadFromDesktop(aFileName);
+
+    CPPUNIT_ASSERT(xComponent.is());
+
+    uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComponent, UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xDoc.is());
+
+    uno::Reference< container::XIndexAccess > xIA(xDoc->getSheets(), UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xIA.is());
+
+    uno::Reference< table::XTableChartsSupplier > xChartSupplier( xIA->getByIndex(0), UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xChartSupplier.is());
+
+    uno::Reference< table::XTableCharts > xCharts = xChartSupplier->getCharts();
+    CPPUNIT_ASSERT(xCharts.is());
+
+    uno::Reference< container::XIndexAccess > xIACharts(xCharts, UNO_QUERY_THROW);
+    uno::Reference< table::XTableChart > xChart( xIACharts->getByIndex(0), UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xChart.is());
+
+    uno::Reference< document::XEmbeddedObjectSupplier > xEmbObjectSupplier(xChart, UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xEmbObjectSupplier.is());
+
+    uno::Reference< lang::XComponent > xChartComp( xEmbObjectSupplier->getEmbeddedObject(), UNO_QUERY_THROW );
+    CPPUNIT_ASSERT(xChartComp.is());
+
+    uno::Reference< chart2::XChartDocument > xChartDoc ( xChartComp, UNO_QUERY_THROW );
+    CPPUNIT_ASSERT(xChartDoc.is());
+
+    uno::Reference< qa::XDumper > xDumper( xChartDoc, UNO_QUERY_THROW );
+    CPPUNIT_ASSERT(xDumper.is());
+
+    rtl::OUString aDump = xDumper->dump();
+    std::cout << aDump << std::endl;
+}
+
+ScChartRegressionTest::ScChartRegressionTest()
+      : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data"))
+{
+}
+
+void ScChartRegressionTest::setUp()
+{
+    test::BootstrapFixture::setUp();
+
+    // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
+    // which is a private symbol to us, gets called
+    m_xCalcComponent =
+        getMultiServiceFactory()->createInstance(rtl::OUString(
+        RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.SpreadsheetDocument")));
+    CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
+    mxDesktop = Reference<com::sun::star::frame::XDesktop>( getMultiServiceFactory()->createInstance(
+                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
+    CPPUNIT_ASSERT(mxDesktop.is());
+}
+
+void ScChartRegressionTest::tearDown()
+{
+    uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose();
+    test::BootstrapFixture::tearDown();
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ScChartRegressionTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/data/ods/testChart.ods b/sc/qa/unit/data/ods/testChart.ods
new file mode 100644
index 0000000..956f57d
Binary files /dev/null and b/sc/qa/unit/data/ods/testChart.ods differ
commit 9560fb799006c2560c0ab75fd1dccc9e4dba7d68
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Mar 28 03:28:32 2012 +0200

    revert old test idea

diff --git a/chart2/Library_chartview.mk b/chart2/Library_chartview.mk
index 24ba681..974df61 100644
--- a/chart2/Library_chartview.mk
+++ b/chart2/Library_chartview.mk
@@ -97,7 +97,6 @@ $(eval $(call gb_Library_add_exception_objects,chartview,\
     chart2/source/view/main/Clipping \
     chart2/source/view/main/DataPointSymbolSupplier \
     chart2/source/view/main/DrawModelWrapper \
-    chart2/source/view/main/DumpHelper \
     chart2/source/view/main/LabelPositionHelper \
     chart2/source/view/main/Linear3DTransformation \
     chart2/source/view/main/PlotterBase \
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 2c2e827..bcc2456 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -598,9 +598,6 @@ void AreaChart::createShapes()
     if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()))
         return;
 
-    if(mbDump)
-        maDumpHelper.writeElement("AreaChart-Shapes");
-
     //the text labels should be always on top of the other series shapes
     //for area chart the error bars should be always on top of the other series shapes
 
@@ -1005,9 +1002,6 @@ void AreaChart::createShapes()
     }
     */
 
-    if(mbDump)
-        maDumpHelper.endElement();
-
     //remove and delete series-group-shape if empty
 
     //... todo
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 57d0d08..4f7ee80 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -158,7 +158,6 @@ VSeriesPlotter::VSeriesPlotter( const uno::Reference<XChartType>& xChartTypeMode
         , m_xColorScheme()
         , m_pExplicitCategoriesProvider(0)
         , m_bPointsWereSkipped(false)
-        , mbDump(ENABLE_DUMP)
 {
     OSL_POSTCOND(m_xChartTypeModel.is(),"no XChartType available in view, fallback to default values may be wrong");
 }
@@ -436,14 +435,6 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
 {
     uno::Reference< drawing::XShape > xTextShape;
 
-    if(mbDump)
-    {
-        maDumpHelper.writeElement("DataLabel");
-        maDumpHelper.writeAttribute("Value", fValue);
-        maDumpHelper.writeAttribute("SumValue", fSumValue);
-        maDumpHelper.writePointElement(rScreenPosition2D);
-    }
-
     try
     {
         awt::Point aScreenPosition2D(rScreenPosition2D);
@@ -2197,19 +2188,10 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
         default:
             break;
     };
-
-    if(mbDump)
-    {
-        maDumpHelper.writeElement("LegendSymbolForSeries");
-    }
-
     Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
         xTarget, eLegendSymbolStyle, xShapeFactory
             , rSeries.getPropertiesOfSeries(), ePropType, aExplicitSymbol ));
 
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -2262,19 +2244,9 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
         }
     }
 
-    if (mbDump)
-    {
-        maDumpHelper.writeElement("LegendSymbolForPoint");
-    }
-
     Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
         xTarget, eLegendSymbolStyle, xShapeFactory, xPointSet, ePropType, aExplicitSymbol ));
 
-    if (mbDump)
-    {
-        maDumpHelper.endElement();
-    }
-
     return xShape;
 }
 
@@ -2292,11 +2264,6 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
     if( ! ( xShapeFactory.is() && xTarget.is() && xContext.is() ) )
         return aResult;
 
-    if(mbDump)
-    {
-        maDumpHelper.writeElement("LegendEntriesForSeries");
-    }
-
     try
     {
         ViewLegendEntry aEntry;
@@ -2413,10 +2380,6 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
     {
         ASSERT_EXCEPTION( ex );
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return aResult;
 }
 
diff --git a/chart2/source/view/inc/DumpHelper.hxx b/chart2/source/view/inc/DumpHelper.hxx
deleted file mode 100644
index a083d34..0000000
--- a/chart2/source/view/inc/DumpHelper.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * Version: MPL 1.1 / GPLv3+ / LGPLv3+
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License or as specified alternatively below. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Major Contributor(s):
- * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard at googlemail.com> (initial developer)
- *
- * All Rights Reserved.
- *
- * For minor contributions see the git repository.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-
-#ifndef _CHART2_DUMPHELPER_HXX
-#define _CHART2_DUMPHELPER_HXX
-
-#include <com/sun/star/drawing/Direction3D.hpp>
-#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/drawing/PointSequenceSequence.hpp>
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
-#include <com/sun/star/awt/Point.hpp>
-#include <com/sun/star/drawing/DoubleSequenceSequence.hpp>
-
-#define ENABLE_DUMP 0
-
-namespace chart
-{
-
-class DumpHelper
-{
-private:
-    //XmlTextWriterPtr pWriter;
-
-public:
-   //void writeStripe(const Stripe& rStripe);
-
-   void writeElement(const char*);
-   void writeAttribute(const char* pAttrName, const char* pAttrValue);
-   void writeAttribute(const char* pAttrName, const com::sun::star::drawing::Position3D& rPosition);
-   void writeAttribute(const char* pAttrName, const rtl::OUString& rName);
-   void writeAttribute(const char* pAttrName, const sal_Int32);
-   void writeAttribute(const char* pAttrName, const com::sun::star::drawing::Direction3D& rPosition);
-   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();
-};
-
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 9bcaf9b..176f76a 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -28,7 +28,6 @@
 #ifndef _CHART2_VIEW_SHAPEFACTORY_HXX
 #define _CHART2_VIEW_SHAPEFACTORY_HXX
 
-#include "DumpHelper.hxx"
 #include "PropertyMapper.hxx"
 #include "VLineProperties.hxx"
 #include "BaseGFXHelper.hxx"
@@ -37,14 +36,12 @@
 #include <com/sun/star/drawing/HomogenMatrix.hpp>
 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
 #include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
 #include <com/sun/star/drawing/Position3D.hpp>
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/graphic/XGraphic.hpp>
 
-
 //.............................................................................
 namespace chart
 {
@@ -54,11 +51,8 @@ class Stripe;
 class ShapeFactory
 {
 public:
-    ShapeFactory(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> xFactory):
-        m_xShapeFactory(xFactory),
-        mbDump(ENABLE_DUMP)
-    {
-    }
+    ShapeFactory(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> xFactory)
+        {m_xShapeFactory = xFactory;}
 
     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
         createGroup2D(
@@ -253,9 +247,6 @@ private:
     //member:
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>
         m_xShapeFactory;
-
-    bool mbDump;
-    DumpHelper maDumpHelper;
 };
 
 //.............................................................................
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index e82defa..8ffa1c8 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -28,7 +28,6 @@
 #ifndef _CHART2_VSERIESPLOTTER_HXX
 #define _CHART2_VSERIESPLOTTER_HXX
 
-#include "DumpHelper.hxx"
 #include "PlotterBase.hxx"
 #include "VDataSeries.hxx"
 #include "LabelAlignment.hxx"
@@ -444,9 +443,6 @@ protected: //member
     ::com::sun::star::uno::Sequence< sal_Int32 >    m_aCoordinateSystemResolution;
     bool m_bPointsWereSkipped;
 
-    DumpHelper maDumpHelper;
-    bool mbDump;
-
 private: //member
     typedef std::map< sal_Int32 , ExplicitScaleData > tSecondaryValueScales;
     tSecondaryValueScales   m_aSecondaryValueScales;
diff --git a/chart2/source/view/main/DumpHelper.cxx b/chart2/source/view/main/DumpHelper.cxx
deleted file mode 100644
index 2f1b1f8..0000000
--- a/chart2/source/view/main/DumpHelper.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * Version: MPL 1.1 / GPLv3+ / LGPLv3+
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License or as specified alternatively below. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Major Contributor(s):
- * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard at googlemail.com> (initial developer)
- *
- * All Rights Reserved.
- *
- * For minor contributions see the git repository.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-
-#include "DumpHelper.hxx"
-
-#include <iostream>
-#include <rtl/oustringostreaminserter.hxx>
-
-using namespace com::sun::star;
-
-namespace chart
-{
-/*
-void DumpHelper::writeStripe(const Stripe& rStripe)
-{
-    std::cout << "Stripe" << std::endl;
-}*/
-
-void DumpHelper::writeElement(const char* pName)
-{
-    std::cout << pName << std::endl;
-}
-
-void DumpHelper::writeAttribute(const char* pAttrName, const rtl::OUString& rName)
-{
-    std::cout << pAttrName << " " << rName << std::endl;
-}
-
-void DumpHelper::writeAttribute(const char* pAttrName, const char* pAttrValue)
-{
-    std::cout << pAttrName << " " << pAttrValue << std::endl;
-}
-
-void DumpHelper::writeAttribute(const char* pAttrName, const drawing::Position3D& rPos)
-{
-    std::cout << pAttrName << " " << rPos.PositionX << "," << rPos.PositionY << "," << rPos.PositionZ << std::endl;
-}
-
-void DumpHelper::writeAttribute(const char* pAttrName, const drawing::Direction3D& rDirection)
-{
-    std::cout << pAttrName << " " << rDirection.DirectionX << "," << rDirection.DirectionY << "," << rDirection.DirectionZ << std::endl;
-}
-
-void DumpHelper::writeAttribute(const char* pAttrName, const sal_Int32 nValue)
-{
-    std::cout << pAttrName << " " << nValue << std::endl;
-}
-
-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& 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& )
-{
-    std::cout << pAttrName << " " << std::endl;
-}
-
-void DumpHelper::endElement()
-{
-    std::cout << "EndElement" << std::endl;
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index e62d165..47da6f6 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -42,6 +42,7 @@
 #include <com/sun/star/drawing/NormalsKind.hpp>
 #include <com/sun/star/drawing/PointSequence.hpp>
 #include <com/sun/star/drawing/PolygonKind.hpp>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
 #include <com/sun/star/drawing/ProjectionMode.hpp>
 #include <com/sun/star/drawing/ShadeMode.hpp>
 #include <com/sun/star/drawing/TextFitToSizeType.hpp>
@@ -59,8 +60,6 @@
 #include <basegfx/matrix/b3dhommatrix.hxx>
 
 #include <algorithm>
-#include <iostream>
-#include <rtl/oustringostreaminserter.hxx>
 
 using namespace ::com::sun::star;
 using ::com::sun::star::uno::Reference;
@@ -462,20 +461,8 @@ uno::Reference<drawing::XShape>
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-    {
-        maDumpHelper.writeElement("Cube");
-    }
-
     uno::Reference<drawing::XShape> xShape = impl_createCube( xTarget, rPosition, rSize, nRotateZAngleHundredthDegree, bRounded );
     uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
-
-    if (mbDump)
-    {
-        maDumpHelper.endElement();
-    }
-
     if( xSourceProp.is())
         PropertyMapper::setMappedProperties( xProp, xSourceProp, rPropertyNameMap );
     return xShape;
@@ -517,9 +504,8 @@ uno::Reference<drawing::XShape>
                 , uno::makeAny( nPercentDiagonal ) );
 
             //Polygon
-            uno::Any aAny = createPolyPolygon_Cube( rSize, double(nPercentDiagonal)/200.0, bRounded);
             xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D )
-                , aAny );
+                , createPolyPolygon_Cube( rSize, double(nPercentDiagonal)/200.0,bRounded) );
 
             //Matrix for position
             {
@@ -533,16 +519,6 @@ uno::Reference<drawing::XShape>
                 xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX )
                     , uno::makeAny(aHM) );
             }
-
-            if(mbDump)
-            {
-                maDumpHelper.writeAttribute("depth",static_cast<sal_Int32>(fDepth));
-                maDumpHelper.writeAttribute("PercentDiagonal",nPercentDiagonal);
-                drawing::PolyPolygonShape3D aPP;
-                aAny >>= aPP;
-                maDumpHelper.writeAttribute("Polygon", aPP);
-                maDumpHelper.writeAttribute("Matrix","");
-            }
         }
         catch( const uno::Exception& e )
         {
@@ -713,23 +689,12 @@ uno::Reference<drawing::XShape>
     aStripe4.SetManualNormal( aNormalsStripe4.getNormal() );
 
     const bool bFlatNormals = false;
-
-    if (mbDump)
-    {
-        maDumpHelper.writeElement("Pyramid");
-    }
-
     ShapeFactory::createStripe( xGroup, aStripe1, xSourceProp, rPropertyNameMap, bDoubleSided, nRotatedTexture, bFlatNormals );
     ShapeFactory::createStripe( xGroup, aStripe2, xSourceProp, rPropertyNameMap, bDoubleSided, nRotatedTexture, bFlatNormals );
     ShapeFactory::createStripe( xGroup, aStripe3, xSourceProp, rPropertyNameMap, bDoubleSided, nRotatedTexture, bFlatNormals );
     ShapeFactory::createStripe( xGroup, aStripe4, xSourceProp, rPropertyNameMap, bDoubleSided, nRotatedTexture, bFlatNormals );
     ShapeFactory::createStripe( xGroup, aStripeBottom, xSourceProp, rPropertyNameMap, bDoubleSided, nRotatedTexture, bFlatNormals );
 
-    if (mbDump)
-    {
-        maDumpHelper.endElement();
-    }
-
     return Reference< drawing::XShape >( xGroup, uno::UNO_QUERY );
 }
 
@@ -752,14 +717,6 @@ uno::Reference<drawing::XShape>
     if( !xTarget.is() )
         return 0;
 
-    if(mbDump)
-    {
-        if (bCylinder)
-            maDumpHelper.writeElement("Cylinder");
-        else
-            maDumpHelper.writeElement("Cone");
-    }
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
             m_xShapeFactory->createInstance( C2U(
@@ -812,28 +769,12 @@ uno::Reference<drawing::XShape>
             //Reduced lines
             xProp->setPropertyValue( C2U( UNO_NAME_3D_REDUCED_LINE_GEOMETRY )
                 , uno::makeAny((sal_Bool)sal_True) );
-
-            if(mbDump)
-            {
-                maDumpHelper.writeAttribute("PercentDiagonal", nPercentDiagonal);
-                drawing::PolyPolygonShape3D aPP;
-                aPPolygon >>= aPP;
-                maDumpHelper.writeAttribute("Polygon", aPP);
-                maDumpHelper.writeAttribute("Matrix","");
-                maDumpHelper.writeAttribute("SegmentsHor",CHART_3DOBJECT_SEGMENTCOUNT);
-                maDumpHelper.writeAttribute("SegmentsVert", static_cast<sal_Int32>(nVerticalSegmentCount));
-                maDumpHelper.writeAttribute("ReducedLine","true");
-            }
         }
         catch( const uno::Exception& e )
         {
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if (mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -1032,11 +973,6 @@ uno::Reference< drawing::XShape >
                 C2U("com.sun.star.drawing.ClosedBezierShape") ), uno::UNO_QUERY );
     xTarget->add(xShape); //need to add the shape before setting of properties
 
-    if(mbDump)
-    {
-        maDumpHelper.writeElement("PieSegement2D");
-    }
-
     //set properties
     uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
     OSL_ENSURE(xProp.is(), "created shape offers no XPropertySet");
@@ -1055,11 +991,6 @@ uno::Reference< drawing::XShape >
                 , aTransformationFromUnitCircle, fAngleSubdivisionRadian );
 
             xProp->setPropertyValue( C2U( "PolyPolygonBezier" ), uno::makeAny( aCoords ) );
-
-            if(mbDump)
-            {
-                maDumpHelper.writeAttribute("PolyPolygonBezier", aCoords);
-            }
         }
         catch( const uno::Exception& e )
         {
@@ -1067,11 +998,6 @@ uno::Reference< drawing::XShape >
         }
     }
 
-    if( mbDump )
-    {
-        maDumpHelper.endElement();
-    }
-
     return xShape;
 }
 
@@ -1094,10 +1020,6 @@ uno::Reference< drawing::XShape >
     while(fUnitCircleWidthAngleDegree<0)
         fUnitCircleWidthAngleDegree += 360.0;
 
-    if(mbDump)
-    {
-        maDumpHelper.writeElement("PieSegment");
-    }
     //create shape
     uno::Reference< drawing::XShape > xShape(
         m_xShapeFactory->createInstance( C2U(
@@ -1153,27 +1075,12 @@ uno::Reference< drawing::XShape >
                 , uno::makeAny( drawing::TextureProjectionMode_PARALLEL ) );
             xProp->setPropertyValue( C2U( UNO_NAME_3D_TEXTURE_PROJ_Y )
                 , uno::makeAny( drawing::TextureProjectionMode_OBJECTSPECIFIC ) );
-
-            if (mbDump)
-            {
-                maDumpHelper.writeAttribute("depth",static_cast<sal_Int32>(fDepth));
-                maDumpHelper.writeAttribute("PercentDiagonal",nPercentDiagonal);
-                maDumpHelper.writeAttribute("Polygon", aPoly);
-                maDumpHelper.writeAttribute("DoubleSided", "true");
-                maDumpHelper.writeAttribute("ReducedLines", "true");
-                maDumpHelper.writeAttribute("TextureProjectionModeY", drawing::TextureProjectionMode_PARALLEL);
-                maDumpHelper.writeAttribute("TextureProjectionModeX", drawing::TextureProjectionMode_OBJECTSPECIFIC);
-            }
         }
         catch( const uno::Exception& e )
         {
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -1193,9 +1100,6 @@ uno::Reference< drawing::XShape >
     if( !xTarget.is() )
         return 0;
 
-    if (mbDump)
-        maDumpHelper.writeElement("Stripe");
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
             m_xShapeFactory->createInstance( C2U(
@@ -1233,22 +1137,6 @@ uno::Reference< drawing::XShape >
             xProp->setPropertyValue( C2U( UNO_NAME_3D_DOUBLE_SIDED )
                 , uno::makeAny(bDoubleSided) );
 
-            if(mbDump)
-            {
-                drawing::PolyPolygonShape3D aPP3;
-                rStripe.getPolyPolygonShape3D() >>= aPP3;
-                maDumpHelper.writeAttribute("Polygon", aPP3);
-                drawing::PolyPolygonShape3D aPP;
-                rStripe.getTexturePolygon(nRotatedTexture) >>= aPP;
-                maDumpHelper.writeAttribute("TexturePolygon", aPP);
-                drawing::PolyPolygonShape3D aPP2;
-                rStripe.getNormalsPolygon() >>= aPP2;
-                maDumpHelper.writeAttribute("NormalsPolygon", aPP2);
-                maDumpHelper.writeAttribute("NormalsKind", drawing::NormalsKind_FLAT);
-                maDumpHelper.writeAttribute("LineOnly", "false");
-                maDumpHelper.writeAttribute("DoubleSided", bDoubleSided);
-            }
-
             if( xSourceProp.is())
                 PropertyMapper::setMappedProperties( xProp, xSourceProp, rPropertyNameMap );
         }
@@ -1257,10 +1145,6 @@ uno::Reference< drawing::XShape >
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -1275,9 +1159,6 @@ uno::Reference< drawing::XShape >
     if( !rPolyPolygon.SequenceX.getLength())
         return 0;
 
-    if(mbDump)
-        maDumpHelper.writeElement("Area3D");
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
         m_xShapeFactory->createInstance( C2U(
@@ -1322,25 +1203,12 @@ uno::Reference< drawing::XShape >
                 xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX )
                     , uno::makeAny(aHM) );
             }
-
-            if (mbDump)
-            {
-                maDumpHelper.writeAttribute("depth", static_cast<sal_Int32>(fDepth));
-                maDumpHelper.writeAttribute("PercentDiagonal", nPercentDiagonal);
-                maDumpHelper.writeAttribute("Polygon", rPolyPolygon);
-                maDumpHelper.writeAttribute("DoubleSided", "true");
-                maDumpHelper.writeAttribute("Matrix","");
-            }
         }
         catch( const uno::Exception& e )
         {
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -1924,9 +1792,6 @@ uno::Reference< drawing::XShape >
     if( !xTarget.is() )
         return 0;
 
-    if(mbDump)
-        maDumpHelper.writeElement("Symbol2D");
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
         m_xShapeFactory->createInstance( C2U(
@@ -1954,23 +1819,12 @@ uno::Reference< drawing::XShape >
             //FillColor
             xProp->setPropertyValue( C2U( UNO_NAME_FILLCOLOR )
                 , uno::makeAny( nFillColor ) );
-
-            if(mbDump)
-            {
-                maDumpHelper.writeAttribute("Polygon", aPoints);
-                maDumpHelper.writeAttribute("LineColor", nBorderColor);
-                maDumpHelper.writeAttribute("FillColor", nFillColor);
-            }
         }
         catch( const uno::Exception& e )
         {
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -1987,9 +1841,6 @@ uno::Reference< drawing::XShape >
     // @todo: change this to a rectangle shape with a fill bitmap for
     // performance reasons (ask AW, said CL)
 
-    if(mbDump)
-        maDumpHelper.writeElement("Graphic2D");
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
         m_xShapeFactory->createInstance( C2U(
@@ -2005,12 +1856,6 @@ uno::Reference< drawing::XShape >
             rPosition.PositionZ );
         xShape->setPosition( Position3DToAWTPoint( aCenterPosition ));
         xShape->setSize( Direction3DToAWTSize( rSize ));
-
-        if(mbDump)
-        {
-            maDumpHelper.writeAttribute("Position", aCenterPosition);
-            maDumpHelper.writeAttribute("Size", rSize);
-        }
     }
     catch( const uno::Exception & e )
     {
@@ -2029,10 +1874,6 @@ uno::Reference< drawing::XShape >
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -2044,13 +1885,6 @@ uno::Reference< drawing::XShapes >
         return 0;
     try
     {
-        if(mbDump)
-        {
-            maDumpHelper.writeElement("Group2D");
-            if(!aName.isEmpty())
-                maDumpHelper.writeAttribute("Name", aName);
-        }
-
         //create and add to target
         uno::Reference< drawing::XShape > xShape(
                     m_xShapeFactory->createInstance( C2U(
@@ -2067,9 +1901,6 @@ uno::Reference< drawing::XShapes >
         }
 
         //return
-        if (mbDump)
-            maDumpHelper.endElement();
-
         uno::Reference< drawing::XShapes > xShapes =
             uno::Reference<drawing::XShapes>( xShape, uno::UNO_QUERY );
         return xShapes;
@@ -2078,10 +1909,6 @@ uno::Reference< drawing::XShapes >
     {
         ASSERT_EXCEPTION( e );
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return 0;
 }
 
@@ -2093,13 +1920,6 @@ uno::Reference< drawing::XShapes >
         return 0;
     try
     {
-        if(mbDump)
-        {
-            maDumpHelper.writeElement("Group3D");
-            if(!aName.isEmpty())
-                maDumpHelper.writeAttribute("Name", aName);
-        }
-
         //create shape
         uno::Reference< drawing::XShape > xShape(
                 m_xShapeFactory->createInstance( C2U(
@@ -2121,9 +1941,6 @@ uno::Reference< drawing::XShapes >
                     ::basegfx::B3DHomMatrix aM;
                     xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX )
                         , uno::makeAny(B3DHomMatrixToHomogenMatrix(aM)) );
-
-                    if(mbDump)
-                        maDumpHelper.writeAttribute("Matrix", "");
                 }
                 catch( const uno::Exception& e )
                 {
@@ -2139,20 +1956,12 @@ uno::Reference< drawing::XShapes >
         //return
         uno::Reference< drawing::XShapes > xShapes =
                 uno::Reference<drawing::XShapes>( xShape, uno::UNO_QUERY );
-
-        if(mbDump)
-            maDumpHelper.endElement();
-
         return xShapes;
     }
     catch( const uno::Exception& e )
     {
         ASSERT_EXCEPTION( e );
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return 0;
 }
 
@@ -2164,9 +1973,6 @@ uno::Reference< drawing::XShape >
     if( !xTarget.is() )
         return 0;
 
-    if(mbDump)
-        maDumpHelper.writeElement("Circle2D");
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
         m_xShapeFactory->createInstance( C2U(
@@ -2181,12 +1987,6 @@ uno::Reference< drawing::XShape >
             rPosition.PositionZ );
         xShape->setPosition( Position3DToAWTPoint( aCenterPosition ));
         xShape->setSize( Direction3DToAWTSize( rSize ));
-
-        if(mbDump)
-        {
-            maDumpHelper.writeAttribute("Position", aCenterPosition);
-            maDumpHelper.writeAttribute("Size", rSize);
-        }
     }
     catch( const uno::Exception & e )
     {
@@ -2203,19 +2003,12 @@ uno::Reference< drawing::XShape >
             drawing::CircleKind eKind = drawing::CircleKind_FULL;
             xProp->setPropertyValue( C2U( UNO_NAME_CIRCKIND )
                 , uno::makeAny( eKind ) );
-
-            if(mbDump)
-                maDumpHelper.writeAttribute("CircleKind", eKind);
         }
         catch( const uno::Exception& e )
         {
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -2230,9 +2023,6 @@ uno::Reference< drawing::XShape >
     if(!rPoints.SequenceX.getLength())
         return NULL;
 
-    if(mbDump)
-        maDumpHelper.writeElement("Line3D");
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
         m_xShapeFactory->createInstance( C2U(
@@ -2274,37 +2064,12 @@ uno::Reference< drawing::XShape >
                 xProp->setPropertyValue( C2U( UNO_NAME_LINECOLOR )
                     , rLineProperties.Color );
                     //, uno::makeAny( sal_Int32( Color(COL_RED).GetColor()) ) );
-
-            if(mbDump)
-            {
-                sal_Int16 nTransparence = 0;
-                rLineProperties.Transparence >>= nTransparence;
-                maDumpHelper.writeAttribute("Transparency", nTransparence);
-                drawing::LineStyle aLineStyle;
-                rLineProperties.LineStyle >>= aLineStyle;
-                maDumpHelper.writeAttribute("LineStyle", aLineStyle);
-                sal_Int32 nWidth = 0;
-                rLineProperties.Width >>= nWidth;
-                maDumpHelper.writeAttribute("LineWidth", nWidth);
-                sal_Int32 nColor = 0;
-                rLineProperties.Color >>= nColor;
-                maDumpHelper.writeAttribute("LineColor", nColor);
-                rtl::OUString aDashName;
-                rLineProperties.DashName >>= aDashName;
-                maDumpHelper.writeAttribute("LineDashName", aDashName);
-                maDumpHelper.writeAttribute("Polygon", rPoints);
-                maDumpHelper.writeAttribute("LineOnly", "true");
-            }
         }
         catch( const uno::Exception& e )
         {
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -2319,9 +2084,6 @@ uno::Reference< drawing::XShape >
     if(!rPoints.getLength())
         return NULL;
 
-    if(mbDump)
-        maDumpHelper.writeElement("Line2D");
-
     //create shape
     uno::Reference< drawing::XShape > xShape(
         m_xShapeFactory->createInstance( C2U(
@@ -2339,9 +2101,6 @@ uno::Reference< drawing::XShape >
             xProp->setPropertyValue( C2U( UNO_NAME_POLYPOLYGON )
                 , uno::makeAny( rPoints ) );
 
-            if(mbDump)
-                maDumpHelper.writeAttribute("Polygon", rPoints);
-
             if(pLineProperties)
             {
                 //Transparency
@@ -2368,25 +2127,6 @@ uno::Reference< drawing::XShape >
                 if(pLineProperties->DashName.hasValue())
                     xProp->setPropertyValue( C2U( "LineDashName" )
                         , pLineProperties->DashName );
-
-                if(mbDump)
-                {
-                    sal_Int16 nTransparence = 0;
-                    pLineProperties->Transparence >>= nTransparence;
-                    maDumpHelper.writeAttribute("Transparency", nTransparence);
-                    drawing::LineStyle aLineStyle;
-                    pLineProperties->LineStyle >>= aLineStyle;
-                    maDumpHelper.writeAttribute("LineStyle", aLineStyle);
-                    sal_Int32 nWidth = 0;
-                    pLineProperties->Width >>= nWidth;
-                    maDumpHelper.writeAttribute("LineWidth", nWidth);
-                    sal_Int32 nColor = 0;
-                    pLineProperties->Color >>= nColor;
-                    maDumpHelper.writeAttribute("LineColor", nColor);
-                    rtl::OUString aDashName;
-                    pLineProperties->DashName >>= aDashName;
-                    maDumpHelper.writeAttribute("LineDashName", aDashName);
-                }
             }
         }
         catch( const uno::Exception& e )
@@ -2394,10 +2134,6 @@ uno::Reference< drawing::XShape >
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
@@ -2470,12 +2206,6 @@ uno::Reference< drawing::XShape >
     if(rText.isEmpty())
         return 0;
 
-    if(mbDump)
-    {
-        maDumpHelper.writeElement("Text");
-        maDumpHelper.writeAttribute("TextValue", rText);
-    }
-
     //create shape and add to page
     uno::Reference< drawing::XShape > xShape(
             m_xShapeFactory->createInstance( C2U(
@@ -2504,10 +2234,6 @@ uno::Reference< drawing::XShape >
             ASSERT_EXCEPTION( e );
         }
     }
-
-    if(mbDump)
-        maDumpHelper.endElement();
-
     return xShape;
 }
 
commit 5d8c9ef5e5945fd166a9e0793b7d31ed679742d4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Mar 28 03:24:47 2012 +0200

    implement the layout dumper for chart2

diff --git a/chart2/Library_chartview.mk b/chart2/Library_chartview.mk
index f9e9703..24ba681 100644
--- a/chart2/Library_chartview.mk
+++ b/chart2/Library_chartview.mk
@@ -115,4 +115,8 @@ $(eval $(call gb_Library_add_exception_objects,chartview,\
     chart2/source/view/main/VTitle \
 ))
 
+$(eval $(call gb_Library_use_externals,chartview,\
+	libxml2 \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index c23dba7..9b67d81 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1357,6 +1357,11 @@ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartM
 rtl::OUString SAL_CALL ChartModel::dump()
     throw (uno::RuntimeException)
 {
+    uno::Reference< qa::XDumper > xDumper(
+            this->createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
+    if (xDumper.is())
+        return xDumper->dump();
+
     return rtl::OUString();
 }
 
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index 40b1dbd..b3bc2eb 100644
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -51,6 +51,7 @@
 #include <com/sun/star/chart2/data/XDataSource.hpp>
 #include <com/sun/star/chart2/XChartTypeTemplate.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/qa/XDumper.hpp>
 
 // public API
 #include <com/sun/star/chart2/data/XDataProvider.hpp>
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 9297cef..250f1c8 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -97,6 +97,9 @@
 #include <com/sun/star/util/XModifiable.hpp>
 #include <com/sun/star/util/XRefreshable.hpp>
 #include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/drawing/XShapeDescriptor.hpp>
 
 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
@@ -106,6 +109,13 @@
 #include <svl/languageoptions.hxx>
 #include <sot/clsids.hxx>
 
+#include <rtl/strbuf.hxx>
+#include <rtl/oustringostreaminserter.hxx>
+
+//libxml2 for dumping
+#include <libxml/xmlwriter.h>
+
+
 //.............................................................................
 namespace chart
 {
@@ -3015,6 +3025,109 @@ uno::Sequence< ::rtl::OUString > ChartView::getAvailableServiceNames() throw (un
     return aServiceNames;
 }
 
+namespace {
+
+#define DEBUG_DUMPER 0
+
+int writeCallback(void* pContext, const char* sBuffer, int nLen)
+{
+    rtl::OStringBuffer* pBuffer = static_cast<rtl::OStringBuffer*>(pContext);
+    pBuffer->append(sBuffer);
+    return nLen;
+}
+
+int closeCallback(void* )
+{
+    return 0;
+}
+
+void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter)
+{
+    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("position"), "%i,%i", rPoint.X, rPoint.Y);
+}
+
+void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter)
+{
+    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("size"), "%ix%i", rSize.Width, rSize.Height);
+}
+
+void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter )
+{
+    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr());
+}
+
+void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter );
+
+void dumpXShape( uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter  )
+{
+    xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) );
+
+    dumpPositionAsAttribute(xShape->getPosition(), xmlWriter);
+    dumpSizeAsAttribute(xShape->getSize(), xmlWriter);
+    uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW);
+    dumpShapeDescriptorAsAttribute(xDescr, xmlWriter);
+
+    uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW );
+    uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames();
+    sal_Int32 nServices = aServiceNames.getLength();
+    for (sal_Int32 i = 0; i < nServices; ++i)
+    {
+        if (aServiceNames[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GroupShape")))
+        {
+            uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW);
+            dumpXShapes(xShapes, xmlWriter);
+        }
+#if DEBUG_DUMPER
+        xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" ));
+        xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr());
+        xmlTextWriterEndElement( xmlWriter );
+#endif
+    }
+
+    xmlTextWriterEndElement( xmlWriter );
+}
+
+void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter )
+{
+    xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) );
+    uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW);
+    sal_Int32 nLength = xIA->getCount();
+    for (sal_Int32 i = 0; i < nLength; ++i)
+    {
+        uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW );
+        dumpXShape( xShape, xmlWriter );
+    }
+
+    xmlTextWriterEndElement( xmlWriter );
+}
+
+}
+
+rtl::OUString ChartView::dump() throw (uno::RuntimeException)
+{
+    impl_updateView();
+    uno::Reference<drawing::XShapes> xPageShapes( ShapeFactory(m_xShapeFactory)
+        .getOrCreateChartRootShape( m_xDrawPage ) );
+
+    if (!xPageShapes.is())
+        return rtl::OUString();
+
+    rtl::OStringBuffer aString;
+    xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL );
+    xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer );
+    xmlTextWriterSetIndent( xmlWriter, 1 );
+
+    xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL );
+
+    dumpXShapes( xPageShapes, xmlWriter );
+
+    xmlTextWriterEndDocument( xmlWriter );
+    xmlFreeTextWriter( xmlWriter );
+
+
+    return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
+}
+
 //.............................................................................
 } //namespace chart
 //.............................................................................
diff --git a/chart2/source/view/main/ChartView.hxx b/chart2/source/view/main/ChartView.hxx
index 32beb46..8321c03 100644
--- a/chart2/source/view/main/ChartView.hxx
+++ b/chart2/source/view/main/ChartView.hxx
@@ -30,7 +30,7 @@
 
 #include "chartview/ExplicitValueProvider.hxx"
 #include "ServiceMacros.hxx"
-#include <cppuhelper/implbase9.hxx>
+#include <cppuhelper/implbase10.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 
 // header for class SfxListener
@@ -47,6 +47,7 @@
 #include <com/sun/star/util/XModifyListener.hpp>
 #include <com/sun/star/util/XModeChangeBroadcaster.hpp>
 #include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/qa/XDumper.hpp>
 
 #include <vector>
 #include <boost/shared_ptr.hpp>
@@ -70,7 +71,7 @@ The view than changes to state dirty. The view can be updated with call 'update'
 The View is not responsible to handle single user events (that is instead done by the ChartWindow).
 */
 
-class ChartView : public ::cppu::WeakImplHelper9<
+class ChartView : public ::cppu::WeakImplHelper10<
     ::com::sun::star::lang::XInitialization
         , ::com::sun::star::lang::XServiceInfo
         , ::com::sun::star::datatransfer::XTransferable
@@ -84,6 +85,7 @@ class ChartView : public ::cppu::WeakImplHelper9<
         ,::com::sun::star::util::XUpdatable
         ,::com::sun::star::beans::XPropertySet
         ,::com::sun::star::lang::XMultiServiceFactory
+        ,::com::sun::star::qa::XDumper
         >
         , public ExplicitValueProvider
         , private SfxListener
@@ -182,6 +184,10 @@ public:
     virtual ::sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aIdentifier )
             throw (::com::sun::star::uno::RuntimeException);
 
+    // XDumper
+    virtual rtl::OUString SAL_CALL dump()
+            throw(::com::sun::star::uno::RuntimeException);
+
 private: //methods
     ChartView();
 
commit 74b274602a5a76b949f6d1a521b343688693090b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Mar 27 20:42:51 2012 +0200

    add interface XDumper for qa/automated testing

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 1220adc..f9aee07 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3007,6 +3007,9 @@ $(eval $(call gb_UnoApiTarget_add_idlfiles,offapi,offapi/com/sun/star/resource,\
 	XStringResourceWithLocation \
 	XStringResourceWithStorage \
 ))
+$(eval $(call gb_UnoApiTarget_add_idlfiles,offapi,offapi/com/sun/star/qa,\
+    	XDumper \
+))
 $(eval $(call gb_UnoApiTarget_add_idlfiles,offapi,offapi/com/sun/star/scanner,\
 	ScanError \
 	ScannerContext \
diff --git a/offapi/com/sun/star/modules.idl b/offapi/com/sun/star/modules.idl
index 6ef7dca..421d4c7 100644
--- a/offapi/com/sun/star/modules.idl
+++ b/offapi/com/sun/star/modules.idl
@@ -142,6 +142,9 @@ module rendering {};
 /// Interfaces to access (UI) resource files.
 module resource {};
 
+/// Interfaces for QA and automated tests
+module qa {};
+
 /// Interfaces for scanner control.
 module scanner {};
 
diff --git a/offapi/com/sun/star/qa/XDumper.idl b/offapi/com/sun/star/qa/XDumper.idl
new file mode 100644
index 0000000..4eebb03
--- /dev/null
+++ b/offapi/com/sun/star/qa/XDumper.idl
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard at googlemail.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef com_sun_star_qa_XDumper_idl
+#define com_sun_star_qa_XDumper_idl
+
+#include <com/sun/star/uno/XInterface.idl>
+
+module com
+{
+module sun
+{
+module star
+{
+module qa
+{
+
+/**
+ * Dumps the content into a string.
+ * This is an internal interface and should not be used outside of Libreoffice source code
+ */
+interface XDumper : com::sun::star::uno::XInterface
+{
+    /**
+     * dump the content into a string
+     * @since LibreOffice 3.6
+     */
+
+    string dump();
+};
+
+} ; // chart2
+} ; // com
+} ; // sun
+} ; // star
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 8090cba738350372b459f31deac8b97fa7153a04
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Mar 26 18:37:19 2012 +0200

    implement XDumper in ChartModel

diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 6430d3a..c23dba7 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1353,6 +1353,13 @@ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartM
     return uno::Sequence< Reference< chart2::data::XLabeledDataSequence > >();
 }
 
+//XDumper
+rtl::OUString SAL_CALL ChartModel::dump()
+    throw (uno::RuntimeException)
+{
+    return rtl::OUString();
+}
+
 }  // namespace chart
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index 9d08d28..40b1dbd 100644
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -64,9 +64,9 @@
 #include <com/sun/star/embed/XStorage.hpp>
 #include <com/sun/star/datatransfer/XTransferable.hpp>
 
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_21)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_21
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 21
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_22)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_22
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 22
 #include "comphelper/implbase_var.hxx"
 #endif
 #include <osl/mutex.hxx>
@@ -88,7 +88,7 @@ namespace impl
 {
 
 // Note: needed for queryInterface (if it calls the base-class implementation)
-typedef ::comphelper::WeakImplHelper21<
+typedef ::comphelper::WeakImplHelper22<
 //       ::com::sun::star::frame::XModel        //comprehends XComponent (required interface), base of XChartDocument
          ::com::sun::star::util::XCloseable     //comprehends XCloseBroadcaster
         ,::com::sun::star::frame::XStorable2    //(extension of XStorable)
@@ -111,6 +111,7 @@ typedef ::comphelper::WeakImplHelper21<
         ,::com::sun::star::document::XDocumentPropertiesSupplier
         ,::com::sun::star::chart2::data::XDataSource
         ,::com::sun::star::document::XUndoManagerSupplier
+        ,::com::sun::star::qa::XDumper
         >
     ChartModel_Base;
 }
@@ -607,6 +608,10 @@ public:
     // ____ XDataSource ____ allows access to the curently used data and data ranges
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences()
         throw (::com::sun::star::uno::RuntimeException);
+
+    // XDumper
+    virtual rtl::OUString dump()
+        throw (com::sun::star::uno::RuntimeException);
 };
 
 }  // namespace chart


More information about the Libreoffice-commits mailing list