sc/qa/unit/data/xlsx/hyperlinks.xlsx |binary sc/qa/unit/subsequent_filters-test.cxx | 14 ++++++++++++++ sc/source/filter/oox/worksheethelper.cxx | 1 + 3 files changed, 15 insertions(+)
New commits: commit 10da10ee6ba37f4861045d1f8db0022293433cec Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri Feb 7 14:39:42 2014 -0500 fdo#74535: Don't forget clear the edit engine before re-using it. Else you'd get a very comical result. Change-Id: Ie73145dee47a8583f2e9cdb7ddb4f2d66f361dc1 diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 47b759d..0a560d1 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -1068,6 +1068,7 @@ void WorksheetGlobals::insertHyperlink( const CellAddress& rAddress, const OUStr { OUString aStr = aCell.getString(&rDoc.getDoc()); ScFieldEditEngine& rEE = rDoc.getDoc().GetEditEngine(); + rEE.Clear(); SvxURLField aURLField(rUrl, aStr, SVXURLFORMAT_REPR); SvxFieldItem aURLItem(aURLField, EE_FEATURE_FIELD); commit 36e7fca5fa87fc72cdc9315438d9437fae9aa3da Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri Feb 7 14:23:24 2014 -0500 fdo#74535: Write unit test for importing hyperlinks from xlsx. Change-Id: I64e053106cee396a09f2a4915c19fcb1d69e5e82 diff --git a/sc/qa/unit/data/xlsx/hyperlinks.xlsx b/sc/qa/unit/data/xlsx/hyperlinks.xlsx new file mode 100644 index 0000000..5faea7d Binary files /dev/null and b/sc/qa/unit/data/xlsx/hyperlinks.xlsx differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 448a9fa..83841b3 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -89,6 +89,7 @@ public: void testBasicCellContentODS(); void testRangeNameXLS(); void testRangeNameXLSX(); + void testHyperlinksXLSX(); void testHardRecalcODS(); void testFunctionsODS(); void testFunctionsExcel2010(); @@ -164,6 +165,7 @@ public: CPPUNIT_TEST(testBasicCellContentODS); CPPUNIT_TEST(testRangeNameXLS); CPPUNIT_TEST(testRangeNameXLSX); + CPPUNIT_TEST(testHyperlinksXLSX); CPPUNIT_TEST(testHardRecalcODS); CPPUNIT_TEST(testFunctionsODS); CPPUNIT_TEST(testFunctionsExcel2010); @@ -342,6 +344,18 @@ void ScFiltersTest::testRangeNameXLSX() xDocSh->DoClose(); } +void ScFiltersTest::testHyperlinksXLSX() +{ + ScDocShellRef xDocSh = loadDoc("hyperlinks.", XLSX); + ScDocument* pDoc = xDocSh->GetDocument(); + + CPPUNIT_ASSERT_EQUAL(OUString("10:ABC10"), pDoc->GetString(ScAddress(0,1,0))); + CPPUNIT_ASSERT_EQUAL(OUString("10:ABC11"), pDoc->GetString(ScAddress(0,2,0))); + CPPUNIT_ASSERT_EQUAL(OUString("10:ABC12"), pDoc->GetString(ScAddress(0,3,0))); + + xDocSh->DoClose(); +} + void ScFiltersTest::testHardRecalcODS() { ScDocShellRef xDocSh = loadDoc("hard-recalc.", ODS); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits