Kaydet (Commit) b99c869c authored tarafından Jan Holesovsky's avatar Jan Holesovsky

bnc#762542: Unit test for 1abc0695

Change-Id: I52ede543298d788cd047b8080819eef7d22a73e6
üst 0af2e9fa
...@@ -206,6 +206,8 @@ public: ...@@ -206,6 +206,8 @@ public:
void testRefStringXLSX(); void testRefStringXLSX();
void testRefStringConfigXLSX(); void testRefStringConfigXLSX();
void testBnc762542();
CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testBooleanFormatXLSX); CPPUNIT_TEST(testBooleanFormatXLSX);
CPPUNIT_TEST(testBasicCellContentODS); CPPUNIT_TEST(testBasicCellContentODS);
...@@ -301,6 +303,9 @@ public: ...@@ -301,6 +303,9 @@ public:
CPPUNIT_TEST(testEditEngStrikeThroughXLSX); CPPUNIT_TEST(testEditEngStrikeThroughXLSX);
CPPUNIT_TEST(testRefStringXLSX); CPPUNIT_TEST(testRefStringXLSX);
CPPUNIT_TEST(testRefStringConfigXLSX); CPPUNIT_TEST(testRefStringConfigXLSX);
CPPUNIT_TEST(testBnc762542);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3126,6 +3131,32 @@ void ScFiltersTest::testRefStringConfigXLSX() ...@@ -3126,6 +3131,32 @@ void ScFiltersTest::testRefStringConfigXLSX()
xDocSh->DoClose(); xDocSh->DoClose();
} }
void ScFiltersTest::testBnc762542()
{
ScDocShellRef xDocSh = loadDoc("bnc762542.", XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.Is());
ScDocument& rDoc = xDocSh->GetDocument();
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
SdrPage* pPage = pDrawLayer->GetPage(0);
CPPUNIT_ASSERT_MESSAGE("draw page for sheet 1 should exist.", pPage);
const size_t nCount = pPage->GetObjCount();
CPPUNIT_ASSERT_MESSAGE("There should be 10 shapes.", nCount == 10);
// previously, some of the shapes were (incorrectly) rotated by 90 degrees
for (size_t i : { 1, 2, 4, 5, 7, 9 })
{
SdrObject* pObj = pPage->GetObj(i);
CPPUNIT_ASSERT_MESSAGE("Failed to get drawing object.", pObj);
Rectangle aRect(pObj->GetCurrentBoundRect());
CPPUNIT_ASSERT_MESSAGE("Drawing object shouldn't be rotated.", aRect.GetWidth() > aRect.GetHeight());
}
xDocSh->DoClose();
}
ScFiltersTest::ScFiltersTest() ScFiltersTest::ScFiltersTest()
: ScBootstrapFixture( "sc/qa/unit/data" ) : ScBootstrapFixture( "sc/qa/unit/data" )
{ {
......
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