[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Sun Feb 9 19:07:00 PST 2014


 sc/qa/unit/ucalc.cxx           |   25 +++++++++++++++++++++++++
 sc/qa/unit/ucalc.hxx           |    2 ++
 sc/source/core/data/table1.cxx |    2 +-
 3 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit b6378a1651e7157063746d7001ef566545338bd0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sun Feb 9 22:10:24 2014 -0500

    fdo#74323: The end position is inclusive.
    
    Change-Id: Ibd0ff19d7fd2de72a3b8d790a371da4b23df38c8

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 5291ad2..b3385a3 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1428,7 +1428,7 @@ bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMa
                     }
                 }
 
-                if (nTestRow < nEnd)
+                if (nTestRow <= nEnd)
                 {
                     // Cell found.
                     rRow = nTestRow;
commit e041a1bfef98b54656cfaafcb0f586867a21edf1
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sun Feb 9 21:58:55 2014 -0500

    fdo#74323: Add unit test for changing cases of text cells.
    
    Change-Id: I858e18a03d97434275676e771d91bdf3209f63fb

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 83498b3..5ae240f 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -80,6 +80,8 @@
 #include <sstream>
 #include <vector>
 
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+
 struct TestImpl
 {
     ScDocShellRef m_xDocShell;
@@ -5464,6 +5466,29 @@ void Test::testImportStream()
     m_pDoc->DeleteTab(0);
 }
 
+void Test::testTransliterateText()
+{
+    m_pDoc->InsertTab(0, "Test");
+
+    // Set texts to A1:A3.
+    m_pDoc->SetString(ScAddress(0,0,0), "Mike");
+    m_pDoc->SetString(ScAddress(0,1,0), "Noah");
+    m_pDoc->SetString(ScAddress(0,2,0), "Oscar");
+
+    // Change them to uppercase.
+    ScMarkData aMark;
+    aMark.SetMarkArea(ScRange(0,0,0,0,2,0));
+    ScDocFunc& rFunc = getDocShell().GetDocFunc();
+    rFunc.TransliterateText(
+        aMark, i18n::TransliterationModules_LOWERCASE_UPPERCASE, true, true);
+
+    CPPUNIT_ASSERT_EQUAL(OUString("MIKE"), m_pDoc->GetString(ScAddress(0,0,0)));
+    CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
+    CPPUNIT_ASSERT_EQUAL(OUString("OSCAR"), m_pDoc->GetString(ScAddress(0,2,0)));
+
+    m_pDoc->DeleteTab(0);
+}
+
 void Test::testMixData()
 {
     m_pDoc->InsertTab(0, "Test");
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index a32b048..64fde25 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -316,6 +316,7 @@ public:
     void testCondCopyPaste();
 
     void testImportStream();
+    void testTransliterateText();
 
     void testColumnFindEditCells();
 
@@ -447,6 +448,7 @@ public:
     CPPUNIT_TEST(testCondFormatInsertCol);
     CPPUNIT_TEST(testCondCopyPaste);
     CPPUNIT_TEST(testImportStream);
+    CPPUNIT_TEST(testTransliterateText);
     CPPUNIT_TEST(testColumnFindEditCells);
     CPPUNIT_TEST_SUITE_END();
 


More information about the Libreoffice-commits mailing list