[Libreoffice-commits] core.git: Branch 'feature/unitver' - sc/qa

Andrzej Hunt andrzej at ahunt.org
Wed Aug 5 11:51:45 PDT 2015


 sc/qa/unit/units.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 6a75eeb0c3dc12844557027f0df443e1b57269c6
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Wed Aug 5 19:50:55 2015 +0100

    Test for tdf#92455 (persist purely local annotations after conversion)
    
    Change-Id: I3f0ed297ef4eb9ac7876a9e24e3c2f0c1ec0b521

diff --git a/sc/qa/unit/units.cxx b/sc/qa/unit/units.cxx
index 28cffa2..86efc22 100644
--- a/sc/qa/unit/units.cxx
+++ b/sc/qa/unit/units.cxx
@@ -948,6 +948,18 @@ void UnitsTest::testRangeConversion() {
         // TODO: we need to test:
         // 1. actual sensible ranges
     }
+
+    // test purely local annotations (tdf#92455)
+    ScAddress headerAddressCol4(3, 0, nTab);
+
+    mpDoc->SetValue(headerAddressCol4, 3);
+    setNumberFormatUnit(headerAddressCol4, "m");
+
+    aRange = ScRange(headerAddressCol4);
+    CPPUNIT_ASSERT(mpUnitsImpl->convertCellUnits(aRange, mpDoc, "cm"));
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(mpDoc->GetValue(headerAddressCol4), 300, 1e-7);
+
+    CPPUNIT_ASSERT(UnitsImpl::extractUnitStringForCell(headerAddressCol4, mpDoc) == "cm");
 }
 
 void UnitsTest::testConvertCellUnits()


More information about the Libreoffice-commits mailing list