summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-07-26 13:13:37 +0100
committerNoel Power <noel.power@suse.com>2013-07-26 13:15:19 +0100
commit7b3d8e0a7dcf6ae05e1de5c33ed382822cf52cce (patch)
treee61fbc444066ce4445b1c38587212a30a5956c73 /sc
parentb5fffdb8d0438a2fe933a5742d41fe50a14b71f3 (diff)
unit test for fdo#62729
Change-Id: Ib9be75459aa49b8bab968dedae9e0760ccef9a26
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/ods/fdo62729.odsbin0 -> 6772 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx30
2 files changed, 30 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/fdo62729.ods b/sc/qa/unit/data/ods/fdo62729.ods
new file mode 100644
index 000000000000..00b50798f6bc
--- /dev/null
+++ b/sc/qa/unit/data/ods/fdo62729.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 05b0c359df29..600bc5a7b75d 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -49,6 +49,7 @@ public:
void testDataBarExportODS();
void testDataBarExportXLSX();
void testMiscRowHeightExport();
+ void testNamedRangeBugfdo62729();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
@@ -60,6 +61,7 @@ public:
CPPUNIT_TEST(testColorScaleExportODS);
CPPUNIT_TEST(testColorScaleExportXLSX);
CPPUNIT_TEST(testMiscRowHeightExport);
+ CPPUNIT_TEST(testNamedRangeBugfdo62729);
CPPUNIT_TEST_SUITE_END();
private:
@@ -289,6 +291,34 @@ void ScExportTest::testMiscRowHeightExport()
miscRowHeightsTest( aTestValues, SAL_N_ELEMENTS(aTestValues) );
}
+
+void ScExportTest::testNamedRangeBugfdo62729()
+{
+ ScDocShellRef xShell = loadDoc("fdo62729.", ODS);
+ CPPUNIT_ASSERT(xShell.Is());
+ ScDocument* pDoc = xShell->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ ScRangeName* pNames = pDoc->GetRangeName();
+ //should be just a single named range
+ CPPUNIT_ASSERT(pNames->size() == 1 );
+ pDoc->DeleteTab(0);
+ //should be still a single named range
+ CPPUNIT_ASSERT(pNames->size() == 1 );
+ ScDocShellRef xDocSh = saveAndReload(xShell, ODS);
+ xShell->DoClose();
+
+ CPPUNIT_ASSERT(xDocSh.Is());
+ pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ pNames = pDoc->GetRangeName();
+ //after reload should still have a named range
+ CPPUNIT_ASSERT(pNames->size() == 1 );
+
+ xDocSh->DoClose();
+}
+
ScExportTest::ScExportTest()
: ScBootstrapFixture("/sc/qa/unit/data")
{