Add unit test for text rotation.

Change-Id: Iba4e002c461f00807f277e6032afcdaaf25ea4a2
This commit is contained in:
Muthu Subramanian
2014-03-26 16:26:08 +05:30
parent 45c91575e7
commit 31b8ce1153
2 changed files with 22 additions and 0 deletions

Binary file not shown.

View File

@@ -23,6 +23,7 @@
#include <svx/svdotext.hxx>
#include <svx/svdoashp.hxx>
#include <svx/svdogrp.hxx>
#include <animations/animationnodehelper.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -62,6 +63,7 @@ public:
void testFdo72998();
void testStrictOOXML();
void testN862510_1();
void testN862510_2();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(testDocumentLayout);
@@ -80,6 +82,7 @@ public:
CPPUNIT_TEST(testFdo72998);
CPPUNIT_TEST(testStrictOOXML);
CPPUNIT_TEST(testN862510_1);
CPPUNIT_TEST(testN862510_2);
CPPUNIT_TEST_SUITE_END();
};
@@ -262,6 +265,25 @@ void SdFiltersTest::testN862510_1()
}
}
void SdFiltersTest::testN862510_2()
{
::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n862510_2.pptx") );
CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );
CPPUNIT_ASSERT_MESSAGE( "in destruction", !xDocShRef->IsInDestruction() );
SdDrawDocument *pDoc = xDocShRef->GetDoc();
CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
const SdrPage *pPage = pDoc->GetPage(1);
CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
{
SdrObjGroup *pGrpObj = dynamic_cast<SdrObjGroup *>( pPage->GetObj( 1 ) );
CPPUNIT_ASSERT( pGrpObj );
SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>( pGrpObj->GetSubList()->GetObj( 0 ) );
CPPUNIT_ASSERT( pObj );
CPPUNIT_ASSERT_MESSAGE( "Wrong Text Rotation!", pObj->GetExtraTextRotation( true ) == 90 );
}
}
void SdFiltersTest::testN828390()
{
bool bPassed = false;