diff options
author | Justin Luth <justin.luth@collabora.com> | 2018-05-23 08:36:54 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-06-11 15:16:32 +0200 |
commit | 654e6eb3025394ac28907784ff48273a3494542f (patch) | |
tree | 0f4f6974bb4fb18c816a9030fe46b0d7c34a678a /sc/qa | |
parent | 575c99b4e424523d8042f9773f60270fe571e2fb (diff) |
tdf#114487 sc htmlimp: rangeNames should be 3D
Without a visible sheet name, these absolute ranges
become relative after a round-trip.
Another way to handle this would be to ensure that ODS
(and other text-based formats) export Absolute in a
way that can be properly imported. But handling
it on import is safer and ensures UI consistency.
The InitRange default is for !IsFlag3D and !IsTabRel().
Since the range already imports as absolute, just add
the appropriate 3D flags.
Change-Id: Ia664e6f87e235096e1c2e5b702e18505e375e2ad
Reviewed-on: https://gerrit.libreoffice.org/54725
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit c42b1cf2464924b125aeae15968fb79cf795bc81)
Reviewed-on: https://gerrit.libreoffice.org/55272
(cherry picked from commit cd51f388c96cafdf81303722c43c6025d9f0073e)
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 7672b96a9850..6e0aac4be3e2 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -176,6 +176,7 @@ public: #if !defined _WIN32 void testSupBookVirtualPathXLS(); #endif + void testAbsNamedRangeHTML(); void testSheetLocalRangeNameXLS(); void testSheetTextBoxHyperlinkXLSX(); void testFontSizeXLSX(); @@ -282,6 +283,7 @@ public: CPPUNIT_TEST(testImageWithSpecialID); CPPUNIT_TEST(testPreserveTextWhitespaceXLSX); CPPUNIT_TEST(testPreserveTextWhitespace2XLSX); + CPPUNIT_TEST(testAbsNamedRangeHTML); CPPUNIT_TEST(testSheetLocalRangeNameXLS); CPPUNIT_TEST(testSheetTextBoxHyperlinkXLSX); CPPUNIT_TEST(testFontSizeXLSX); @@ -3328,6 +3330,20 @@ void ScExportTest::testImageWithSpecialID() } } +void ScExportTest::testAbsNamedRangeHTML() +{ + ScDocShellRef xDocSh = loadDoc("numberformat.", FORMAT_HTML); + xDocSh->DoHardRecalc(); + ScDocShellRef xDocSh2 = saveAndReload(xDocSh.get(), FORMAT_ODS); + xDocSh->DoClose(); + xDocSh2->DoHardRecalc(); + + ScDocument& rDoc = xDocSh2->GetDocument(); + ScRangeData* pRangeData = rDoc.GetRangeName()->findByUpperName(OUString("HTML_1")); + ScSingleRefData* pRef = pRangeData->GetCode()->FirstToken()->GetSingleRef(); + CPPUNIT_ASSERT_MESSAGE("HTML_1 is an absolute reference",!pRef->IsTabRel()); +} + void ScExportTest::testSheetLocalRangeNameXLS() { ScDocShellRef xDocSh = loadDoc("named-ranges-local.", FORMAT_XLS); |