Kaydet (Commit) f5dbe0ea authored tarafından Artur Dorda's avatar Artur Dorda Kaydeden (comit) Markus Mohrhard

Usage of XShapeDumper in Impress added

Change-Id: I7abb493d8baaa42a45e24276abdcadbfd186651a
üst 5f13c74b
......@@ -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:
......@@ -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();
}
......
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