[Libreoffice-commits] core.git: sc/qa
Jan Holesovsky
kendy at collabora.com
Thu Jul 30 00:42:17 PDT 2015
sc/qa/unit/data/xlsx/bnc762542.xlsx |binary
sc/qa/unit/subsequent_filters-test.cxx | 31 +++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
New commits:
commit b99c869c4361c7d5f51462c922fd7e9d64e1433b
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Jul 30 09:29:29 2015 +0200
bnc#762542: Unit test for 1abc0695d770eebd21256a86aeee14a5384d84c7
Change-Id: I52ede543298d788cd047b8080819eef7d22a73e6
diff --git a/sc/qa/unit/data/xlsx/bnc762542.xlsx b/sc/qa/unit/data/xlsx/bnc762542.xlsx
new file mode 100644
index 0000000..1cda1fd
Binary files /dev/null and b/sc/qa/unit/data/xlsx/bnc762542.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 206c750..cd909f9 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -206,6 +206,8 @@ public:
void testRefStringXLSX();
void testRefStringConfigXLSX();
+ void testBnc762542();
+
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testBooleanFormatXLSX);
CPPUNIT_TEST(testBasicCellContentODS);
@@ -301,6 +303,9 @@ public:
CPPUNIT_TEST(testEditEngStrikeThroughXLSX);
CPPUNIT_TEST(testRefStringXLSX);
CPPUNIT_TEST(testRefStringConfigXLSX);
+
+ CPPUNIT_TEST(testBnc762542);
+
CPPUNIT_TEST_SUITE_END();
private:
@@ -3126,6 +3131,32 @@ void ScFiltersTest::testRefStringConfigXLSX()
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()
: ScBootstrapFixture( "sc/qa/unit/data" )
{
More information about the Libreoffice-commits
mailing list