summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-03 04:26:43 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-03 04:29:49 +0200
commita719841d02fb93ddfc80956c5e6e417f551e8a9f (patch)
tree8c216ac7e8c2fe80bf92a1ebb08edc3b4db0e0f7
parente1c70f2f046ab6c5bb808666b4f5466902b9fcf8 (diff)
add test case for fdo#62938
Change-Id: Ib15ff9d40b01dee2102ec6137d8b6394f7957ab8
-rw-r--r--sc/qa/unit/data/ods/print-range.odsbin0 -> 6876 bytes
-rw-r--r--sc/qa/unit/helper/qahelper.hxx30
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx16
3 files changed, 46 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/print-range.ods b/sc/qa/unit/data/ods/print-range.ods
new file mode 100644
index 000000000000..d7207e16a62e
--- /dev/null
+++ b/sc/qa/unit/data/ods/print-range.ods
Binary files differ
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index a0168c4245d1..ad25b74d1967 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -115,6 +115,36 @@ void loadFile(const OUString& aFileName, std::string& aContent)
aContent = aOStream.str();
}
+std::string print(const ScAddress& rAddr)
+{
+ std::stringstream str;
+ str << "Col: " << rAddr.Col();
+ str << " Row: " << rAddr.Row();
+ str << " Tab: " << rAddr.Tab();
+ return str.str();
+}
+
+namespace CppUnit {
+
+template<>
+struct assertion_traits<ScRange>
+{
+ static bool equal( const ScRange& x, const ScRange& y )
+ {
+ return x == y;
+ }
+
+ static std::string toString( const ScRange& x )
+ {
+ std::stringstream str;
+ str << "Start: " << print(x.aStart);
+ str << "\nEnd: " << print(x.aEnd);
+ return str.str();
+ }
+};
+
+}
+
class ScBootstrapFixture : public test::BootstrapFixture
{
protected:
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 82bbbb4abb2b..ad5466aae707 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -136,6 +136,8 @@ public:
void testMiscRowHeights();
void testOptimalHeightReset();
+ void testPrintRangeODS();
+
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testBasicCellContentODS);
CPPUNIT_TEST(testRangeNameXLS);
@@ -198,6 +200,7 @@ public:
#endif
CPPUNIT_TEST(testMiscRowHeights);
CPPUNIT_TEST(testOptimalHeightReset);
+ CPPUNIT_TEST(testPrintRangeODS);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1925,6 +1928,19 @@ void ScFiltersTest::testOptimalHeightReset()
xDocSh->DoClose();
}
+void ScFiltersTest::testPrintRangeODS()
+{
+ ScDocShellRef xDocSh = loadDoc("print-range.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ const ScRange* pRange = pDoc->GetRepeatRowRange(0);
+ CPPUNIT_ASSERT(pRange);
+ CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,0,1,0), *pRange);
+
+ pRange = pDoc->GetRepeatRowRange(0);
+ CPPUNIT_ASSERT(pRange);
+ CPPUNIT_ASSERT_EQUAL(ScRange(0,2,1,0,4,1), *pRange);
+}
+
ScFiltersTest::ScFiltersTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{