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) ...@@ -44,6 +44,7 @@ ifneq ($(OS),DRAGONFLY)
$(eval $(call gb_Module_add_check_targets,sd,\ $(eval $(call gb_Module_add_check_targets,sd,\
CppunitTest_sd_uimpress \ CppunitTest_sd_uimpress \
CppunitTest_sd_filters_test \ CppunitTest_sd_filters_test \
CppunitTest_sd_regression_test \
)) ))
endif endif
...@@ -52,6 +53,4 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sd,\ ...@@ -52,6 +53,4 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sd,\
JunitTest_sd_unoapi \ JunitTest_sd_unoapi \
)) ))
# Still a problem in line 16
# CppunitTest_sd_regression_test \
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
#include <iostream> #include <iostream>
#include <rtl/oustringostreaminserter.hxx> #include <rtl/oustringostreaminserter.hxx>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <drawinglayer/XShapeDumper.hxx>
namespace { namespace {
bool compareFiles( const rtl::OUString& aFileNameOne, const rtl::OUString& aFileNameTwo) bool compareFiles( const rtl::OUString& aFileNameOne, const rtl::OUString& aFileNameTwo)
...@@ -172,29 +175,24 @@ void SdFiltersTest::test() ...@@ -172,29 +175,24 @@ void SdFiltersTest::test()
CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() ); CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );
CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() ); CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() );
uno::Reference< frame::XModel > xModel = xDocShRef->GetModel(); uno::Reference<frame::XModel> xTempModel(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(xModel.is()); CPPUNIT_ASSERT(xTempModel.is());
uno::Reference< frame::XStorable > xStorable( xModel, uno::UNO_QUERY_THROW); uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier (xTempModel, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT( xStorable.is()); CPPUNIT_ASSERT(xDrawPagesSupplier.is());
uno::Reference< drawing::XDrawPages > xDrawPages = xDrawPagesSupplier->getDrawPages();
uno::Sequence< beans::PropertyValue > aArgs(1); CPPUNIT_ASSERT(xDrawPages.is());
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") );
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(); 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