Kaydet (Commit) 14c2ab30 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add export test for charts

Change-Id: I176f7967d37f3032057758d9aaa5f39c46d29c3d
üst 84a8f817
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#*************************************************************************
$(eval $(call gb_CppunitTest_CppunitTest,chart2_export))
$(eval $(call gb_CppunitTest_use_external,chart2_export,boost_headers))
$(eval $(call gb_CppunitTest_add_exception_objects,chart2_export, \
chart2/qa/extras/chart2export \
))
$(eval $(call gb_CppunitTest_use_libraries,chart2_export, \
avmedia \
basegfx \
comphelper \
cppu \
cppuhelper \
drawinglayer \
editeng \
fileacc \
for \
forui \
i18nlangtag \
msfilter \
oox \
sal \
salhelper \
sax \
sb \
sc \
sfx \
sot \
svl \
svt \
svx \
svxcore \
test \
tl \
tk \
ucbhelper \
unotest \
utl \
vbahelper \
vcl \
xo \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_set_include,chart2_export,\
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,chart2_export,\
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_ure,chart2_export))
$(eval $(call gb_CppunitTest_use_components,chart2_export,\
basic/util/sb \
chart2/source/controller/chartcontroller \
chart2/source/chartcore \
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 \
linguistic/source/lng \
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 \
$(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \
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 \
svtools/util/svt \
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_use_configuration,chart2_export))
$(eval $(call gb_CppunitTest_use_filter_configuration,chart2_export))
$(eval $(call gb_CppunitTest_use_unittest_configuration,chart2_export))
# vim: set noet sw=4 ts=4:
......@@ -17,7 +17,7 @@ $(eval $(call gb_Module_add_targets,chart2,\
))
$(eval $(call gb_Module_add_slowcheck_targets,chart2,\
CppunitTest_chart2_importtest \
CppunitTest_chart2_exporttest \
))
$(eval $(call gb_Module_add_subsequentcheck_targets,chart2,\
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "charttest.hxx"
class Chart2ExportTest : public ChartTest
{
public:
void test();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
CPPUNIT_TEST_SUITE_END();
private:
};
void Chart2ExportTest::test()
{
load("/chart2/qa/extras/data/ods/", "simple_export_chart.ods");
reload("Calc Office Open XML");
}
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -22,6 +22,10 @@
#include <com/sun/star/table/XTableChart.hpp>
#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <unotools/tempfile.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
......@@ -30,6 +34,8 @@
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <iostream>
using namespace com::sun::star;
using namespace com::sun::star::uno;
......@@ -37,6 +43,7 @@ class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest
{
public:
void load( const char* pDir, const char* pName );
void reload( const OUString& rFilterName );
virtual void setUp();
virtual void tearDown();
......@@ -50,6 +57,22 @@ void ChartTest::load( const char* pDir, const char* pName )
CPPUNIT_ASSERT(mxComponent.is());
}
void ChartTest::reload(const OUString& rFilterName)
{
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aArgs(1);
aArgs[0].Name = "FilterName";
aArgs[0].Value <<= rFilterName;
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
xStorable->storeToURL(aTempFile.GetURL(), aArgs);
uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY);
xComponent->dispose();
mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.sheet.SpreadsheetDocument");
std::cout << aTempFile.GetURL();
CPPUNIT_ASSERT(mxComponent.is());
}
void ChartTest::setUp()
{
test::BootstrapFixture::setUp();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment