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

Kohei Yoshida kohei.yoshida at collabora.com
Sun Mar 9 18:34:56 PDT 2014


 sc/qa/unit/ucalc_pivottable.cxx  |   25 +++++++++++++++++++++++++
 sc/source/core/data/dpoutput.cxx |    4 +++-
 2 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit 0919979bd1da3379e030b353a097d8fe1fd8341a
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sun Mar 9 21:28:05 2014 -0400

    fdo#75962: Avoid unwanted number detection when placing page field name.
    
    Change-Id: I1a3c57ec029e03198b8f190acfa8d59e142acaba

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index adff9b1..704861c 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1003,7 +1003,9 @@ void ScDPOutput::Output()
         else if (n > 1)
             aPageValue = ScResId(SCSTR_MULTIPLE).toString();
 
-        pDoc->SetString( nFldCol, nHdrRow, nTab, aPageValue );
+        ScSetStringParam aParam;
+        aParam.setTextInput();
+        pDoc->SetString(nFldCol, nHdrRow, nTab, aPageValue, &aParam);
 
         lcl_SetFrame( pDoc,nTab, nFldCol,nHdrRow, nFldCol,nHdrRow, 20 );
     }
commit bd378b6346bf5aca4328c57f2ff3c18932691a47
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sun Mar 9 21:27:35 2014 -0400

    fdo#75962: Write test for this first.
    
    Change-Id: I731b4cbf72066f8a0cbabb5040acfe9c828afd8f

diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
index 00e83b9..7ad0c1e 100644
--- a/sc/qa/unit/ucalc_pivottable.cxx
+++ b/sc/qa/unit/ucalc_pivottable.cxx
@@ -1668,6 +1668,31 @@ void Test::testPivotTableTextNumber()
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
+    // Set the Name dimension to page dimension.
+    pDPObj->BuildAllDimensionMembers();
+    ScDPSaveData aSaveData(*pDPObj->GetSaveData());
+    ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName("Name");
+    CPPUNIT_ASSERT(pDim);
+    pDim->SetOrientation(sheet::DataPilotFieldOrientation_PAGE);
+    OUString aVisiblePage("0004");
+    pDim->SetCurrentPage(&aVisiblePage);
+    pDPObj->SetSaveData(aSaveData);
+
+    aOutRange = refresh(pDPObj);
+
+    {
+        // Expected output table content.  0 = empty cell
+        const char* aOutputCheck[][2] = {
+            { "Name", "0004" },
+            {  0, 0 },
+            { "Sum - Value", 0 },
+            { "4", 0 }
+        };
+
+        bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Text number field members");
+        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+    }
+
     pDPs->FreeTable(pDPObj);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more tables.", pDPs->GetCount(), static_cast<size_t>(0));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be any more cache stored.",


More information about the Libreoffice-commits mailing list