[Libreoffice-commits] .: Branch 'feature/gsoc_test_improvements' - sd/Module_sd.mk sd/qa
Artur Dorda
adorda at kemper.freedesktop.org
Tue Jun 12 16:31:52 PDT 2012
sd/Module_sd.mk | 3 --
sd/qa/unit/regression-test.cxx | 42 +++++++++++++++++++----------------------
2 files changed, 21 insertions(+), 24 deletions(-)
New commits:
commit d975aea6c3a8c2e5e8f04e7eea7f86c8bc274c44
Author: Artur Dorda <artur.dorda+libo at gmail.com>
Date: Wed Jun 13 01:30:59 2012 +0200
Usage of XShapeDumper in Impress added
Change-Id: I7abb493d8baaa42a45e24276abdcadbfd186651a
diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk
index d4c080d..af2809a 100644
--- a/sd/Module_sd.mk
+++ b/sd/Module_sd.mk
@@ -44,6 +44,7 @@ ifneq ($(OS),DRAGONFLY)
$(eval $(call gb_Module_add_check_targets,sd,\
CppunitTest_sd_uimpress \
CppunitTest_sd_filters_test \
+ CppunitTest_sd_regression_test \
))
endif
@@ -52,6 +53,4 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sd,\
JunitTest_sd_unoapi \
))
-# Still a problem in line 16
-# CppunitTest_sd_regression_test \
# vim: set noet sw=4 ts=4:
diff --git a/sd/qa/unit/regression-test.cxx b/sd/qa/unit/regression-test.cxx
index 4ed5b80..cf39d2c 100644
--- a/sd/qa/unit/regression-test.cxx
+++ b/sd/qa/unit/regression-test.cxx
@@ -56,6 +56,9 @@
#include <iostream>
#include <rtl/oustringostreaminserter.hxx>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <drawinglayer/XShapeDumper.hxx>
+
namespace {
bool compareFiles( const rtl::OUString& aFileNameOne, const rtl::OUString& aFileNameTwo)
@@ -172,29 +175,24 @@ void SdFiltersTest::test()
CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );
CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() );
- uno::Reference< frame::XModel > xModel = xDocShRef->GetModel();
- CPPUNIT_ASSERT(xModel.is());
- uno::Reference< frame::XStorable > xStorable( xModel, uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT( xStorable.is());
-
- uno::Sequence< beans::PropertyValue > aArgs(1);
- beans::PropertyValue aValue;
- uno::Any aAny;
-
- aAny <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("impress_svg_Export"));
-
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
- aValue.Value = aAny;
- aValue.State = beans::PropertyState_DIRECT_VALUE;
-
- aArgs[0] = aValue;
-
- rtl::OUString aNewSvgURL = m_aSolverRootURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/unittest/sd/test2.svg"));
-
- xStorable->storeToURL( aNewSvgURL, aArgs );
-
- compareFiles( getPathFromSrc("/sd/qa/unit/data/svg/test.svg"), getPathFromSolver("/unittest/sd/test2.svg") );
+ uno::Reference<frame::XModel> xTempModel(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xTempModel.is());
+ uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier (xTempModel, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xDrawPagesSupplier.is());
+ uno::Reference< drawing::XDrawPages > xDrawPages = xDrawPagesSupplier->getDrawPages();
+ CPPUNIT_ASSERT(xDrawPages.is());
+ XShapeDumper xShapeDumper;
+ sal_Int32 nLength = xDrawPages->getCount();
+ for (sal_Int32 i = 0; i < nLength; ++i)
+ {
+ uno::Reference<drawing::XDrawPage> xDrawPage;
+ uno::Any aAny = xDrawPages->getByIndex(i);
+ aAny >>= xDrawPage;
+ uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY_THROW);
+ rtl::OUString aString = xShapeDumper.dump(xShapes);
+ std::cout << aString << std::endl;
+ }
xDocShRef->DoClose();
}
More information about the Libreoffice-commits
mailing list